MCP服务器与客户端构建工具

hk-fastmcp是一个快速、Python化的工具,用于构建MCP服务器和客户端。

  • by healthkowshik
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 healthkowshik/hk-fastmcp

使用说明

香港快速医疗中心

构建MCP服务器和客户端的快速Python方法。

设置

uv init
uv add "fastmcp[tasks]==3.0.0b2"
uv run fastmcp version

uv add "cyclopts>=5.0.0a1"

MCP服务器

# Run the MCP server with the HTTP transport.
uv run fastmcp run server.py:mcp --transport http --port 8000

MCP客户端

使用以下配置,可以连接到MCP客户端。

{
    "mcpServers": {
        "hk-fastmcp": {
            "url": "http://127.0.0.1:8000/mcp"
        }
    }
}