Back to Home
bbonnin icon

openapi-to-mcp

Verified Safe

by 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

Run Command
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

Stats

Interest Score0
Security Score6
Cost ClassMedium
Avg Tokens1000
Stars0
Forks0
Last Update2025-12-05

Tags

OpenAPISwaggerAI ToolsMCP ServerAPI Gateway