a year ago
developer-toolsA Java program that generates a Quarkus MCP server form an Open API Swagger file
Overview
What is OpenAPI to MCP Generator?
OpenAPI to MCP Generator is a Java program that automatically converts OpenAPI/Swagger specifications into Model Context Protocol (MCP) servers, enabling LLMs to interact with REST APIs through standardized tools.
How to use OpenAPI to MCP Generator?
To use the generator, run the command: jbang SwaggerToMcpGenerator.java path/to/swagger.json GeneratedMcpServer. This will create a new file GeneratedMcpServer.java implementing an MCP server with tools for each API endpoint defined in the Swagger file.
Key features of OpenAPI to MCP Generator?
- Converts OpenAPI specifications to MCP servers
- Supports multiple HTTP methods (GET, POST, PUT, DELETE, PATCH)
- Handles authentication (API keys, Bearer tokens, Basic auth)
- Generates readable JSON responses and robust error handling
- Includes parameter documentation with valid values and defaults
Use cases of OpenAPI to MCP Generator?
- Automating the creation of MCP servers from existing OpenAPI specifications.
- Facilitating LLMs to access and interact with REST APIs seamlessly.
- Simplifying the integration of various APIs into applications.
FAQ from OpenAPI to MCP Generator?
- Can this generator handle all OpenAPI specifications?
Yes, it is designed to parse and convert any valid OpenAPI/Swagger specification.
- Is there an example included?
Yes, the project includes an example for the Open-Meteo Weather API.
- What programming language is used?
The generator is written in Java.