Skip to content

Full-featured MCP template, supporting FastAPI integration, compatible with Stdio / Streamable HTTP / SSE, and deployable via Docker / K8S. ————全功能 MCP 模板,支持 FastAPI 集成,支持 Stdio / Streamable HTTP / SSE,支持 Docker / K8S 部署

Notifications You must be signed in to change notification settings

Sun-ZhenXing/mcp-template-python

Repository files navigation

MCP FastAPI Application Template

🌏 中文 | English

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:

make

Development:

make 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:

make prod -- --stdio

Deployment

Production:

make prod

Build Python Wheel package:

make build

Docker Deployment

Run:

docker compose up -d

Build only:

docker compose build

About

Full-featured MCP template, supporting FastAPI integration, compatible with Stdio / Streamable HTTP / SSE, and deployable via Docker / K8S. ————全功能 MCP 模板,支持 FastAPI 集成,支持 Stdio / Streamable HTTP / SSE,支持 Docker / K8S 部署

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published