home / mcp / swagger mcp server
MCP server that provides tools for exploring and testing APIs through Swagger/OpenAPI documentation.
Configuration
View docs{
"mcpServers": {
"amrsa1-swagger-mcp": {
"url": "https://api.example.com/swagger.json",
"headers": {
"API_KEY": "YOUR_API_KEY",
"API_BASE_URL": "https://api.example.com",
"API_DOCS_URL": "https://api.example.com/swagger.json",
"API_PASSWORD": "YOUR_PASSWORD",
"API_USERNAME": "YOUR_USERNAME"
}
}
}
}Swagger MCP Server is an MCP server that helps you fetch, parse, and interact with Swagger/OpenAPI documentation directly from your editor. It lets you explore API schemas, test endpoints, and manage authentication in one streamlined workflow, improving API understanding and testing efficiency.
You configure the MCP client in your editor to automatically discover and interact with Swagger/OpenAPI documentation. Use the client to fetch docs from a URL, list available endpoints, inspect request/response schemas, and run API requests with your credentials. Authenticate using your API key, username/password, or Bearer tokens, and let the server manage tokens and automatic refreshes during testing.
Prerequisites you need before installation are Node.js and npm. Ensure your environment can run MCP configurations in your editor.
Clone the project repository, install dependencies, and start the development server with the following steps.
The server supports two primary connection methods. Use the HTTP method to point to a Swagger/OpenAPI URL, or run the server locally via a stdio command for development and testing.
Install dependencies, then run in development mode and build for production.
Fetches and parses Swagger/OpenAPI documentation from a URL to discover available API endpoints.
Lists all available API endpoints with methods, paths, and summaries after Swagger parsing.
Provides detailed information about a specific endpoint, including parameters and schemas.
Performs an API request to a chosen endpoint with authentication, parameters, headers, and body handling.
Validates API responses against Swagger schema definitions to ensure conformance.