Get the FREE Ultimate OpenClaw Setup Guide →

openapi-to

Transform OpenAPI specifications into production-ready MCP servers with AI-powered evaluation and enhancement. Leverages LLMs to analyze, improve, and generate Model Context Protocol implementations from your existing API documentation.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio agentic-community-openapi-to-mcp python -m openapi_to_mcp \
  --env LOG_LEVEL="INFO" \
  --env OPENAPI_SPEC_PATH="path_or_url_to_openapi_spec (required at runtime)"

How to use

OpenAPI to MCP Converter turns an OpenAPI/Swagger specification into a production-ready MCP server, with AI-powered evaluation, enhancement suggestions, and an accompanying MCP client. The tool analyzes the input specification for completeness, security considerations, and AI-readiness, then either enhances the spec or directly generates a fully functioning MCP server package along with a test client. You’ll get an organized output package that includes usage instructions, tool specifications for each operation, and evaluation reports to understand how the MCP server performs and how to improve it.

Usage scenarios include converting a local OpenAPI file or a URL to an MCP server, inspecting the generated tool definitions, and running the produced Python MCP server with the built-in client for testing. The tool emphasizes AI-assisted improvement, so expect enhancement suggestions to address missing descriptions, parameter constraints, error handling, and security considerations before generation.

How to install

Prerequisites:

  • Python 3.12 or higher
  • Git
  • Optional: uv (for related tooling), if you plan to run adjacent utilities

Installation steps:

  1. Clone the repository: git clone https://github.com/agentic-community/openapi-to-mcp.git cd openapi-to-mcp
  2. Create and activate a virtual environment: python -m venv venv

    On Windows

    venv\Scripts\activate

    On macOS/Linux

    source venv/bin/activate
  3. Install dependencies (from project root): pip install -r requirements.txt

    Or rely on your environment’s package manager as appropriate

  4. Run the converter with your OpenAPI specification (example): python -m openapi_to_mcp --spec /path/to/openapi.yaml --output ./output
  5. Review the generated MCP server package in the output directory and follow the provided README inside for deployment instructions.

Notes:

  • If you prefer, you can install and run via a package manager if a distribution is available (see npm_package field if this were Node-based).
  • Ensure your OpenAPI spec is accessible (local file or URL) and valid before running.

Additional notes

Tips and common considerations:

  • The converter performs AI-assisted analysis; provide a high-quality OpenAPI spec to improve results.
  • Review the generated evaluation reports to understand scores on completeness, security, and AI-readiness.
  • The output includes a ready-to-run Python MCP server and a client for testing; use the included tool specifications to map each operation to MCP tools.
  • If environment variables are required for your deployment (e.g., API keys, credentials), set them in the mcp_config env field or your deployment environment accordingly.
  • Be mindful of Bedrock Guardrails or other prompt-injection protections when running AI-assisted tooling in production settings.

Related MCP Servers

Sponsor this space

Reach thousands of developers