PrefectHQ/fastmcp
๐ The fast, Pythonic way to build MCP servers and clients.
27,090 โ
2,224 forksPythonUpdated 21h ago
What you need to know
A full Python MCP application framework (from Prefect) for building servers, clients, and interactive apps - wrap a Python function as an MCP tool and the schema, validation, and documentation are generated automatically; FastMCP 1.0 was incorporated into the official MCP Python SDK.
Install
uv add fastmcp npm install @prefecthq/fastmcp-ts (official TypeScript counterpart)
Usage
- โขCreate a server: mcp = FastMCP("Demo"); decorate functions with @mcp.tool, then mcp.run()
- โขThree pillars: Servers (expose tools, resources, prompts to LLMs), Clients (connect to any MCP server - local or remote, programmatic or CLI), Apps (interactive UIs for tools rendered in the conversation)
- โขUpgrade guides available for FastMCP 3/2, MCP SDK v1/v2, and low-level SDK v1/v2
- โขScale across teams with Prefect Horizon, the enterprise MCP gateway (deployment, discovery, SSO, tool-level RBAC, audit logs)
Key features
- โDeclarative tools/resources/prompts from ordinary Python functions with automatic schema + validation + docs
- โFull client support with transport negotiation, authentication, and protocol lifecycle management
- โApps pillar renders interactive UIs directly in the conversation
- โOfficial TypeScript counterpart maintained by the same team
- โClaimed to power ~70% of MCP servers across languages; downloaded a million times a day
Best for
Python developers building MCP servers, clients, or interactive tool UIs with minimal boilerplate.
Caveats
- โ Framework/library, not a ready-to-run MCP server
- โ Enterprise scaling (governance, SSO, RBAC) is a separate commercial product (Prefect Horizon), not in the open-source repo
Platforms: Cross-platform (Python)Clients: Any (framework for building servers and clients)
Documentation โReviewed 2026-08-07
Topics
- Stars
- 27,090โ
- Forks
- 2,224
- Language
- Python
- License
- Apache-2.0
- Created
- 2024-11-30
- Last push
- 2026-08-06