简单的MCP线束
用于交互式探索MCP服务器功能的命令行REPL工具。
这个工具做什么
MCP服务器测试工具允许您交互式地探索和测试在本地计算机上运行的模型上下文协议(MCP)服务器。将其指向MCP服务器,立即查看它公开了哪些工具和资源,然后使用参数调用它们。
先决条件
- Python 3.11或更高版本
- 用于测试的MCP服务器可执行文件
uv包管理器(推荐)或pip
安装
- 克隆或导航到项目:
cd simple-MCP-harness- 安装依赖项:
uv sync配置
- 创建.env文件:
cp .env.example .env- 使用您的MCP服务器详细信息编辑.env:
MCP_SERVER_COMMAND=/path/to/your/mcp-server
MCP_SERVER_ARGS=--verbose
#Example
#MCP_SERVER_COMMAND=docker run --rm -i ghcr.io/commercial-software-engineering/crisp-mcp
跑步
uv run python -m src.harness.main基本命令
list-显示所有可用功能list tools-仅显示工具call-调用工具switch-切换到其他服务器help-显示命令帮助exit或quit-退出REPL
示例会话
> list tools
Tools:
- read_file: Read contents of a file
Parameters: {"path": "string"}
> call read_file {"path": "/home/user/test.txt"}
Result:
This is the content of the test file.
Execution time: 0.23s
> exit
Disconnecting...
Goodbye.文档
看 specs/001-mcp-test-harness/quickstart.md 获取完整的使用指南。
许可证
研究尖峰项目——没有正式许可证。
