FastMCP
The Python framework for building MCP servers. Decorator-driven, Pydantic-powered, with built-in composition, proxying, and OpenAPI import.
Why FastMCP
MCP servers need tools, resources, and prompts exposed over a transport (stdio, HTTP, streamable HTTP). The raw MCP SDK requires manual schema definition and protocol plumbing. FastMCP wraps all of that behind Python decorators and type hints - you write normal functions, it generates the schemas and handles the protocol.
FastMCP v1 was incorporated into the official mcp SDK as mcp.server.fastmcp. The standalone fastmcp package (v2+) diverged significantly with composition, proxying, OpenAPI import, auth, a client SDK, and more. The standalone package is the one to use going forward.
MCP itself was donated to the Agentic AI Foundation (AAIF), a Linux Foundation directed fund, in December 2025 - co-founded by Anthropic, Block, and OpenAI. The spec is now vendor-neutral with an open governance process.
Key facts:
- Repo:
prefecthq/fastmcp(gofastmcp.com) - Python: >=3.10
- Core dep:
mcp>=1.24.0,<2.0(builds on the official SDK) - Install:
pip install fastmcporuv add fastmcp - 1M+ downloads/day, powers ~70% of MCP servers across all languages
Relationship to Your Existing MCP Servers
Your current servers (largefile, diffchunk, md-server) use from mcp.server.fastmcp import FastMCP - this is FastMCP v1 bundled in the mcp SDK. Migration to standalone fastmcp is straightforward (change the import) and unlocks:
| Feature | mcp SDK (v1) | standalone fastmcp (v2+) |
|---|---|---|
| Tool/resource decorators | Yes | Yes |
| Composition/mounting | No | Yes |
| Proxy remote servers | No | Yes |
| OpenAPI import | No | Yes |
| Auth (OAuth, JWT) | No | Yes |
| Client SDK | Separate | Built-in |
| Custom HTTP routes | No | Yes |
| Task support (long-running) | No | Yes |
| Output schemas | No | Yes |
Contents
- Concepts - Core abstractions
- Architecture - Server class, providers, transports, lifecycle
- Transports - stdio, SSE, streamable HTTP - when to use each
- Tools, Resources, Prompts - The three MCP primitives and how FastMCP wraps them
- Composition - Mounting, proxying, aggregation
- Quickstart - Get building
- First Server - Tool + resource + prompt in 30 lines
- Testing - Test servers with the built-in client
- Deploying - stdio, HTTP, SSE, and integration with Claude Desktop
- Deep Dives - Advanced patterns
- OpenAPI Import - Generate MCP servers from OpenAPI specs or FastAPI apps
- Auth - OAuth, JWT, scoped tools
- Client SDK - Programmatic MCP client for testing and orchestration
- MCP in 2026 - Spec evolution, governance, enterprise features
- Notes - Integration notes
- MyLocalGPT Integration - How FastMCP fits into the MyLocalGPT MCP ecosystem