feat: add docker support

This commit is contained in:
Sun-ZhenXing
2025-06-15 12:35:56 +08:00
parent e1b112f401
commit b53f744aa7
10 changed files with 187 additions and 31 deletions

View File

@@ -1,6 +1,52 @@
# MCP FastAPI 应用模板
本项目提供了 FastAPI 集成的 MCP 应用模板。
- [x] 支持多 MCP 挂载
- [x] 支持命令行调用 Stdio 模式
- [x] 支持 SSE / Streamable HTTP 兼容
- [x] 支持打包分发
## 开始
安装依赖:
```bash
uv sync
```
开发:
```bash
uv run dev
```
可通过 <http://127.0.0.1:3001/math/mcp> 访问示例 MCP 接口Streamable HTTP<http://127.0.0.1:3001/math/compatible/sse> 访问 SSE 接口。
## 部署
生产:
```bash
uv run prod
```
构建 Python Wheel 包:
```bash
uv build
```
## Docker 部署
运行:
```bash
docker compose up -d
```
仅构建:
```bash
docker compose build
```