amrsa1/swagger-mcp
If you are the rightful owner of swagger-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Swagger MCP Server is a tool designed to facilitate the exploration and testing of APIs using Swagger/OpenAPI documentation, with support for multiple IDEs and flexible authentication options.
The Swagger MCP Server is a comprehensive solution for developers looking to explore, test, and interact with APIs through Swagger/OpenAPI documentation. It offers a seamless experience by automatically detecting configuration files from various IDEs, such as VS Code, Cursor, and Windsurf. The server provides robust API interaction capabilities, allowing users to fetch and parse documentation, test endpoints, and explore API schemas. With flexible authentication options, including API keys, basic auth, and bearer tokens, the server ensures secure and efficient API access. Additionally, the auto-discovery feature simplifies the process of finding documentation URLs, making it easier for developers to get started with API integration.
Features
- Fetch and parse Swagger/OpenAPI documentation from any URL
- Test API endpoints directly through the MCP interface
- Explore API schemas and understand data structures
- Multi-IDE support with automatic configuration detection
- Flexible authentication with API keys, basic auth, and bearer tokens
Usages
usage with VS Code
{ "swagger-mcp": { "command": "npx", "args": [ "-y", "swagger-mcp@latest" ], "env": { "API_BASE_URL": "https://api.example.com", "API_DOCS_URL": "https://api.example.com/swagger.json", "API_KEY": "your-api-key-here" } } }
usage with Cursor
{ "swagger-mcp": { "command": "npx", "args": [ "-y", "swagger-mcp@latest" ], "env": { "API_BASE_URL": "https://api.example.com", "API_DOCS_URL": "https://api.example.com/swagger.json", "API_KEY": "your-api-key-here" } } }
usage with Windsurf
{ "swagger-mcp": { "command": "npx", "args": [ "-y", "swagger-mcp@latest" ], "env": { "API_BASE_URL": "https://api.example.com", "API_DOCS_URL": "https://api.example.com/swagger.json", "API_KEY": "your-api-key-here" } } }
usage with Root directory
{ "swagger-mcp": { "command": "npx", "args": [ "-y", "swagger-mcp@latest" ], "env": { "API_BASE_URL": "https://api.example.com", "API_DOCS_URL": "https://api.example.com/swagger.json", "API_KEY": "your-api-key-here" } } }
usage with Alternative location
{ "swagger-mcp": { "command": "npx", "args": [ "-y", "swagger-mcp@latest" ], "env": { "API_BASE_URL": "https://api.example.com", "API_DOCS_URL": "https://api.example.com/swagger.json", "API_KEY": "your-api-key-here" } } }
Tools
fetch_swagger_info
Fetches and parses Swagger/OpenAPI documentation from a given URL to discover available API endpoints.
list_endpoints
Lists all available API endpoints after fetching Swagger documentation, showing methods, paths, and summaries.
get_endpoint_details
Gets detailed information about a specific API endpoint including parameters, request/response schemas, and examples.
execute_api_request
Executes an API request to a specific endpoint with authentication, parameters, headers, and body handling.
validate_api_response
Validates an API response against the schema definitions from Swagger documentation to ensure compliance.