mcpField
M
MCP Client for Testing

MCP Client for Testing

Local
github.com/piebroDeveloper Tools2Updated 78w ago

About MCP Client for Testing

MCP Client for Testing is a minimal client for developers testing tool calls in MCP servers. It can run from the command line or be used as a Python package in code.

Key features

  1. 01Test MCP tool calls
  2. 02Run from the command line
  3. 03Python interface for code

Use cases

  1. 01Check responses from MCP server tools
  2. 02Execute tool calls in scripts

MCP support

It acts as an MCP client, connecting to a configured MCP server and executing tool calls for testing.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"client-for-testing": {
"command": "uvx",
"args": [
"mcp-client-for-testing"
]
}
}
}
Run commanduvx mcp-client-for-testing

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypimcp-client-for-testing

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Client for Testing

A minimalistic MCP (Model Context Protocol) client for testing tool calls in MCP servers.

Usage

Install uv and test a tool call in an MCP server like this:

uvx mcp-client-for-testing \
    --config '
    [
        {
            "name": "name of mcp server",
            "command": "uv",
            "args": [
                "--directory", 
                "path/to/root/dir/", 
                "run", 
                "server.py"
            ],
            "env": {}
        }
    ]
    ' \
    --client_log_level "WARNING" \
    --server_log_level "INFO" \
    --tool_call '{"name": "tool-name", "arguments": {}}'

To use it in code, install the package:

uv pip install mcp-client-for-testing 

and use it like this:

import asyncio

from mcp_client_for_testing.client import execute_tool

async def main():
    config = [
        {
            "name": "name of mcp server",
            "command": "uv",
            "args": [
                "--directory", 
                "path/to/root/dir/", 
                "run", 
                "server.py"
            ],
            "env": {}
        }
    ]
    tool_call = {"name": "tool-name", "arguments": {}}
    
    await execute_tool(config, tool_call)

if __name__ == "__main__":
    asyncio.run(main())

Example

Use the echo-mcp-server-for-testing with uvx to test the MCP client.

uvx mcp-client-for-testing \
    --config '
    [
        {
            "name": "echo-mcp-server-for-testing",
            "command": "uvx",
            "args": [
                "echo-mcp-server-for-testing"
            ],
            "env": {
                "SECRET_KEY": "123456789"
            }
        }
    ]
    ' \
    --client_log_level "WARNING" \
	--server_log_level "INFO" \
    --tool_call '{"name": "echo_tool", "arguments": {"message": "Hello, world!"}}'

Development

Installation from source
  1. Clone the repo git clone [email protected]:piebro/mcp-client-for-testing.git.
  2. Go into the root dir cd mcp-client-for-testing.
  3. Install in development mode: uv pip install -e .
Formatting and Linting

The code is formatted and linted with ruff:

uv run ruff format
uv run ruff check --fix
Building with uv

Build the package using uv:

uv build
Releasing a New Version

To release a new version of the package to PyPI, create and push a new Git tag:

  1. Checkout the main branch and get the current version:

    git checkout main
    git pull origin main
    git describe --tags
    
  2. Create and push a new Git tag:

    git tag v0.2.0
    git push origin v0.2.0
    

The GitHub Actions workflow will automatically build and publish the package to PyPI when a new tag is pushed. The python package version number will be derived directly from the Git tag.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.