FastMCP
FastMCP is an open source Python framework for building Model Context Protocol (MCP) servers and clients — you write plain Python functions and it turns them into MCP tools LLMs and AI agents can call, handling schemas, validation, transport, and auth for you.
What is FastMCP?
FastMCP is an open source Python framework for building Model Context Protocol (MCP) servers and clients. You decorate ordinary Python functions and FastMCP exposes them as MCP tools, resources, and prompts — deriving the JSON schema from your type hints and handling validation, transport, and protocol negotiation so an LLM or AI agent can call your code through the standard MCP interface.
What is FastMCP best for?
Python developers who want to give an AI agent access to their functions, data, or APIs without hand-writing MCP protocol plumbing. It suits both quick internal tool servers and production deployments — its high-level API became the foundation for the official MCP Python SDK, and the maintainers say it powers roughly 70% of MCP servers across all languages.
What can FastMCP do?
- Turn plain Python functions into MCP tools with schemas and validation auto-generated from type hints
- Expose resources and prompt templates alongside tools from a single server
- Act as a client to connect to any local or remote MCP server over stdio or HTTP
- Handle authentication, including OAuth flows, and protocol lifecycle for you
- Compose and proxy servers — mount sub-servers or wrap an existing one to reshape it
- Test servers in-process without spinning up a separate transport
- Return interactive UIs (forms, tables, charts) that render inside the conversation
Where does FastMCP fall short?
- It’s Python-only. If your stack is Node or Go you need a different framework — FastMCP’s official companion is a separate TypeScript project, not the same codebase.
- MCP itself is young and moving fast, so the spec and FastMCP’s API still shift between major versions; expect occasional breaking changes when you upgrade.
- FastMCP 1.0 was merged into the official MCP Python SDK, so for a basic server you could use the SDK directly — FastMCP 2.0+ earns its place mainly through the extras (clients, auth, proxying, composition, testing) rather than the core decorators.
Is FastMCP free?
Yes — FastMCP is free and open source under the Apache-2.0 license, with no paid tier for the framework itself. The same team at Prefect offers a hosted service, Prefect Horizon, for deploying and governing MCP servers; it’s free for personal projects, with paid enterprise governance features for larger teams. You never need it to run FastMCP yourself.
FAQ
Is FastMCP open source? Yes. It’s released under the permissive Apache-2.0 license on GitHub (PrefectHQ/fastmcp), free to use, modify, and self-host with no usage restrictions.
How is FastMCP different from the official MCP Python SDK? FastMCP created the high-level API that was folded into the official SDK in 2024. The standalone FastMCP 2.0+ goes further, adding a client, authentication, server composition and proxying, testing helpers, and deployment tooling.
What do I need to run FastMCP? Python 3.10 or newer, installed with pip or uv. A server can run over stdio for a local agent or over HTTP for remote access — no database or extra infrastructure required for a basic server.
Does FastMCP work with Claude and other LLMs? Yes. MCP is a client-agnostic standard, so a FastMCP server works with any MCP-compatible client, including Claude Desktop, Claude Code, and other agents that speak the protocol.