What it does
FastAPI-MCP exposes your FastAPI endpoints directly as MCP tools, allowing Claude and other LLM clients to invoke your API as though it were natively MCP-aware. Rather than treating OpenAPI as a source of truth and converting it, the server integrates directly with your FastAPI application via its ASGI interface. This preserves your endpoint schemas, documentation, and response types exactly as defined. Authentication is built in—you secure MCP tools using the same FastAPI dependency system you already use for HTTP endpoints. The server can be mounted to your existing FastAPI application for a unified deployment, or deployed separately with access to your FastAPI backend.
Who it's for
Backend engineers maintaining production FastAPI services who want to expose those services to Claude without building custom integration logic. Teams building LLM applications that need direct, authenticated access to internal FastAPI endpoints. Developers architecting multi-agent systems where FastAPI handles the business logic and Claude needs to call operations programmatically.
Common use cases
- Expose FastAPI endpoints as MCP tools callable from Claude without middleware or conversion
- Secure Claude's access to internal API operations using FastAPI's
Depends()decorators - Mount an MCP server to an existing FastAPI app with minimal configuration overhead
- Replace HTTP calls between Claude and your API with direct ASGI communication
- Share a single FastAPI deployment between HTTP clients (web, mobile) and Claude/LLM clients
Setup pitfalls
- Requires Python 3.10 or higher (3.12 recommended); verify your environment before installation
- Authentication setup depends on correctly defining FastAPI
Depends()functions; misconfigurations will silently expose endpoints - Mounting to the same app requires understanding FastAPI's startup/shutdown sequence; separate deployments add complexity
- Last commit was over 200 days ago; compatibility with recent FastAPI releases should be verified before production use