MCPcopy Create free account
hub / github.com/PrefectHQ/fastmcp

github.com/PrefectHQ/fastmcp

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.2.2 ↗ · + Follow · compare 16 versions
18,398 symbols 88,428 edges 1,031 files 8,920 documented · 48% ● updated 44d agov4.0.11 · 2026-10-04★ 27,981304 open issues

Browse by type

⨍ Functions 15,976◇ Types & classes 2,233↳ Endpoints 189
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

FastMCP Logo

FastMCP 🚀

Move fast and make things.

Made with 💙 by Prefect

Docs Discord PyPI - Version TypeScript Tests License

prefecthq%2Ffastmcp | Trendshift


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 Servers Expose tools, resources, and prompts to LLMs. Apps Apps Give your tools interactive UIs rendered directly in the conversation. Clients 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.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.

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.

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 10,390
Function 5,586
Class 2,233
Route 189

Languages

Python100%
TypeScript1%

Modules by API surface

tests/resources/test_resource_template.py193 symbols
tests/server/auth/test_authorization.py189 symbols
tests/server/providers/proxy/test_proxy_server.py160 symbols
tests/cli/test_client_commands.py155 symbols
tests/server/test_dependencies.py145 symbols
tests/cli/test_generate_cli.py131 symbols
tests/server/providers/test_local_provider_resources.py119 symbols
tests/utilities/json_schema_type/test_advanced.py113 symbols
tests/server/test_mrtr_guards.py110 symbols
tests/test_fastmcp_app.py108 symbols
tests/server/providers/test_local_provider.py105 symbols
tests/prompts/test_prompt.py103 symbols

Dependencies from manifests, versioned

dirty-equals0.9.0 · 1×
fastmcp3.4.8 · 1×
httpx0.27.0 · 1×
platformdirs4.0.0 · 1×
pydantic-settings2.0.0 · 1×
pytest9.0.3 · 1×
pytest-asyncio1.2.0 · 1×
websockets15.0.1 · 1×

Datastores touched

dbDatabase · 1 repos
memory_dbDatabase · 1 repos
postgresDatabase · 1 repos

For agents

$ claude mcp add fastmcp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page