openapi-to-mcp
Verified Safeby bbonnin
Overview
An MCP server that dynamically converts any OpenAPI/Swagger specification into AI-usable tools, allowing AI agents to interact with REST APIs without manual tool coding.
Installation
java -jar $PATH_TO_JAR/openapi-mcp-server.jar --openapi.location=<swagger file or URL>Environment Variables
- OPENAPI_LOCATION
- OPENAPI_BASEURL
- SPRING_AI_MCP_SERVER_PROTOCOL
- SPRING_AI_MCP_SERVER_NAME
- SPRING_AI_MCP_SERVER_VERSION
- SERVER_PORT
- SPRING_PROFILES_ACTIVE
Security Notes
The server makes HTTP/HTTPS calls to external APIs based on the provided OpenAPI specification. The primary security risks are: 1. **Untrusted OpenAPI Source**: If the `openapi.location` points to a malicious or untrusted OpenAPI definition, the server could expose dangerous tools to AI agents or make unauthorized calls. 2. **Dev Profile Insecurity**: The `dev` Spring profile in `RestClientConfig` explicitly disables SSL certificate validation and hostname verification. This is a critical vulnerability (Man-in-the-Middle attacks) for any non-development environment where this profile might be accidentally activated. This profile also logs full request/response bodies which could expose sensitive data. 3. **Input Sanitization**: While the server itself doesn't execute arbitrary code, the arguments passed to the `RemoteApiExecutor` are derived from tool calls. Improper handling of these arguments in the OpenAPI definition or the underlying API could lead to injection-like issues.
Similar Servers
mcpo
Exposes Model Context Protocol (MCP) tools as OpenAPI-compatible HTTP servers.
mcp-openapi-server
A Model Context Protocol (MCP) server that exposes OpenAPI endpoints as MCP tools, along with optional support for MCP prompts and resources, enabling Large Language Models to interact with REST APIs.
mcp-servers
A curated collection of Model Context Protocol (MCP) server configurations to integrate various developer tools and services with AI agents.
tmcp
A server implementation for the Model Context Protocol (MCP) to enable LLMs to access external context and tools.