Convert any FastAPI, Flask, or Django application into a fully functional MCP (Model Context Protocol) server. Zero boilerplate. Pure magic.
Everything you need to expose your Python API as MCP tools
Two lines of code. No migrations, no code generation, no configuration files. Your API is an MCP server.
One interface, three frameworks. FastAPI, Flask, and Django all work the same way.
Automatically extracts types, parameters, and schemas from your route handlers and Pydantic models.
No HTTP overhead. Tools call your handlers directly, preserving all authentication and business logic.
Use the @mcp_tool decorator to customize names, descriptions, or hide routes entirely.
Clean adapter pattern makes it easy to add support for new frameworks or customize behavior.
Install, import, and run. That's it.
from fastapi import FastAPI from backend2mcp.fastapi import MCPAdapter app = FastAPI() @app.get("/users/{id}") async def get_user(id: int): return {"id": id, "name": "Satyam"} MCPAdapter(app).run()
Industry-standard Python web frameworks out of the box
Full Pydantic support, async handlers, automatic documentation
Route converters, extensions support, lightweight
URL patterns, path converters, class-based views
Expanding to all major web frameworks
Python: FastAPI, Flask, Django
JavaScript: Express, NestJS, Fastify
Java: Spring Boot, Quarkus
Go: Gin, Fiber, Echo