Welcome to FastMCP 2.0!
The fast, Pythonic way to build MCP servers and clients.
The Model Context Protocol (MCP) is a new, standardized way to provide context and tools to your LLMs, and FastMCP makes building MCP servers and clients simple and intuitive. Create tools, expose resources, define prompts, and more with clean, Pythonic code:
Beyond the Protocol
FastMCP is the standard framework for working with the Model Context Protocol. FastMCP 1.0 was incorporated into the official low-level Python SDK, and FastMCP 2.0 (this project) provides a complete toolkit for working with the MCP ecosystem.
FastMCP has a comprehensive set of features that go far beyond the core MCP specification, all in service of providing the simplest path to production. These include client support, server composition, auth, automatic generation from OpenAPI specs, remote server proxying, built-in testing tools, integrations, and more.
Ready to upgrade or get started? Follow the installation instructions, which include specific steps for upgrading from the official MCP SDK.
What is MCP?
The Model Context Protocol lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. It is often described as βthe USB-C port for AIβ, providing a uniform way to connect LLMs to resources they can use. It may be easier to think of it as an API, but specifically designed for LLM interactions. MCP servers can:
- Expose data through
Resources
(think of these sort of like GET endpoints; they are used to load information into the LLMβs context) - Provide functionality through
Tools
(sort of like POST endpoints; they are used to execute code or otherwise produce a side effect) - Define interaction patterns through
Prompts
(reusable templates for LLM interactions) - And more!
FastMCP provides a high-level, Pythonic interface for building, managing, and interacting with these servers.
Why FastMCP?
The MCP protocol is powerful but implementing it involves a lot of boilerplate - server setup, protocol handlers, content types, error management. FastMCP handles all the complex protocol details and server management, so you can focus on building great tools. Itβs designed to be high-level and Pythonic; in most cases, decorating a function is all you need.
FastMCP 2.0 has evolved into a comprehensive platform that goes far beyond basic protocol implementation. While 1.0 provided server-building capabilities (and is now part of the official MCP SDK), 2.0 offers a complete ecosystem including client libraries, authentication systems, deployment tools, integrations with major AI platforms, testing frameworks, and production-ready infrastructure patterns.
FastMCP aims to be:
π Fast: High-level interface means less code and faster development
π Simple: Build MCP servers with minimal boilerplate
π Pythonic: Feels natural to Python developers
π Complete: A comprehensive platform for all MCP use cases, from dev to prod
llms.txt
This documentation is also available in llms.txt format, which is a simple markdown standard that LLMs can consume easily.
There are two ways to access the LLM-friendly documentation:
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.