KEEP IT HANDS-ON functional ✓ tested 2026-07-01
// sandboxed in macOS (host) · aarch64 ·install log ·functional log

FastMCP

by Jeremiah Lowin / PrefectHQ · https://github.com/PrefectHQ/fastmcp · Apache-2.0 · v3.4.2 · updated 2026-06-29

The FastAPI of MCP. Decorate a function, get a fully schema-validated tool. Five thousand tests back it up.

5 / 5
quality 5/5
documentation 5/5
setup 5/5
value 5/5
ecosystem fit 5/5
// bottom line

FastMCP is the Python framework the MCP ecosystem standardized on. Its FastMCP 1.0 was merged into the official MCP Python SDK, and the standalone project now ships 5,617 tests, an in-process client that eliminates network setup, and a 12-command CLI that works on the first try. The 25-package dependency footprint and the unverified "70 percent of all MCP servers" claim are the only real dents. For anyone building MCP servers in Python, this is the default choice.

install via pip
$pip install fastmcp
install via uv
$uv pip install fastmcp
install with extras (OpenAI, Anthropic, Gemini)
$pip install "fastmcp[openai,anthropic,gemini]"

install if

  • Python developers building MCP servers. This is the default framework. The decorator API, automatic schema generation, and in-process client eliminate the boilerplate that makes raw MCP SDK code verbose.
  • Teams integrating tools into Claude Desktop, Cursor, or other MCP clients. The fastmcp discover command finds all configured servers, and the fastmcp install command registers servers in editor configs.
  • Test-driven MCP developers. The in-process client turns MCP testing into standard pytest async tests with no subprocess management. The testing demo in the examples directory shows the pattern with fixtures, parametrized tests, and dirty-equals assertions.
  • Anyone who needs an MCP CLI. The fastmcp list and fastmcp call commands work against any MCP server (local Python file, remote HTTP URL, stdio command, or editor-configured name), making it a general-purpose MCP Swiss army knife.

What It Does

FastMCP is a Python framework for building Model Context Protocol servers and clients. You decorate a function with @mcp.tool and FastMCP generates the JSON schema, input validation, and output formatting automatically, the same way FastAPI turns function signatures into HTTP endpoints. The framework supports three component types: tools (callable functions), resources (static or templated data URIs), and prompts (parameterized message templates). It also ships a client SDK that connects to any MCP server in-process or over HTTP/SSE/stdio, a 12-command CLI (fastmcp list, fastmcp call, fastmcp inspect, fastmcp run, fastmcp discover, and seven more), and a bundled agent skill (skills/fastmcp-client-cli/SKILL.md) that teaches coding agents how to use the CLI. The audience is Python developers building MCP servers for LLM agents, teams integrating tools into Claude Desktop or Cursor, and anyone who needs a typed, tested alternative to writing raw JSON-RPC handlers.

The Good

5,617 test functions across 327 test files. This is the most thoroughly tested MCP tool GearScope has reviewed. The suite covers tools (argument validation, output schemas, content types, timeout handling, thread execution, future annotations), resources (templates, static, internal types), prompts, OpenAPI integration (circular references, discriminators, transitive references, nullable fields), JSON schema types (unions, containers, constraints, real-world schemas), CLI commands, auth, logging, and version checking. For comparison, the github-mcp-server review cited roughly 1,000 test files but fewer total test functions. The test-to-code ratio here is exceptional.

The in-process client eliminates the entire network setup tax. Most MCP testing guides tell you to start a server, configure a transport, and connect a client over stdio or HTTP. FastMCP lets you pass the server object directly to the client: async with Client(mcp) as client: tools = await client.list_tools(). I verified this works with sync tools, async tools, resources, resource templates, and prompts, all without starting a process or opening a socket. This is the single biggest developer-experience win in the framework.

Automatic schema generation from Python type hints, verified against actual output. A function annotated def add(a: int, b: int) -> int produces a JSON schema with additionalProperties: False, properties: {a: {type: integer}, b: {type: integer}}, required: [a, b], and an output schema with x-fastmcp-wrap-result: true. The --json CLI flag exposes both the input and output schemas. Type coercion is automatic: a=3.14 b=2.0 on the CLI correctly became floats and returned 6.28. There is no manual schema authoring needed.

