ClaudeMap

FastMCP

Pythonic framework for building MCP servers — decorators, type hints, and zero boilerplate.

SDKs & Toolingframeworkpythonmcptype-driven

FastMCP is the most popular Python framework for building MCP servers. Define tools, resources, and prompts as decorated Python functions; the framework handles JSON-RPC, schema generation, and transport wiring. Now maintained under the Prefect org.

What it does

  • Decorator-driven API: @mcp.tool / @mcp.resource / @mcp.prompt — your Python function becomes a server primitive
  • Type-hint schemas: JSON Schema auto-generated from Python type annotations, including Pydantic models
  • Transports: stdio for local clients (Claude Code, Inspector), HTTP / Streamable HTTP for remote
  • Built-in helpers: image / audio / PDF content, sampling, elicitation, structured prompts
  • Server composition: mount / import one FastMCP server inside another; auth providers (Google, GitHub, Azure)

When to use it

Best for shipping an MCP server in an afternoon — wrap an existing internal API as MCP, expose a database as queryable resources, or build the custom tool side of an Agent SDK project. The de-facto Python choice; pair with uv for fast setup.

Getting started

uv add fastmcp

Then:

from fastmcp import FastMCP
mcp = FastMCP("my-server")
@mcp.tool
def add(a: int, b: int) -> int: return a + b
mcp.run()

Run via python -m my_server for stdio, or pass transport="http" for the Streamable HTTP server.

Things to know

FastMCP has its own major-version cadence (currently v2.x) — pin it in production. The async-first API works best with uvicorn-style event loops; sync tool functions are supported but the framework encourages async def.

Repository

PrefectHQ/fastmcp

Charted

Related on the map

  • E2B

    SDK / Tool

    Open-source secure sandboxes where AI agents run code — the de facto execution layer for agent apps.

    • sandbox
    • code-execution
    • sdk
    • agents
  • Anthropic's official TypeScript SDK for building agentic applications.

    • official
    • sdk
    • typescript
    • anthropic