Skip to main content
FastMCP is a full framework for building Model Context Protocol (MCP) applications. It gives you one coherent API for servers, clients, and interactive apps. Use it to expose Python functions as MCP tools, connect to local or remote MCP servers, and return interactive interfaces directly from your tools. FastMCP manages schema generation, validation, transport, authentication, and protocol compatibility around your application code. A FastMCP server starts with ordinary Python:

Move fast and make things

An effective MCP application needs more than a function registry. Models need accurate schemas, callers need validated results, clients need compatible transports, and production servers need authentication and predictable lifecycle management. FastMCP treats those as framework responsibilities. Declare a Python function and FastMCP derives its schema, validates its inputs and outputs, and exposes it through MCP. Connect a client to a URL and FastMCP handles protocol negotiation, authentication, and connection lifecycle. Your application remains ordinary Python while FastMCP keeps the MCP boundary correct. That’s why FastMCP is the standard framework for working with MCP. FastMCP created the high-level Python API incorporated into the official MCP Python SDK in 2024. The actively maintained standalone project is now downloaded more than a million times a day, and some version of FastMCP powers 70% of MCP servers across all languages.

Servers, clients, and apps

FastMCP covers the full MCP application lifecycle through three complementary pillars:
servers-card

Servers

Expose Python functions, data, and instructions as MCP tools, resources, and prompts.
apps-card

Apps

Give MCP tools interactive user interfaces rendered directly in the conversation.
clients-card

Clients

Connect to any MCP server through Python, the command line, or another MCP application.
Servers turn your application logic into MCP capabilities with generated schemas and validation. Clients connect to local or remote MCP servers with full protocol support. Apps let tools return forms, tables, charts, and other interactive interfaces alongside ordinary MCP results. The three pillars share one model: FastMCP owns the protocol machinery while your code defines what the application does. Building in TypeScript? FastMCP for TypeScript is the official counterpart, built and maintained by the same team. Its servers, clients, and apps follow the same concepts, so what you learn here carries over.

Install FastMCP

Add FastMCP to your project with uv add fastmcp, verify the package, and find the right upgrade guide.

Build your first server

Create a tool, run its server, call it from a client, and add an interactive UI.
FastMCP is made with 💙 by Prefect.
This documentation reflects FastMCP’s main branch, so it may describe features that have not reached a stable release. Version badges identify when features were introduced.

Scale MCP with Horizon

FastMCP handles the MCP application layer. Prefect Horizon is the enterprise MCP gateway for scaling servers and tools across teams, with centralized governance over how they are deployed, discovered, secured, and used. Horizon applies the operational patterns developed while maintaining FastMCP: deploy servers from GitHub with branch previews and instant rollback, organize them in a private registry, protect access with SSO and tool-level RBAC, and observe activity through audit logs and telemetry. Horizon can also combine approved tools into purpose-built MCP endpoints for different teams and agents, while keeping access policy and governance centralized. Start with FastMCP. Scale with Horizon →

LLM-friendly docs

FastMCP documentation is designed for developers and coding agents. Every page is available as Markdown, the complete documentation is published in llms.txt formats, and the documentation itself is exposed through an MCP server.

MCP server

Point any MCP-compatible agent at https://gofastmcp.com/mcp to let it search the documentation as it works. You can also connect with FastMCP’s Python client directly:

Markdown formats

The documentation is also available in llms.txt formats:
  • llms.txt lists every documentation page.
  • llms-full.txt contains the complete documentation in one file and may exceed some context windows.
Append .md to any documentation URL to retrieve that page as Markdown. For example, this page is available at https://gofastmcp.com/getting-started/welcome.md. You can also copy the current page as Markdown by pressing Cmd+C or Ctrl+C.