The CLI is thorough and works on the first try. fastmcp list server.py shows all tools with signatures and descriptions. fastmcp call server.py add a=5 b=3 returns {"result": 8}. fastmcp inspect server.py produces a clean summary (server name, version, component counts, protocol version). fastmcp list server.py --resources --prompts --json dumps the complete server surface as structured JSON. fastmcp discover scans Claude Desktop, Claude Code, Cursor, Gemini CLI, Goose, and project-level mcp.json configs to find configured servers. Calling a nonexistent tool returns Error: Tool nonexistent_tool not found. with exit code 1. All of this worked without reading any documentation first.

Official adoption and proven scale. FastMCP 1.0 was incorporated into the official MCP Python SDK in 2024. The standalone project now reports 3,252,924 daily PyPI downloads (93 million per month) and 25,894 GitHub stars. The latest release is v3.4.2 (tagged 2026-06-06), and the repo was pushed two days before this review. The project ships llms.txt and llms-full.txt for agent consumption, has a Mintlify-hosted docs site at gofastmcp.com, includes a dedicated testing demo with pytest fixtures and dirty-equals assertions, and bundles a SKILL.md agent skill for CLI usage.

The Bad

The base install pulls in 25 transitive dependencies. A clean pip install fastmcp downloads authlib, beartype, cachetools, caio, cyclopts, dnspython, email-validator, exceptiongroup, griffelib, jaraco (three packages), joserfc, jsonref, jsonschema-path, keyring, more-itertools, openapi-pydantic, pathable, platformdirs, py-key-value-aio, pyperclip, rich-rst, and uncalled-for. The fastmcp-slim variant exists for minimal installs, but the default fastmcp package is a meta-package that depends on fastmcp-slim, adding an indirection layer that makes the dependency tree harder to read. Developers who care about supply-chain surface area will want to audit this list.

The "70 percent of MCP servers across all languages" claim has no cited source. The README states that "some version of FastMCP powers 70 percent of MCP servers across all languages." This may well be true given the download numbers (3.25 million per day is enormous), but the claim appears without methodology, measurement window, or link to supporting data. A framework this dominant should be able to cite its measurement basis. Readers evaluating ecosystem fit should treat the number as plausible but unverified.

The internal workspace structure is confusing for contributors. The repository uses a uv workspace with fastmcp_slim/ (the actual library code), fastmcp_remote/ (remote execution support), and the root fastmcp meta-package. The AGENTS.md describes the structure but refers to the project as "actively maintained v2.0" when the actual version is 3.4.2. A contributor cloning the repo for the first time needs to understand three packages, a dynamic versioning system (uv-dynamic-versioning), and a bypass-selection hatch target before they can navigate the codebase. None of this affects users who pip install fastmcp, but it raises the barrier to contribution.

The Prefect Horizon commercial upsell is prominent in the README. Six lines of the 123-line README pitch the enterprise MCP gateway product (SSO, RBAC, audit logs, observability, private registry). This is a legitimate open-source business model, but the placement (directly after the three-pillar feature overview, before installation) means readers hit the sales pitch before they see how to install the tool. The framework itself is fully open source under Apache-2.0 with no feature gating, so the upsell is editorial, not technical.

Smoke Test Results

Tested on macOS host (aarch64), Python 3.12.13, pip 26.1.1. FastMCP 3.4.2 installed from PyPI into an existing virtualenv.

Run A. Fresh install, no deps preinstalled

$ pip install fastmcp

PASS (3.4.2 installed, 25 packages pulled)

$ python3 -c "import fastmcp; print(fastmcp.__version__)"

PASS (3.4.2)

$ fastmcp --version

PASS (3.4.2)

$ fastmcp --help

PASS (12 subcommands: auth, call, dev, discover, generate-cli, inspect, install, list, project, run, tasks, version)

Pass rate: 4 of 4. Clean install with zero configuration steps.

Run B. Sandbox with deps preinstalled

$ python3 /tmp/fmcp-smoke/01_import.py (create server, register tools)

PASS (FastMCP("GearScope Test"), @mcp.tool decorator works)

$ fastmcp list server.py

PASS (3 tools listed: add, greet, multiply with signatures)

$ fastmcp call server.py add a=5 b=3

PASS ({"result": 8})

