Skip to main content
Glama
roderickch01

mcp-server-starter

by roderickch01

mcp-server-starter

用于使用 Python 构建模型上下文协议 (MCP) 服务器的骨架。当你需要向 Claude Desktop、Claude Code 或任何兼容 MCP 的客户端公开一组自定义工具/数据时,请 fork 此项目。

什么是 MCP 服务器?

MCP 是一种开放协议,允许语言模型客户端通过标准接口调用外部工具和数据源。MCP 服务器是托管这些工具的小型进程——你编写函数,协议负责处理发现和调用。

快速入门

使用 pipx 直接从本仓库安装:

pipx install git+https://github.com/roderickch01/mcp-server-starter.git

然后将其注册到你的 MCP 客户端。对于 Claude Desktop,请编辑 ~/.config/Claude/claude_desktop_config.json (Linux)、~/Library/Application Support/Claude/claude_desktop_config.json (macOS) 或 %APPDATA%\Claude\claude_desktop_config.json (Windows),并添加:

{
  "mcpServers": {
    "starter": {
      "command": "mcp-server-starter"
    }
  }
}

此代码片段的副本位于 examples/claude_desktop_config.json。重启你的客户端,echoadd 工具就会出现。

包含的内容

两个用于验证连接的演示工具:

  • echo(text: str) -> str — 返回 "echo: {text}"

  • add(a: int, b: int) -> int — 返回两数之和

两者都位于 src/mcp_server_starter/server.py 中(不到 30 行代码)。

添加你自己的工具

打开 server.py 并使用 @mcp.tool() 装饰任何函数。函数签名、类型提示和文档字符串将自动成为工具的模式:

@mcp.tool()
def reverse(text: str) -> str:
    """Return the input string reversed."""
    return text[::-1]

重新安装 (pipx reinstall mcp-server-starter) 并重启你的 MCP 客户端。新工具即可被发现。

本地开发

git clone https://github.com/roderickch01/mcp-server-starter.git
cd mcp-server-starter
python -m venv .venv && source .venv/bin/activate
pip install -e .
mcp-server-starter   # runs the server over stdio

许可证

MIT — 参见 LICENSE

Install Server
A
license - permissive license
A
quality
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/roderickch01/mcp-server-starter'

If you have feedback or need assistance with the MCP directory API, please join our Discord server