2025-07-21 11:36:58 +08:00
2025-07-19 22:50:04 +08:00
2025-07-14 15:14:38 +08:00
2025-07-19 22:50:04 +08:00
2025-07-19 22:50:04 +08:00
2025-06-15 12:35:56 +08:00
2025-06-11 11:21:12 +08:00
2025-07-19 22:50:04 +08:00
2025-07-14 15:14:38 +08:00
2025-07-21 11:36:58 +08:00
2025-07-21 00:09:53 +08:00
2025-07-21 00:09:53 +08:00
2025-07-21 11:36:58 +08:00

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 / WebSocket
  • Support for packaging and distribution

Starting from v0.1.2, we use BetterFastMCP to replace FastMCP, providing more comprehensive features than the official FastMCP:

  • Support for Pydantic models as input parameters, enabling more complex input parameter types and convenient description addition
  • Support for WebSocket as transport layer, access by /{mcp_name}/websocket/ws

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
全功能 MCP 模板,支持 FastAPI 集成,支持 Stdio / Streamable HTTP / SSE,支持 Docker 部署
Readme 595 KiB
Languages
Python 75%
Dockerfile 9.6%
Smarty 9.1%
Makefile 6.3%