FastMCP: Python framework for MCP servers and clients
Build Model Context Protocol servers with decorators.
Learn more about FastMCP
FastMCP is a Python framework that simplifies development of Model Context Protocol applications. It uses Python decorators to expose functions as MCP tools and provides built-in support for resources, prompts, and context management. The framework includes authentication integrations, deployment utilities, and client libraries for connecting to MCP servers. Common use cases include building AI agent backends, integrating data sources with LLM applications, and creating composable tool ecosystems.
Decorator-Based Tool Definition
Python decorators expose functions as MCP tools and resources without manual protocol implementation. Reduces boilerplate while maintaining compatibility with the standard Python SDK.
Enterprise Authentication Integrations
Pre-built support for Google, GitHub, WorkOS, Azure, and Auth0 authentication providers. Eliminates custom OAuth implementation for production deployments requiring user authentication.
Server Composition and Proxying
Combine multiple MCP servers, proxy requests between instances, and generate OpenAPI/FastAPI interfaces from MCP definitions. Enables modular architectures and integration with existing web frameworks.
from fastmcp import FastMCP
mcp = FastMCP("My AI Agent")
@mcp.tool()
def calculate_sum(a: int, b: int) -> int:
"""Add two numbers together."""
return a + b
if __name__ == "__main__":
mcp.run()Beta release with MCP Apps Phase 1 SDK compatibility and new CLI commands.
- –Add MCP Apps Phase 1 — SDK compatibility
- –Add fastmcp list and fastmcp call CLI commands
- –Add fastmcp generate-cli command
- –Add CIMD (Client ID Metadata Document) support for OAuth
- –Make duplicate bot less aggressive
Fixed memory leak in memory:// docket broker where cancelled tasks were accumulating.
- –Bump pydocket to 0.17.2 (memory leak fix)
Fixed fresh install bug and backported tool schema compatibility fixes.
- –Dereference $ref in tool schemas for MCP client compatibility
- –Fix task capabilities location
- –Add missing packaging dependency
See how people are using FastMCP
Related Repositories
Discover similar tools and frameworks used by developers
StabilityMatrix
Multi-backend inference UI manager with embedded dependencies.
Codex CLI
OpenAI's command-line coding assistant that runs locally with ChatGPT integration for terminal use.
DeepFace
Python library wrapping multiple face recognition deep learning models.
YOLOv7
PyTorch single-stage detector with bag-of-freebies training optimizations.
Megatron-LM
Library for training large transformer models with distributed computing and GPU-optimized building blocks.