FastMCP is the standard framework for building MCP applications. The Model Context Protocol (MCP) provides a standardized way to connect LLMs to tools and data, and FastMCP makes it production-ready with clean, Pythonic code:
from fastmcp import FastMCP
mcp = FastMCP("Demo 🚀")
@mcp.tool
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
if __name__ == "__main__":
mcp.run()
FastMCP is made with 💙 by Prefect.
Move Fast and Make Things
The Model Context Protocol (MCP) lets you give agents access to your tools and data. But building an effective MCP server is harder than it looks.
Give your agent too much—hundreds of tools, verbose responses—and it gets overwhelmed. Give it too little and it can’t do its job. The protocol itself is complex, with layers of serialization, validation, and error handling that have nothing to do with your business logic. And the spec keeps evolving; what worked last month might already need updating.
The real challenge isn’t implementing the protocol. It’s delivering the right information at the right time.
That’s the problem FastMCP solves—and why it’s become the standard. FastMCP 1.0 was incorporated into the official MCP SDK in 2024. Today, the actively maintained standalone project is downloaded a million times a day, and some version of FastMCP powers 70% of MCP servers across all languages.
The framework is built on three abstractions that map to the decisions you actually need to make:
- Components are what you expose: tools, resources, and prompts. Wrap a Python function, and FastMCP handles the schema, validation, and docs.
- Providers are where components come from: decorated functions, files on disk, OpenAPI specs, remote servers—your logic can live anywhere.
- Transforms shape what clients see: namespacing, filtering, authorization, versioning. The same server can present differently to different users.
These compose cleanly, so complex patterns don’t require complex code. And because FastMCP is opinionated about the details, like serialization, error handling, and protocol compliance, best practices are the path of least resistance. You focus on your logic; the MCP part just works.
Ready to build? Start with the installation guide or jump straight to the quickstart. When you’re ready to deploy, Prefect Horizon offers free hosting for FastMCP users.
This documentation reflects FastMCP’s main branch, meaning it always reflects the latest development version. Features are generally marked with version badges (e.g. New in version: 3.0.0) to indicate when they were introduced. Note that this may include features that are not yet released.
LLM-Friendly Docs
The FastMCP documentation is available in multiple LLM-friendly formats:
MCP Server
The FastMCP docs are accessible via MCP! The server URL is https://gofastmcp.com/mcp.
In fact, you can use FastMCP to search the FastMCP docs:
import asyncio
from fastmcp import Client
async def main():
async with Client("https://gofastmcp.com/mcp") as client:
result = await client.call_tool(
name="SearchFastMcp",
arguments={"query": "deploy a FastMCP server"}
)
print(result)
asyncio.run(main())
Text Formats
The docs are also available in llms.txt format:
- llms.txt - A sitemap listing all documentation pages
- llms-full.txt - The entire documentation in one file (may exceed context windows)
Any page can be accessed as markdown by appending .md to the URL. For example, this page becomes https://gofastmcp.com/getting-started/welcome.md.
You can also copy any page as markdown by pressing “Cmd+C” (or “Ctrl+C” on Windows) on your keyboard.