FastMCP
Tool : A precise action the AI can call
A reference Python framework for writing an MCP server, a client or an MCP app in a few lines.
If you need to expose a database, an internal API or a business tool to an agent, FastMCP is the usual starting point in Python. A decorated function becomes a tool that Claude or another client can call. The project, maintained by Prefect, also handles authentication, clients and deployment. It is aimed at developers. The framework does not decide what your server is allowed to do: access controls and input validation remain yours to write.
Security reflects where data goes, requested permissions and incidents on record at the verification date. It is not a guarantee of zero risk: check the deployment mode and the connections you enable.
What it does, concretely
The Model Context Protocol (MCP) connects AI models to tools and data. Writing the whole protocol layer yourself is harder than it looks. FastMCP handles that layer so that you can focus on your own business logic.
In practice, you write an ordinary Python function and decorate it with @mcp.tool. The schema, type validation and documentation are generated automatically from the function. A client connects to a server from a URL, and FastMCP manages transport negotiation, authentication and the protocol lifecycle. A server is started with mcp.run() or with the fastmcp run command.
FastMCP rests on three pillars: servers (tools, resources and prompts exposed to models), clients (connecting to any MCP server, local or remote) and apps (interactive interfaces displayed directly in the conversation). The project is maintained by Prefect, free and open source.
It is aimed at Python developers who want to give an agent access to a database, an internal API or a business tool. It is not suited if you are looking for a ready-to-use tool without writing code. It also does not decide what your server is allowed to do: access controls and input validation remain yours to write.
What it offers
- ·Turns a Python function decorated with @mcp.tool into an MCP tool, with schema, validation and documentation generated automatically.
- ·Exposes tools, resources and prompts to models through MCP-compliant servers.
- ·Provides clients that connect to any MCP server, local or remote, programmatically or from the command line.
- ·Handles transport negotiation, authentication and the protocol lifecycle for you when connecting by URL.
- ·Lets you add interactive interfaces to tools, displayed directly in the conversation (apps).
- ·Starts a server from the command line, for example with fastmcp run server.py --transport http.
- ·Also exists in a TypeScript version (FastMCP for TypeScript), built and maintained by the same team.
- ·Offers documentation in llms.txt format, which you can give to a coding agent as a starting point.
In practice
- Price
- Free
- Commercial use
- Commercial use: yes
- Available on
- cli, api
- FR interface
- No
Security and data
- Rating
- Security: one caveat, see the card
- Your data
- Data stays local
- Maintenance
- Active
- Last release
- 25 November 2026
Links and repository checked on 30 November 2026 · added on 30 November 2026
How to install FastMCP
uv add fastmcp