Get the FREE Ultimate OpenClaw Setup Guide →

mcp-client

MCP server from dazzaji/mcp-client-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dazzaji-mcp-client-server python client.py \
  --env SERVER_PATH="path to the server entry point (e.g., /Users/youruser/filesystem/dist/index.js)" \
  --env ALLOWED_DIRECTORY="path to the allowed root directory (e.g., /Users/youruser/mcp-hello/module1/files)"

How to use

This MCP server is a Python MCP client designed to connect to a separate filesystem server and expose tooling via the MCP protocol. It uses a virtual environment and a .env configuration to specify the remote server entry and the allowed directory. Tools such as list_directory, read_file, and write_file can be invoked through the client, with optional arguments passed as JSON strings. To test basic connectivity, start by configuring SERVER_PATH and ALLOWED_DIRECTORY in a .env file, activate your virtual environment, and run the client. You can also pass a specific tool and arguments via command line to exercise particular capabilities.

When using the client with a server, the client will connect to the filesystem server, list available tools, and perform operations like creating test files in the allowed directory. For example, you can use list_directory to enumerate files, read_file to read a text file, or write_file to create a new file with content. If you omit the --tool and --args options, the client may attempt a default action defined by the script (such as writing a test file).

How to install

Prerequisites:

  • Python 3.8+ (tested with virtual environments)
  • Access to the filesystem server you will connect to

Installation steps:

  1. Create a project directory and set up a virtual environment: mkdir mcp-client-py cd mcp-client-py python -m venv venv source venv/bin/activate # on Windows use: venv\Scripts\activate

  2. Install dependencies from requirements.txt (assumes you have the repository with client.py and requirements.txt): pip install -r requirements.txt

  3. Create and configure a .env file in the project root (see additional notes for variable details): SERVER_PATH=/path/to/server/entry ALLOWED_DIRECTORY=/path/to/allowed/directory

  4. Run the client: python client.py

Optional: run with explicit tool and arguments: python client.py --server-path /path/to/server --allowed-dir /path/to/dir --tool list_directory --args '{"path": "/path/to/dir", "recursive": true}'

Additional notes

Environment variables:

  • SERVER_PATH: Path to the server entry (the remote filesystem server's executable or entry point).
  • ALLOWED_DIRECTORY: The root directory on the server that the client is permitted to access.
  • TOOL and ARGS can be provided to override default behavior when starting the client.

Common issues:

  • Ensure the filesystem server is running and reachable at SERVER_PATH if required by the setup.
  • Verify paths are correct for your operating system and that the Python virtual environment is activated when running client.py.
  • If using Windows, adjust shell commands for environment activation and path formats accordingly.

Configuration tips:

  • Keep SERVER_PATH and ALLOWED_DIRECTORY in a dedicated .env to simplify switching between test and production environments.
  • If you encounter permission errors, confirm the server's access controls align with ALLOWED_DIRECTORY.

Related MCP Servers

Sponsor this space

Reach thousands of developers