by PrefectHQ
Provides a Pythonic framework to quickly build and run Model Context Protocol servers, clients, and interactive applications, handling schema generation, validation, transport negotiation, and authentication automatically.
FastMCP is a full‑stack application framework designed for the Model Context Protocol. It lets developers wrap ordinary Python functions (or TypeScript equivalents) as MCP‑compliant tools, resources, and prompts, exposing them through servers, connecting to them with clients, or creating conversational apps with interactive UI components.
uv:
uv add fastmcp
(or pip install fastmcp).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()
python demo.py).@prefecthq/fastmcp-ts).@prefecthq/fastmcp-ts).Q: Do I need to know the MCP spec to start? A: No. FastMCP abstracts the protocol; you only write normal Python (or TypeScript) functions.
Q: How do I install FastMCP?
A: Prefer the uv package manager (uv add fastmcp). Pip works as well (pip install fastmcp).
Q: Can I run FastMCP in production? A: Yes. For large‑scale deployments use FastMCP Gateway which adds SSO, RBAC, audit logging, and rollout controls.
Q: Is there a TypeScript version?
A: Yes. The official counterpart is @prefecthq/fastmcp-ts and offers identical pillars.
Q: Where can I find documentation and community help?
A: Full docs at https://gofastmcp.com, LLMS‑compatible docs at llms.txt, and a Discord server at https://discord.gg/uu8dJCgttd.
Move fast and make things.
Made with 💙 by Prefect
The Model Context Protocol (MCP) connects LLMs to tools and data. FastMCP is a full MCP application framework for servers, clients, and interactive apps. A server starts with ordinary Python:
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()
Building an effective MCP application is harder than it looks. FastMCP handles all of it. Declare a tool with a Python function, and the schema, validation, and documentation are generated automatically. Connect to a server with a URL, and transport negotiation, authentication, and protocol lifecycle are managed for you. You focus on your logic, and the MCP part just works: with FastMCP, best practices are built in.
That's why FastMCP is the standard framework for working with MCP. FastMCP 1.0 was incorporated into the official MCP Python 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.
FastMCP has three pillars:
Servers wrap your Python functions into MCP-compliant tools, resources, and prompts. Clients connect to any server with full protocol support. And Apps give your tools interactive UIs rendered directly in the conversation.
Building in TypeScript? FastMCP for TypeScript is the official counterpart, built and maintained by the same team. Same pillars, same ideas, npm install @prefecthq/fastmcp-ts.
Ready to build? Start with the installation guide or jump straight to the quickstart.
FastMCP handles the MCP application layer. FastMCP Gateway is the enterprise MCP gateway for scaling servers and tools across teams, with centralized governance over how they are deployed, discovered, secured, and used.
FastMCP and FastMCP Gateway are built by the same team at Prefect.
Deploy FastMCP servers from GitHub with branch previews and instant rollback. Create a private registry of every MCP your company uses. Secure access with SSO and tool-level RBAC. Get audit logs, observability, and governance across your MCP stack. Remix approved tools into purpose-built endpoints for teams and agents.
Start with FastMCP. Scale with FastMCP Gateway →
We recommend adding FastMCP to your project with uv:
uv add fastmcp
For full installation instructions, including verification and upgrading, see the Installation Guide.
Upgrading? We have guides for:
FastMCP's complete documentation is available at gofastmcp.com, including detailed guides, API references, and advanced patterns.
Documentation is also available in llms.txt format, which is a simple markdown standard that LLMs can consume easily:
llms.txt is essentially a sitemap, listing all the pages in the documentation.llms-full.txt contains the entire documentation. Note this may exceed the context window of your LLM.Give your coding agent llms.txt as its starting point. See Coding Agents for version-matched documentation and the optional server authoring skill.
Community: Join our Discord server to connect with other FastMCP developers and share what you're building.
Start with CONTRIBUTING.md for accepted contributions and the issue-assignment workflow, then follow the Contributing Guide for setup and validation. Agents should read AGENTS.md.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by headroomlabs-ai
Compress tool outputs, logs, files, RAG chunks, and conversation history before they reach the LLM, keeping answers identical while saving up to 95% of tokens for JSON payloads.
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.