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

agentsfastmcpllmsmcpmcp-clientsmcp-serversmcp-toolsmodel-context-protocolpython
View on GitHub โ†—AlternativesCompatibilityvs mcp-use
Stars
27,090โ˜…
Forks
2,224
Language
Python
License
Apache-2.0
Created
2024-11-30
Last push
2026-08-06