Convert FastAPI, Flask, Django, Starlette, aiohttp, Sanic, Bottle, or Quart applications into fully functional MCP (Model Context Protocol) servers. 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, eight frameworks. FastAPI, Flask, Django, Starlette, aiohttp, Sanic, Bottle and Quart 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, permissions, tags, 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
ASGI routes, async handlers, typed path parameters
Async web routes and dynamic resources
High-performance async HTTP routes
Micro-framework routes with both path syntaxes
Async Flask-style routing and converters
Expanding to all major web frameworks
Python: FastAPI, Flask, Django, Starlette, aiohttp, Sanic, Bottle, Quart
JavaScript: Express, NestJS, Fastify
Java: Spring Boot, Quarkus
Go: Gin, Fiber, Echo