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
コメント