MCP Client for Testing

by piebro

2 stars
326 downloads
Not rated
GitHub

About

A simple MCP (Model Context Protocol) client for testing MCP Server

Details

Author
piebro
GitHub stars
2
Downloads
326
Categories
Other, Developer Tools

- Minimalistic design focused on testing tool calls
- CLI invocation via uvx with JSON configuration
- Python API for integration into test suites
- Configurable client and server log levels
- Works with any MCP server that can be launched as a subprocess
- Supports passing environment variables to the server process

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Client for Testing
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install uv, then invoke from the command line using uvx mcp-client-for-testing with a JSON configuration and tool call definition. Alternatively, install the Python package and use the execute_tool function from mcp_client_for_testing.client in your own code. Command line flags allow setting client and server log levels.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp client for testing": {
            "mcp-client-for-testing": {
                "command": "uvx",
                "args": [
                    "mcp-client-for-testing",
                    "\\"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-client-for-testing": {
        "command": "uvx",
        "args": [
            "mcp-client-for-testing",
            "\\"
        ]
    }
}

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 git@github.com: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.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.