OpenAPI-MCP logo

OpenAPI-MCP

by gujord

The OpenAPI-MCP proxy translates OpenAPI specs into MCP tools, enabling AI agents to access external APIs without custom wrappers. It bridges the gap between AI agents and external APIs by dynamically translating OpenAPI specifications into standardized MCP tools, resources, and prompts.

View on GitHub

Last updated: N/A

What is OpenAPI-MCP?

OpenAPI-MCP is a proxy server that dynamically translates OpenAPI specifications into MCP (Model Context Protocol) tools, resources, and prompts. This allows AI agents to access external APIs without the need for custom API wrappers, simplifying integration and enabling seamless communication.

How to use OpenAPI-MCP?

  1. Clone the repository and install the requirements.
  2. Configure your LLM orchestrator (Claude Desktop, Cursor, Windsurf) with the provided JSON snippet, adapting the paths accordingly.
  3. Set the necessary environment variables (OPENAPI_URL, SERVER_NAME, etc.).
  4. The proxy will parse the OpenAPI spec, register operations as tools, convert schemas into resources, and generate prompts for LLMs to use the API.

Key features of OpenAPI-MCP

  • FastMCP Transport

  • OpenAPI Integration

  • Resource Registration

  • Prompt Generation

  • OAuth2 Support

  • JSON-RPC 2.0 Support

  • Auto Metadata

  • Sanitized Tool Names

  • Flexible Parameter Parsing

  • Enhanced Parameter Handling

  • Extended Tool Metadata

Use cases of OpenAPI-MCP

  • Integrating AI agents with external APIs

  • Simplifying API access for LLMs

  • Automating API wrapper generation

  • Providing a standardized interface for API interactions

FAQ from OpenAPI-MCP

What is MCP?

MCP stands for Model Context Protocol, a standardized protocol for AI agents to interact with tools and resources.

What OpenAPI versions are supported?

The README doesn't specify particular versions, but it uses httpx and PyYAML for parsing, suggesting broad compatibility.

How does OAuth2 authentication work?

The proxy supports OAuth2 Client Credentials flow for machine authentication.

Can I use this with other LLM orchestrators?

While the quick start focuses on Claude Desktop, Cursor, and Windsurf, the FastMCP transport and standardized MCP interface should allow integration with other orchestrators.

How are resources registered?

OpenAPI component schemas are automatically converted into resource objects with defined URIs (e.g., /resource/{name}).