MCP Catalogs
首页

zeromcp

by mrexodia·77·综合分 46

零依赖的 Python MCP 服务器实现,提供类型安全的工具定义和多种传输选项。

developer-toolsai-llmother
2
Forks
5
活跃 Issue
2 个月前
最近提交
2 天前
收录于

概述

Zeromcp 是一个轻量级的纯 Python MCP 服务器实现,没有外部依赖。它专注于提供一个简洁而健壮的实现,允许开发者通过清晰的 Python 类型注解暴露工具。该服务器支持 HTTP/SSE 和 stdio 传输,使其与多种 MCP 客户端兼容。其简洁性和性能使其非常适合将 MCP 功能嵌入到现有的 Python 应用程序中。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:在 Python 应用中嵌入 MCP 功能,同时保持最小开销
:创建没有复杂依赖链的自定义 MCP 服务器
:为 AI 模型交互开发类型安全的工具接口
:Zeromcp 与其他 MCP 服务器有何不同?
:Zeromcp 支持哪些传输协议?

什么时候选它

当您需要一个轻量级、无依赖的 MCP 服务器来实现简单工具时,选择 zeromcp,尤其是在需要最小化依赖的限制性环境中工作时。

什么时候不要选它

如果您需要高级 MCP 功能、复杂的工具定义或需要认证机制,应避免使用 zeromcp,因为它被有意设计得非常简单且缺乏这些功能。

此 server 暴露的工具

从 README 抽取出 6 个工具
  • greetdef greet(name: Annotated[str, 'Name to greet'], age: Annotated[int | None, 'Age of person'] = None) -> str

    Generate a greeting message

  • struct_getdef struct_get(names: Annotated[list[str], 'Array of structure names'] | Annotated[str, 'Single structure name']) -> list[StructInfo]

    Retrieve structure information by names

  • dividedef divide(numerator: Annotated[float, 'Numerator'], denominator: Annotated[float, 'Denominator']) -> float

    Divide two numbers

  • read_filedef read_file() -> dict

    Get information about data.txt

  • read_any_filedef read_any_file(filename: Annotated[str, 'Name of file to read']) -> dict

    Get information about any file

  • code_reviewdef code_review(code: Annotated[str, 'Code to review'], language: Annotated[str, 'Programming language'] = 'python') -> str

    Review code for bugs and improvements

可对比工具

mcpnomic-mcppython-mcp

安装

pip install zeromcp

或使用 uv:

uv add zeromcp

在 Claude Desktop 中配置:

{
  "mcpServers": {
    "zeromcp-server": {
      "command": "python",
      "args": ["path/to/your/server.py"]
    }
  }
}

对于 HTTP 传输:

{
  "mcpServers": {
    "zeromcp-server": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

FAQ

Zeromcp 与其他 MCP 服务器有何不同?
Zeromcp 使用零外部依赖,完全用 Python 编写,并利用原生 Python 注解提供类型安全的工具定义。
Zeromcp 支持哪些传输协议?
Zeromcp 支持 HTTP/SSE 和 stdio 传输,使其与 Claude Desktop、VS Code 等多种 MCP 客户端兼容。

zeromcp 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。