Skip to main content
Glama
astrodevit-creator

mcp-server-skeleton

mcp-server-skeleton

一个极简的 Model Context Protocol (MCP) 服务器骨架——仅使用标准库(基于 stdio 的 JSON-RPC 2.0)。实现核心握手(initialize、tools/list、tools/call),让你无需任何外部依赖即可注册自己的工具。接入 Shopify / Meta Ads / Supabase / n8n,并将它们暴露给 Claude、Cursor、Codex、Gemini 或 Hermes。

原创项目,顺应“智能体技能 / MCP”趋势。不是又一个 MCP 目录——而是一个可运行、可扩展的服务器。

注册工具

from mcp_server import MCPServer

server = MCPServer("my-tools", "0.1.0")
server.register_tool(
    "add", "Add two numbers",
    {"type": "object", "properties": {"a": {"type": "number"}, "b": {"type": "number"}}},
    lambda args: str(args["a"] + args["b"]),
)
server.serve_stdio()

Related MCP server: mini-mcp-demo

测试

pip install -e ".[dev]"
pytest

许可证

MIT — 参见 LICENSE。


链接

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Exposes a verified tool registry (calculator, sandboxed file read, web fetch) over MCP stdio, enabling any MCP-capable client to reuse the same tools from the inspectable ReAct loop.
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables local tool calling over Model Context Protocol via stdio, providing deterministic tools such as calc.add, text.word_count, and text.summarize_naive after JSON-RPC handshake and discovery.
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI clients to call small utility tools like echo and Markdown-to-PDF conversion, running locally over stdio.
    2
    MIT