π OpenAPI to MCP Server Code Generator
@cnoe-io
About π OpenAPI to MCP Server Code Generator
OpenAPI to MCP Server Code Generator
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"openapi-mcp-codegen": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/cnoe-io/openapi-mcp-codegen.git",
"openapi_mcp_codegen",
"\\"
]
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is π OpenAPI to MCP Server Code Generator?
This tool generates Model Context Protocol (MCP) servers from OpenAPI specifications, producing Python packages that AI assistants can use to interact with APIs. It parses paths, operations, and schemas from OpenAPI specs (JSON or YAML) and renders Jinja2 templates into a structured MCP server with tools, models, and client code.
How to use π OpenAPI to MCP Server Code Generator?
Run uvx --from git+https://github.com/cnoe-io/openapi-mcp-codegen.git openapi_mcp_codegen --spec-file <path> --output-dir <path> with optional flags such as --generate-agent, --generate-eval, or --enable-slim. For enhanced documentation, use python -m openapi_mcp_codegen.enhance_and_generate.
Key features of π OpenAPI to MCP Server Code Generator
- Automatic MCP server generation from OpenAPI specs
- Supports JSON and YAML input formats
- Tool modules created for each API endpoint
- API client code generation (httpx-based)
- Logging, error handling, and configuration files included
- Optional LangGraph ReAct agent and A2A server generation
- Optional evaluation mode with LangFuse tracing
- Optional SLIM transport bridging for A2A servers
Use cases of π OpenAPI to MCP Server Code Generator
- Quickly create an MCP server for any REST API described by an OpenAPI spec
- Deploy an AI agent that can call API endpoints via natural language (using generated LangGraph agent and A2A server)
- Evaluate agent performance with automated correctness, hallucination, and trajectory accuracy tests
- Integrate MCP servers with SLIM-based messaging infrastructure for scalable agent communication
FAQ from π OpenAPI to MCP Server Code Generator
What does the generated MCP server contain?
A Python package with FastMCP-based server, tool functions for each API operation (async, type-hinted), an API client module, configuration files (pyproject.toml, .env.example), and optional agent/evaluation components.
What are the runtime dependencies?
Python 3.8+, uv package manager, and the Python packages mcp>=1.9.0, httpx, Jinja2, and Ruff. The generated server runs in STDIO mode by default.
Does this tool support all OpenAPI versions?
The README does not specify version limits; it processes OpenAPI specs in JSON or YAML format. The generator uses standard path, operation, and schema parsing.
How does the generated server communicate with the AI assistant?
By default the MCP server communicates over STDIO using the Model Context Protocol. When combined with --generate-agent, an A2A server is also produced for HTTP-based agent communication. SLIM transport is available experimentally.
Can I preview the generated code without writing files?
Yes, use the --dry-run flag to preview generation output without creating files.
Frequently asked questions
What does the generated MCP server contain?
A Python package with FastMCP-based server, tool functions for each API operation (async, type-hinted), an API client module, configuration files (pyproject.toml, .env.example), and optional agent/evaluation components.
What are the runtime dependencies?
Python 3.8+, `uv` package manager, and the Python packages `mcp>=1.9.0`, `httpx`, `Jinja2`, and `Ruff`. The generated server runs in STDIO mode by default.
Does this tool support all OpenAPI versions?
The README does not specify version limits; it processes OpenAPI specs in JSON or YAML format. The generator uses standard path, operation, and schema parsing.
How does the generated server communicate with the AI assistant?
By default the MCP server communicates over STDIO using the Model Context Protocol. When combined with `--generate-agent`, an A2A server is also produced for HTTP-based agent communication. SLIM transport is available experimentally.
Can I preview the generated code without writing files?
Yes, use the `--dry-run` flag to preview generation output without creating files.
Basic information
More Developer Tools MCP servers
Vibgrate MCP
VibgrateQuery your team's drift, vulnerability, and migration data from any AI assistant. Vibgrate MCP connects Cursor, Claude, ChatGPT, Windsurf, or VS Code to Vibgrate Cloud: 51 tools for DriftScores, CVEs and EOL runtimes, up

Termany
thinkany-aiAgent-Native Terminal
OpenSumi
opensumiA framework helps you quickly build AI Native IDE products. MCP Client, supports Model Context Protocol (MCP) tools via MCP server.

TaskerArmy Agent
TaskerArmyAsk Claude or ChatGPT what Shopify theme optimization tasks are pending on your store, a remote MCP server for TaskerArmy Agent accounts.
Altronis
sypherinMCP server + CLI for Altronis β Singapore AI consulting. Ask the Lyra consultant, generate a grant-matched AI transformation plan, pull curated SG AI events/news. Read-only, wraps altronis.sg.
Comments