FastMCP builds Model Context Protocol servers, clients, and interactive apps from Python functions. It generates schemas, handles transport, and exposes a CLI to run servers.
Overview
FastMCP sits on the Model Context Protocol that links large language models to tools and data. You decorate ordinary Python callables to publish tools, resources, and prompts, while the framework produces JSON schema, validation, and documentation automatically.
Server support covers HTTP and other transports with authentication hooks for providers such as GitHub OAuth. Clients connect to local or remote MCP endpoints with protocol lifecycle handled in library code. Apps can attach interactive UI components such as tables and forms that render inside compatible MCP clients.
Additional capabilities include tool renaming and input shaping, composing multiple servers behind one endpoint, middleware and background tasks, in-memory testing helpers, and skill catalog providers that serve validated Agent Skills to teams. A TypeScript edition mirrors the same pillars for npm-based projects.
Install with uv or pip, run servers through the fastmcp CLI, and extend with provider-specific auth and Prefab UI widgets. Prefect offers a separate FastMCP Gateway product for hosted deployment, registry, and governance, while the open framework remains suitable for self-run servers on your own machines.
Key features
- Decorator-based MCP tools
- Auto-generated JSON schemas
- Python MCP client library
- HTTP transport and CLI runner
- OAuth provider integration
- Interactive in-chat app UIs
- Server composition and middleware
- Agent Skills catalog provider
Use cases
- Exposing internal APIs to LLM agents
- Building team MCP tool servers
- Centralized agent skill distribution
- Authenticated remote MCP endpoints
- Testing MCP handlers in CI