Python服务器模板

一个基于Python的MCP服务器启动模板,提供快速搭建和扩展工具的功能。

  • by mcp-use
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 mcp-use/python-server-starter

使用说明

Python MCP服务器入门

最低限度 mcp使用 Python服务器模板。

快速开始

pip install -r requirements.txt
python server.py

服务器运行在 http://localhost:8000/mcp.

示例工具

  • greet(name) -返回问候语
  • add(a, b) -将两个数字相加
  • get_current_time() -返回当前时间戳

添加工具

@server.tool()
def my_tool(arg: str) -> str:
    """Tool description shown to clients."""
    return f"Result: {arg}"

文档

查看完整 mcp使用Python文档.