# FastMCP (VYAGENT Radar #12)

> The Apache 2.0 Python framework for shipping production MCP servers in 15 lines—complete with Streamable HTTP and OAuth 2.1.

- **URL**: https://vyagent.com/radar/fastmcp
- **Published**: 2026-11-30
- **Category**: MCP SDK · Framework
- **License**: Apache-2.0
- **Pricing**: Free & Open Source (Apache 2.0)
- **Agent Ready**: MCP, REST API, Open Source
- **Source**: https://github.com/PrefectHQ/fastmcp
- **Package / Docs**: https://gofastmcp.com

## 1. Friction Solved
Implementing raw JSON-RPC 2.0 message framing, schema serialization, Streamable HTTP session lifecycles, and OAuth 2.1 token validation from scratch takes hundreds of lines of brittle boilerplate. FastMCP applies the FastAPI ergonomics developers already love: annotate normal Python functions with `@mcp.tool()`, and type hints + docstrings automatically compile into compliant MCP schemas, resources, and authenticated remote endpoints.

## 2. Best-Fit Scenarios
- Wrapping an internal SQL database, Jira/Linear board, or custom enterprise REST API as a secure remote MCP server in under an hour.
- Migrating legacy local stdio MCP scripts to remote Streamable HTTP endpoints protected by OAuth 2.1 (Google, GitHub, or custom OIDC) so non-technical teammates can connect with zero local CLI setup.
- Building automated MCP integration tests using FastMCP’s built-in in-memory `Client` before deploying to Claude, Cursor, or OpenCode.

## 3. Setup (Install with uv & Ship a Streamable HTTP MCP Server)
```
# Install with uv (recommended)
uv add fastmcp

# server.py — minimal production-ready MCP tool
from fastmcp import FastMCP

mcp = FastMCP("Internal Ops Server")

@mcp.tool()
def lookup_order_status(order_id: str) -> dict:
    """Return current fulfillment status and carrier code for an order ID."""
    return {"order_id": order_id, "status": "shipped", "carrier": "UPS"}

if __name__ == "__main__":
    mcp.run(transport="streamable-http", port=8000)
```

## 4. Reality Check & Trade-offs
- Poor docstrings and vague parameter names produce poor agent behavior—LLMs rely strictly on your function signatures and docstrings to decide when and how to call a tool.
- Never expose destructive SQL or shell execution tools without explicit allowlists, OAuth scopes, and read-only defaults.
- If your backend stack is purely TypeScript/Cloudflare Workers with zero Python runtime, use the official TypeScript MCP SDK or stateless edge handlers instead.

## 5. Editorial Verdict
FastMCP did for MCP what FastAPI did for REST APIs: it turns protocol plumbing into 15 lines of typed Python so you can focus on designing safe, high-signal tools.

## 6. FAQ
### Why should new remote MCP servers use Streamable HTTP instead of legacy SSE?
Streamable HTTP replaces the split dual-endpoint SSE design with a single standard HTTP endpoint that works cleanly behind reverse proxies, load balancers, serverless platforms, and OAuth 2.1 middleware.

### Does FastMCP support both local stdio and remote HTTP deployments from the same codebase?
Yes. Your `@mcp.tool()` definitions stay identical—you simply switch `transport="stdio"` for local CLI execution or `transport="streamable-http"` (or `fastmcp run server.py --transport streamable-http`) for hosted remote access.