$ fastmcp call server.py greet name=GearScope --json

PASS (structured content: "Hello, GearScope!")

$ fastmcp call server.py multiply a=3.14 b=2.0 --json

PASS (structured content: 6.28, float coercion verified)

$ fastmcp list server.py --resources --prompts --json

PASS (3 tools, 1 resource, 1 prompt with full schemas)

$ fastmcp inspect server.py

PASS (Server CLITest, v3.4.2, 3 tools, 1 prompt, 1 resource, MCP 1.26.0)

Pass rate: 7 of 7. The badge number is 7 of 7. Every CLI command produced correct output on the first attempt without consulting documentation.

Run C. Functional verification (does it do what it claims?)

$ python3 /tmp/fmcp-smoke/02_functional_fixed.py (in-process client)

Tools found: 3 (add, greet, slow_add with correct schemas)

PASS

$ client.call_tool("add", {"a": 5, "b": 3}) -> "8"

PASS

$ client.call_tool("greet", {"name": "World"}) -> "Hello, World!"

PASS

$ client.call_tool("slow_add", {"a": 10, "b": 20}) -> "30"

PASS (async tool executes correctly)

$ client.read_resource("config://app") -> '{"version": "1.0", "debug": false}'

PASS

$ client.get_prompt("code_review", {"language": "Python"}) -> "Review this Python code for bugs."

PASS

$ fastmcp call server.py nonexistent_tool

PASS (clean error: "Tool nonexistent_tool not found.", exit 1)

Functional pass rate: 7 of 7. All tool, resource, prompt, and error-handling paths verified with assertions on actual return values.

What the runs tell you

FastMCP installs in one command, builds a working MCP server with three decorators, and the in-process client tests all three component types (tools, resources, prompts) without starting a process or opening a socket. The CLI is self-documenting: every subcommand I tried produced correct, schema-validated output on the first attempt. The only issue encountered was my own code using a stale attribute name (.content instead of .text on resource contents), which was a version difference, not a framework bug. All 16 tests across three runs passed.

Setup Walkthrough

  1. Install: pip install fastmcp. This pulls 25 packages and takes about 10 seconds. The installed version is 3.4.2.
  2. Build a server. Create a Python file with from fastmcp import FastMCP, instantiate mcp = FastMCP("MyServer"), and decorate functions with @mcp.tool, @mcp.resource, or @mcp.prompt. Type hints on the function signature become the JSON schema automatically.
  3. Run it: fastmcp run server.py starts the server with stdio transport. For HTTP transport, use mcp.run(transport="http", port=8000) in the file.
  4. Test it without a client: fastmcp list server.py shows all tools. fastmcp call server.py tool_name arg=value invokes any tool from the command line with automatic type coercion.
  5. Write integration tests using the in-process client: from fastmcp import Client, then async with Client(mcp) as client: result = await client.call_tool("add", {"a": 1, "b": 2}). No network, no subprocess, no fixtures beyond the server object.

Gotcha: the fastmcp PyPI package is a meta-package depending on fastmcp-slim. If you need a minimal dependency footprint, install fastmcp-slim directly and add extras ([client], [server]) as needed. The full fastmcp package includes both client and server by default.

Alternatives

  1. Official MCP Python SDK (github.com/modelcontextprotocol/python-sdk) - the low-level SDK that FastMCP builds on top of. FastMCP 1.0 was merged into this SDK. Use the SDK directly if you need maximum control or minimal dependencies, use FastMCP for ergonomics and testing.
  2. PrefectHQ/fastmcp slim variant - the same framework with fewer default dependencies. Install fastmcp-slim and add only the extras you need ([client], [server], [openai], [anthropic]). Same code, smaller footprint.
  3. Raw JSON-RPC - the MCP protocol is documented and straightforward for simple servers. If you have one tool and no auth, a few dozen lines of JSON-RPC handling may be simpler than pulling in a framework. FastMCP's value compounds as tool count and complexity grow.
// review provenance
reviewed by
GearScope
tested
2026-07-01 · macOS (Apple Silicon)
last verified
2026-07-01
depth
HANDS-ON
sponsorship
none, ever
// share this review
// feedback
was this review helpful?

Want the next one?

Five honest reviews and a verdict you can trust. Every Friday. No spam, no affiliate links.