Lightweight FastAPI integration for Model Context Protocol (MCP)
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"fastapi-mcp-router","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# fastapi-mcp-router [](https://github.com/rcrsr/fastapi-mcp-router/actions/workflows/ci.yml) [](https://pypi.org/project/fastapi-mcp-router/) [](https://pypi.org/project/fastapi-mcp-router/) [](https://github.com/rcrsr/fastapi-mcp-router/blob/main/LICENSE) Add MCP to your existing FastAPI app. Register tools, resources, and prompts with decorators. Use `Depends()`, `Request`, and `BackgroundTasks` the same way you already do. ## Why fastapi-mcp-router - **It's just an `APIRouter`.** Mount it like any other router. No separate framework, no new server process. - **Your DI still works.** `Depends()`, `Request`, `BackgroundTasks` — same patterns, same middleware. - **2 dependencies.** FastAPI and Pydantic. Nothing else. - **No lock-in.** Tools are regular async functions. Call them from tests, CLI scripts, or other endpoints without MCP. - **Lambda-ready.** Stateless mode + Mangum. No adapter layer. **Use FastMCP instead** if you need STDIO transport, OpenAPI spec imports, or managed hosting. ## Install ```bash pip install fastapi-mcp-router ``` ## Quick Start ```python from fastapi import FastAPI from fastapi_mcp_router import MCPRouter app = FastAPI() mcp = MCPRouter() @mcp.tool() async def write_message(payload: str) -> dict: """Write coordination message.""" return {"success": True, "message_id": "msg-123"} @mcp.resource("project://{project_id}/config") async def project_config(project_id: str) -> dict: return {"project_id": project_id, "env": "production"} @mcp.prompt() async def review_code(file_path: str, language: str = "python") -> list[dict]: return [{"role": "user", "content": f"Review {file_path} ({language})"}] app.include_router(mcp, prefix="…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.