mirror of
https://github.com/Sun-ZhenXing/mcp-template-python.git
synced 2026-02-04 02:03:32 +00:00
790 B
790 B
MCP FastAPI 应用模板
本项目提供了 FastAPI 集成的 MCP 应用模板。
- 支持多 MCP 挂载
- 支持命令行调用 Stdio 模式
- 支持 SSE / StreamableHTTP
- 支持打包分发
开始
安装依赖:
make
开发:
make dev
可通过 http://127.0.0.1:3001/math/mcp 访问示例 MCP 接口(Streamable HTTP),或 http://127.0.0.1:3001/math/compatible/sse 访问 SSE 接口。
通过 --stdio 来调用命令行:
make prod -- --stdio
部署
生产:
make prod
构建 Python Wheel 包:
make build
Docker 部署
运行:
docker compose up -d
仅构建:
docker compose build