v0.2.0 Released

Turn Python Backends into
MCP Servers Instantly

Convert FastAPI, Flask, Django, Starlette, aiohttp, Sanic, Bottle, or Quart applications into fully functional MCP (Model Context Protocol) servers. Zero boilerplate. Pure magic.

Why backend2mcp?

Everything you need to expose your Python API as MCP tools

Instant Setup

Two lines of code. No migrations, no code generation, no configuration files. Your API is an MCP server.

Multi-Framework

One interface, eight frameworks. FastAPI, Flask, Django, Starlette, aiohttp, Sanic, Bottle and Quart all work the same way.

Smart Introspection

Automatically extracts types, parameters, and schemas from your route handlers and Pydantic models.

Direct Execution

No HTTP overhead. Tools call your handlers directly, preserving all authentication and business logic.

Fine-Grained Control

Use the @mcp_tool decorator to customize names, descriptions, permissions, tags, or hide routes entirely.

Extensible Design

Clean adapter pattern makes it easy to add support for new frameworks or customize behavior.

Get Started in Minutes

Install, import, and run. That's it.

main.py
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()

Supported Frameworks

Industry-standard Python web frameworks out of the box

⚡

FastAPI

Full Pydantic support, async handlers, automatic documentation

🌶️

Flask

Route converters, extensions support, lightweight

🎪

Django

URL patterns, path converters, class-based views

⭐

Starlette

ASGI routes, async handlers, typed path parameters

🌊

aiohttp

Async web routes and dynamic resources

🚀

Sanic

High-performance async HTTP routes

🍶

Bottle

Micro-framework routes with both path syntaxes

⚡

Quart

Async Flask-style routing and converters

Roadmap

Expanding to all major web frameworks

Phase 1 ✓

Python: FastAPI, Flask, Django, Starlette, aiohttp, Sanic, Bottle, Quart

Phase 2

JavaScript: Express, NestJS, Fastify

Phase 3

Java: Spring Boot, Quarkus

Phase 4

Go: Gin, Fiber, Echo