MCP.so
登录

OpenAPI to MCP Server Code Generator

@cnoe-io

基本信息

分类

开发工具

许可证

Apache-2.0

传输方式

stdio

作者

cnoe-io

关于 OpenAPI to MCP Server Code Generator

OpenAPI to MCP Server Code Generator

OpenAPI to MCP Server Code Generator 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "openapi-mcp-codegen": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/cnoe-io/openapi-mcp-codegen.git",
        "openapi_mcp_codegen",
        "\\"
      ]
    }
  }
}

OpenAPI to MCP Server Code Generator 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

点击上方按钮,在临时沙箱中运行此服务器并实时获取工具列表。

概览

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

常见问题

1

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.

2

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.

3

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.

4

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.

5

Can I preview the generated code without writing files?

Yes, use the `--dry-run` flag to preview generation output without creating files.

评论

开发工具 分类下的更多 MCP 服务器