香港快速医疗中心
构建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 8000MCP客户端
使用以下配置,可以连接到MCP客户端。
{
"mcpServers": {
"hk-fastmcp": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}