SDK / infra Β· #72 trending MCP repo Β· β +86 stars this week
FastMCP
PrefectHQ/fastmcp
π The fast, Pythonic way to build MCP servers and clients.
- Stars
- 28k
- This week
- +86
- Forks
- 2.6k
- Open issues
- 460
- Skills inside
- 13
Inside this repo
13 skills
.agents/skills/adversarial-reviewdocsWrite or revise a page under docs/ for gofastmcp.com. Use when adding a feature's documentation, fixing a docs issue, reworking a page, or auditing pages for accessibility and consistency. Covers the page shape, the voice, the checks that run in CI, and how a merged page reaches the live site..agents/skills/docsfix-issueCarry a selected FastMCP bug from reproduction through a scoped fix, compatibility review, validation, and a monitored pull request..agents/skills/fix-issuepython-testsWrite regression tests for FastMCP changes using its pytest fixtures, in-memory clients, and protocol boundaries..agents/skills/python-testsreleaseCut a FastMCP release end to end. Use when the maintainer says "cut a release", "prep a patch", "ship 4.x.y", or asks what a release would contain. Covers the notes preview, the title pun, the docs changelog PR that must land before the tag, the tag itself, the publish fan-out, and verifying gofastm.agents/skills/releasereview-issueReview an incoming external issue (and any gated-closed PR behind it) and decide whether to assign the contributor or decline. Use when the maintainer says "look at this issue", "review issue #N", "should we take this", or asks whether to assign someone. Assigning the author auto-reopens their PR fo.agents/skills/review-issuereview-prAssess a FastMCP pull request for justified behavior, compatibility, and correctness, then follow CI and review feedback to a revision-specific verdict. Use for draft or ready PRs and self-review before publication..agents/skills/review-prreview-security-reportReview FastMCP vulnerability reports before accepting, rejecting, patching, scoring, or publishing them. Use for security advisories, bug-bounty submissions, OAuth or MCP vulnerability claims, and proposed security fixes..agents/skills/review-security-reporttriageFind worthwhile FastMCP issues to work on in a backlog or release window, verify promising candidates, and present concrete picks with existing PR links..agents/skills/triagefastmcp-client-cliQuery and invoke tools on MCP servers using fastmcp list and fastmcp call. Use when you need to discover what tools a server offers, call tools, or integrate MCP servers into workflows.docs/.mintlify/skills/fastmcp-client-clifastmcp-serverBuild, extend, or review MCP servers with Python FastMCP, using documentation matched to the project's version.docs/.mintlify/skills/fastmcp-serverfastmcp-client-cliQuery and invoke tools on MCP servers using fastmcp list and fastmcp call. Use when you need to discover what tools a server offers, call tools, or integrate MCP servers into workflows.skills/fastmcp-client-clifastmcp-serverBuild, extend, or review MCP servers with Python FastMCP, using documentation matched to the project's version.skills/fastmcp-serverDocumentation
README
FastMCP π
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()
Why FastMCP
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 Expose tools, resources, and prompts to LLMs. |
Apps Give your tools interactive UIs rendered directly in the conversation. |
Clients Connect to any MCP server β local or remote, programmatic or CLI. |
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.
Scale MCP with FastMCP Gateway
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 β
Installation
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:
- Upgrading from FastMCP 3
- Upgrading from FastMCP 2
- Upgrading from MCP SDK v1 or v2
- Upgrading from the low-level SDK v1 or v2
π Documentation
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.txtis essentially a sitemap, listing all the pages in the documentation.llms-full.txtcontains 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.
Contributing
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.
Releases