回显测试MCP服务器

一个简单的回显MCP(模型上下文协议)服务器,用于测试MCP客户端,也可作为新MCP服务器的模板。

  • by piebro
  • Python
  • 本地部署
  • 3 星标
  • 更新于
在 GitHub 查看 piebro/echo-mcp-server-for-testing

使用说明

用于测试的echo mcp服务器

一个简单的回声MCP(模型上下文协议)服务器 echo_tool 用于测试MCP客户端。 它也是新MCP服务器的模板。

用法

安装 紫外线 并使用以下命令将服务器添加到MCP配置中 uvx:

{
    "name": "echo-mcp-server-for-testing",
    "command": "uvx",
    "args": [
        "echo-mcp-server-for-testing"
    ],
    "env": {
        "SECRET_KEY": "123456789"
    }
}

或克隆仓库并使用 uv 使用目录:

{
    "name": "echo-mcp-server-for-testing",
    "command": "uv",
    "args": [
        "--directory",
        "path/to/root/dir/",
        "run",
        "main.py"
    ],
    "env": {
        "SECRET_KEY": "123456789"
    }
}

发展

测试

克隆仓库并使用 用于测试的mcp客户端 测试服务器的工具。

uvx mcp-client-for-testing \
    --config '
    [
        {
            "name": "echo-mcp-server-for-testing",
            "command": "uv",
            "args": [
                "--directory", 
                "path/to/root/dir/", 
                "run", 
                "main.py"
            ],
            "env": {
                "SECRET_KEY": "123456789"
            }
        }
    ]
    ' \
    --tool_call '{"name": "echo_tool", "arguments": {"message": "Hello, world!"}}'

格式化和装订

代码被格式化并用ruff过梁:

uv run ruff format
uv run ruff check --fix

紫外线建筑

使用uv构建包:

uv build

发布新版本

要将包的新版本发布到PyPI,请创建并推送一个新的Git标签:

  1. 检查主分支并获取当前版本:

    git checkout main
    git pull origin main
    git describe --tags
    
  2. 创建并推送一个新的Git标签:

    git tag v0.2.0
    git push origin v0.2.0
    

当推送新标签时,GitHub Actions工作流将自动构建包并将其发布到PyPI。 python包版本号将直接从Git标签中导出。

许可证

该项目根据MIT许可证获得许可。请参阅 许可证 文件以获取详细信息。