mcp-client-for-testing
A simple MCP (Model Context Protocol) client for testing MCP Server
Documentation
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-testingand 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 --fixBuilding with uv
Build the package using uv:
uv buildReleasing 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 --tags2. Create and push a new Git tag:
git tag v0.2.0
git push origin v0.2.0The 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.
Frequently asked questions
What is mcp-client-for-testing?
mcp-client-for-testing is A simple MCP (Model Context Protocol) client for testing MCP Server
How do I install mcp-client-for-testing?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-client-for-testing open source?
Yes — it is hosted on GitHub at https://github.com/piebro/mcp-client-for-testing and has 2 stars.
Related MCP tools
A text-based user interface (TUI) client for interacting with MCP servers using Ollama. Features include multi-server, dynamic model switching, streaming res...
基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择ChatGPT/Claude/DeepSeek/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
🚀 The fast, Pythonic way to build MCP servers and clients Trusted by 19900+ developers. Trusted by 19900+ developers. Trusted by 19900+ developers.
Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth! Python-based implementation. Trusted by 11000+ developers.
Agent Framework For Fintech for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP