FastMCP (Python)
Fast, Pythonic framework for building MCP servers and clients for AI tool integration.
3. Used by agents' projects
Dependency in 173 public GitHub projects set up for AI coding agents that we scanned (2.8%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
gofastmcp.com/llms.txtFrom the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What FastMCP (Python) does
The maintainers say FastMCP created the high-level Python API that went into the official MCP Python SDK in 2024. The standalone package is now one framework covering MCP servers, MCP clients, and tools that return interactive UIs.
FastMCP (Python) popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How FastMCP (Python) is used
- FastMCP (Python) is a dependency in 173 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (10.7% of the 1,623 Python ones), #3 of 192 in agent, mcp and tool libraries.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 401; those are left out of every share on this page.
- The most used alternative in our scan is Model Context Protocol SDK (Python) (499 projects).
- Projects that use it most often also use python-dotenv (46.2%), Pydantic (45.7%), Model Context Protocol SDK (Python) (31.2%).
By coding agent
Often used with
FastMCP (Python) in practice
Strengths
You declare a tool as a typed Python function. The README says the schema, validation and documentation are generated from it, so you do not write them by hand.
FastMCP also covers the calling side. Its client connects to an MCP server from a URL. The README says it manages transport negotiation, authentication and protocol lifecycle for you.
Add <code>app=True</code> to a tool and return a Prefab component. The docs say the host then renders it as a chart, table or form inside the conversation.
The site shows a test that passes the server object straight to <code>Client(mcp)</code>, so no separate process is started. The CLI can also run, inspect and install the server.
Watch out for
The versioning policy allows breaking changes in minor releases when they are needed to keep up with the protocol. The docs tell you to pin exact versions in production.
The documentation describes the main branch, so a feature you read about may not be in the version you installed. The docs point to the version badges on each page.
FastMCP 3.3 moved its code into a <code>fastmcp-slim</code> distribution. During a single-command pip upgrade from 3.2 or earlier, pip can install the new files and then delete them. The docs give a <code>pip install --force-reinstall fastmcp</code> fix. They say fresh installs and uv upgrades are unaffected.
A one-tool server
from fastmcp import FastMCP
mcp = FastMCP("Demo ๐")
@mcp.tool
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
if __name__ == "__main__":
mcp.run()More about FastMCP (Python)
Agent Skills for it
- fastmcp: Production patterns for FastMCP Python MCP servers. Use when writing, improving, or debugging FastMCP Python code โ tool schema design, mult
Packages around it
- python-dotenv: Load .env files
- pydantic: Data validation
- mcp: Official MCP Python SDK
- uvicorn: ASGI server
- httpx: HTTP client
- requests: Sync HTTP client
More in Agent, MCP and tool libraries
Alternatives
FastMCP (Python) This page
Model Context Protocol SDK (Python)
Python SDK for building MCP servers and clients to extend AI agent capabilities.
AI agent framework built with Pydantic for structured, typed agent development.
Barebones library for building agents that write Python code to call tools.
Get started
Install it.
pip install fastmcpRules for your agent
## FastMCP
- Install with `uv add fastmcp` (or `pip install fastmcp`). Pin an exact version, because minor releases may contain breaking changes. Use the current release, for example `fastmcp==4.1.8`, rather than a range like `fastmcp>=4.0.0`.
- Register tools by decorating typed functions with `@mcp.tool`. FastMCP derives the schema from the function.
- Keep the `if __name__ == "__main__": mcp.run()` block. Note that `fastmcp run my_server.py:mcp` imports the server object and does not execute that block.
- Use `mcp.run(transport="http", port=8000)` for remote access. Use the default stdio transport for local clients.
- The client is async. Open it with `async with Client(...)`, then call `await client.call_tool(...)` inside the block. For in-memory tests, pass the server object as `Client(mcp)`.
- For `@mcp.tool(app=True)` UI tools, install the `fastmcp[apps]` extra. Preview them locally with `fastmcp dev apps my_server.py`.
- Read the docs through `https://gofastmcp.com/llms.txt`, or append `.md` to a docs URL. The docs follow the main branch, so confirm a feature exists in your pinned version.