OpenAPI to MCP Server Converter logo

OpenAPI to MCP Server Converter

by zxypro1

A tool for automatically converting OpenAPI specifications into Model Context Protocol (MCP) server instances. It simplifies the integration of OpenAPI definitions with MCP environments.

View on GitHub

Last updated: N/A

What is OpenAPI to MCP Server Converter?

This server is a converter that takes an OpenAPI 3.0 specification as input and automatically generates a Model Context Protocol (MCP) server instance. It allows you to easily expose your OpenAPI defined APIs as MCP services.

How to use OpenAPI to MCP Server Converter?

To use the converter, install the package via npm, provide your OpenAPI specification (in JSON format), instantiate the OpenApiMCPSeverConverter class, and then connect the resulting server to an MCP transport (e.g., StdioServerTransport). Refer to the provided code example for a basic usage demonstration.

Key features of OpenAPI to MCP Server Converter

  • Automated Conversion of OpenAPI 3.0 specifications

  • TypeScript-based strong type validation

  • Automatic handling of tool call parameter mapping

  • Supports Node.js 18+ and TypeScript 5.x

Use cases of OpenAPI to MCP Server Converter

  • Exposing existing OpenAPI defined APIs as MCP services

  • Integrating OpenAPI specifications into MCP-based applications

  • Automating the creation of MCP servers from API definitions

  • Simplifying the development of MCP services based on standard API specifications

FAQ from OpenAPI to MCP Server Converter

What versions of OpenAPI are supported?

Currently, only OpenAPI 3.0 specifications are supported.

What are the prerequisites for using this converter?

You need Node.js 18+ and TypeScript 5.x installed on your system.

How do I install the converter?

You can install the converter using npm with the command: npm install openapi-mcp-converter.

How do I run the example?

You can execute the sample test cases using the command: npm run test.

Where can I find the source code?

The source code is located in the src/ directory of the project.