finds.dev← search

// the find

tadata-org/fastapi_mcp

★ 11,915 · Python · MIT · updated Nov 2025

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!

fastapi_mcp turns any FastAPI app into an MCP server by introspecting its OpenAPI schema and exposing each endpoint as an MCP tool. It uses ASGI transport to call your app in-process rather than over HTTP, so there's no second network hop. Aimed at Python devs who already have a FastAPI service and want AI assistants to call it without rewriting anything.

Uses FastAPI's own Depends() for auth, so you get OAuth2/JWT/API key gating with code you already wrote — no parallel auth system to maintain. ASGI transport is the right call: skips serialization overhead and means the MCP server can't drift out of sync with the app it wraps. OpenAPI-to-MCP conversion preserves docstrings and Pydantic schemas, so tools arrive in the LLM context with real type info. Test coverage is solid — separate fixture apps, real transport tests, schema conversion tests — not just happy-path smoke tests.

Last push was November 2025 and MCP is moving fast; the spec has had breaking changes and there's real risk this falls behind without active maintenance. The 'FastAPI-first' claim is partly marketing: it still converts OpenAPI JSON under the hood, which means endpoints with complex response unions or custom encoders may generate confusing or wrong tool schemas. No streaming support — long-running endpoints that return `StreamingResponse` don't map cleanly to MCP tool calls, and the docs don't address this. Separate deployment (non-ASGI mode) falls back to HTTP calls, which quietly removes the main architectural advantage with no warning in the UI.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →