home / mcp / swagger explorer mcp server
Provides an MCP server to explore and analyze Swagger/OpenAPI specifications through Claude or other MCP clients.
Configuration
View docs{
"mcpServers": {
"johnneerdael-swagger-mcp": {
"command": "npx",
"args": [
"-y",
"@johnneerdael/swagger-mcp",
"--swagger-url=$SWAGGER_URL"
],
"env": {
"PORT": "3000",
"BASE_URL": "''",
"AUTH_TOKEN": "YOUR_TOKEN",
"SWAGGER_URL": "URL_TO_SWAGGER"
}
}
}
}You can explore and analyze Swagger/OpenAPI specifications through Claude by using the Swagger Explorer MCP server. It connects to a Swagger URL, analyzes endpoints and schemas, and presents structured insights that help you understand APIs faster.
Use the Swagger Explorer MCP with your preferred MCP client to connect to a Swagger URL and request exploration, schema details, or response schemas. Start a session by pointing the MCP to the target Swagger documentation and optionally enable path and schema analysis to tailor the results to your needs.
Typical actions you can perform include exploring the API surface (paths and methods), inspecting detailed schemas for entities like Pet, and retrieving response schemas for specific endpoints. The MCP handles authentication when a token is provided and formats results according to your chosen output mode.
Prerequisites: you need Node.js installed on your machine to run MCPs via npx or npm.
# Quick start: run globally with npx
npx -y @johnneerdael/swagger-mcpInstall with environment variables to specify the base API URL, authentication, and port.
# Install with environment variables
npx -y @johnneerdael/swagger-mcp \
--env BASE_URL=/api \
--env AUTH_TOKEN=your-token \
--env PORT=3000If you are integrating with Claude Desktop, add the MCP server using the following settings.
Name: Swagger Explorer
Command: npx -y @johnneerdael/swagger-mcp
Arguments: --swagger-url=$SWAGGER_URLEnvironment variables you can configure include the base URL, bearer token, port, and the default Swagger documentation URL. These are used to control how the MCP connects to and authenticates with the Swagger source.
The MCP supports a minimal, detailed, or raw response format. Choose the format that best fits your workflow.
If you encounter connection issues, verify that the Swagger URL is accessible and the authentication token (if used) is correct. Ensure the server port is not in use by another process.
For authorization errors, confirm that AUTH_TOKEN is set correctly and that bearer tokens are included in requests.
If a schema cannot be found, double-check the exact schema name and confirm that the Swagger specification loaded successfully.
The MCP requires authentication if an AUTH_TOKEN is configured. All requests are logged for debugging, and sensitive information is not cached. Rate limiting helps prevent abuse.
To contribute or modify: clone the project, install dependencies, build, and run locally.
npm installnpm run buildnpm startMIT License - See the license file for details.
Fetches and lists API endpoints, schemas, and metadata from the Swagger documentation.
Retrieves detailed information for a specified schema name from the Swagger spec.
Returns the response schemas for a given path and HTTP method.