Skip to content

MCP Generator 4.x

Transform any OpenAPI specification into a production-ready FastMCP 4 server.

PyPI GitHub Release License: Apache 2.0 Python 3.11+ FastMCP 4


What is MCP Generator?

MCP Generator automatically creates modular, composable MCP servers from OpenAPI 3.0.x, 3.1.x, and Swagger 2.0 specifications. It bridges REST APIs and AI agents by generating fully-functional MCP tools that AI assistants like Claude, ChatGPT, and others can use to interact with your APIs.

Key Features

  • Modular Architecture


    One sub-server per API tag — composable, scalable, and organized.

  • Enterprise Auth


    JWT/JWKS validation, OAuth2 flows, MultiAuth composition, scope enforcement.

  • Middleware Stack


    Error handling, timing, logging, response limiting, ping keepalive — full FastMCP 4 pipeline.

  • SearchTools & CodeMode


    FastMCP 4 transforms: BM25 tool discovery and experimental meta-tool execution.

  • OpenTelemetry


    Built-in tracing with MCP semantic conventions — Console or OTLP export.

  • Auto-Generated Tests


    Test suites generated alongside your server — ready to run out of the box.

  • Docker Ready


    Dockerfile and docker-compose generated for instant containerized deployment.

  • Tool Tags & Timeouts


    Automatic per-module tags, configurable timeouts, deprecated endpoint detection.

Quick Example

# Install from PyPI
pip install mcp-generator

# Generate from any OpenAPI spec
generate-mcp --url https://petstore3.swagger.io/api/v3/openapi.json

# Run it
cd generated_mcp
python swagger_petstore_openapi_mcp_generated.py --transport http --port 8000

That's it — a fully functional MCP server with 19 tools, modular sub-servers, authentication middleware, and auto-generated tests.

Supported Specs

Format Status
OpenAPI 3.0.x ✅ Fully supported
OpenAPI 3.1.x ✅ Fully supported
Swagger 2.0 ✅ Fully supported
JSON ✅
YAML ✅

Next Steps