MCPSERV.CLUB
cnoe-io

OpenAPI to MCP Server Code Generator

MCP Server

Generate MCP servers from OpenAPI specs in seconds

Stale(60)
22stars
2views
Updated 11 days ago

About

This tool converts OpenAPI specifications into fully‑functional Model Context Protocol (MCP) servers, producing Python packages with tools, clients, and optional LangGraph agents for AI assistants to interact seamlessly with APIs.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

OpenAPI → MCP Server Code Generator

This tool turns an OpenAPI specification into a fully‑functional Model Context Protocol (MCP) server. By parsing the spec’s paths, operations, and schemas, it automatically produces a Python package that exposes each API endpoint as an MCP tool. The generated server comes with ready‑made client code, logging, error handling, and configuration files, allowing developers to hand off the API to an AI assistant with minimal effort.

The generator supports both JSON and YAML spec formats, making it compatible with the most common OpenAPI workflows. For each endpoint it creates a dedicated tool module, complete with type‑annotated parameters and response models. The resulting MCP server can be queried by any AI assistant that speaks the protocol, enabling seamless integration of external APIs into conversational agents without writing custom connectors.

Key features include:

  • Automatic MCP server creation from a single spec file, eliminating boilerplate.
  • LangGraph agent generation (via the flag), which bundles a React‑based agent, an A2A server wrapper, and supporting documentation.
  • Interactive evaluation () that builds a dataset of traces and runs correctness, hallucination, and trajectory checks using LangFuse.
  • System prompt generation () that crafts a tailored instruction set for the agent, leveraging a configured LLM.
  • Optional SLIM transport () for lightweight, containerized deployments.

In practice, this MCP server is invaluable when developers need to expose existing REST APIs to AI assistants. For example, a company can convert its internal service catalog into an MCP server in minutes and then let a Claude‑style assistant retrieve inventory data, submit orders, or query analytics—all through natural language. The tool also supports rapid prototyping of new agents; the LangGraph agent and evaluation suite allow teams to iterate on prompts, tool usage patterns, and error handling without touching the underlying API code.

By automating the conversion from OpenAPI to MCP, this generator reduces integration time, guarantees consistency between the API contract and the assistant’s capabilities, and provides a robust foundation for building AI‑powered applications that rely on external services.