mirror of
https://github.com/Sun-ZhenXing/mcp-template-python.git
synced 2026-02-04 02:03:32 +00:00
72388cbbf67cee81c7655829afe5c1a1555f1d2e
MCP FastAPI Application Template
This project provides an MCP application template integrated with FastAPI.
- Support for multiple MCP mounting
- Support for command-line invocation in Stdio mode
- Support for SSE / StreamableHTTP
- Support for packaging and distribution
Getting Started
Install dependencies:
uv sync
Development:
uv run dev
You can access the example MCP interface (Streamable HTTP) via http://127.0.0.1:3001/math/mcp, or access the SSE interface via http://127.0.0.1:3001/math/compatible/sse.
Call via command line with --stdio:
uv run prod --stdio
Deployment
Production:
uv run --no-sync prod
Build Python Wheel package:
uv build
Docker Deployment
Run:
docker compose up -d
Build only:
docker compose build
Description
Languages
Python
75%
Dockerfile
9.6%
Smarty
9.1%
Makefile
6.3%