fastapi_mcp lets you expose existing FastAPI endpoints as Model Context Protocol (MCP) tools with minimal setup, so AI agents can call your app as first-class tools. Rather than acting as a thin converter, it’s built as a native FastAPI extension that understands dependency injection, so you can reuse Depends() for authentication and authorization across your MCP tools. The server speaks directly to your app over its ASGI interface, avoiding extra HTTP hops between the MCP layer and your API, which reduces latency and simplifies deployment. A tiny bootstrap is enough to stand up an MCP server and, if desired, mount an HTTP transport for remote clients. The docs emphasize a FastAPI-first workflow: keep your schemas, reuse your middleware, and surface endpoints to agents without rewriting controllers. The project is active, with examples and a dedicated site that shows getting started, security, and transport options.

Features

  • Zero-config exposure of FastAPI routes as MCP tools
  • Native FastAPI auth via Depends() and reusable middleware
  • Direct ASGI transport to minimize overhead
  • Optional HTTP transport for remote MCP clients
  • Typed schemas from your FastAPI models surfaced to agents
  • Example app and quickstart for rapid adoption

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow FastAPI-MCP

FastAPI-MCP Web Site

Other Useful Business Software
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of FastAPI-MCP!

Additional Project Details

Programming Language

Python

Related Categories

Python Model Context Protocol (MCP) Servers

Registered

2025-10-08