Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d ยท Codex 0d For AI agents: Markdown Updated Nov 26, 2026

FastMCP (Python)

Fast, Pythonic framework for building MCP servers and clients for AI tool integration.

Agent, MCP and tool librariesPYPI

GitHubWebsite

1. License

License from PyPI license expression.

github.com/PrefectHQ/fastmcp

From 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

75 / 100
Gid Score, #197 overall
20.6M
downloads a week, pypi
28.7K
GitHub stars
173
agent projects use it
FastMCP (Python): downloads per weekPyPI, fastmcp 19,405,555
FastMCP (Python): GitHub starsPrefectHQ/fastmcp 28,722

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

114 projects, 3.8%
68 projects, 2.1%
41 projects, 1.7%
8 projects, 1.7%
6 projects, 1.7%
5 projects, 1.1%

Often used with

In 46.2% of its projects
In 45.7% of its projects
In 31.2% of its projects
In 29.5% of its projects
In 30.1% of its projects
In 28.3% of its projects
In 28.3% of its projects
In 22.0% of its projects

FastMCP (Python) in practice

Strengths

Schemas come from the function signature

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.

A client in the same package

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.

Tools can return UIs instead of text

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.

In-memory testing

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

Minor versions can break things

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.

Docs track main, not the release

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.

pip upgrades across 3.3 can half-remove the package

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

See all

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

Apache-2.0Gid 7520.6M/wk

Model Context Protocol SDK (Python)

Python SDK for building MCP servers and clients to extend AI agent capabilities.

MITGid 8382M/wk

Pydantic AI

AI agent framework built with Pydantic for structured, typed agent development.

MITGid 641.8M/wk

smolagents

Barebones library for building agents that write Python code to call tools.

Gid 50158K/wk

Compare FastMCP (Python) with another tool

Get started

Install it.

pip install fastmcp

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## 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.