swagger-doc-explorer-mcp
Allows loading and exploring Swagger/OpenAPI specifications, providing tools for browsing endpoints, schemas, tags, and searching across the API documentation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@swagger-doc-explorer-mcp Load https://petstore.swagger.io/v2/swagger.json and list its paths"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Swagger Doc Explorer MCP
MCP server for progressive exploration of Swagger/OpenAPI documentation. Supports stdio (local) and HTTP (remote) transports.
Each loaded spec is identified by a unique name ({title} v{version}) assigned at load time. All downstream tools reference the spec by name, so you can load and inspect multiple specs simultaneously.
Tools
Tool | Description |
| Load spec from a remote URL. |
| Load spec from a local JSON file. |
| List all specs currently loaded (name, title, version, source) |
| Remove a loaded spec from memory. |
| Get API title, version, description, server URL. |
| List all tags/groups with endpoint counts. |
| List endpoints, optionally filtered by |
| Drill into a specific endpoint: |
| Drill into endpoint with all |
| List all data models/schemas. Supports |
| Get full details of a specific schema: |
| Full-text search across endpoints and schemas: |
Related MCP server: magento-api-mcp
Installation
npm install -g swagger-doc-explorer-mcpOr use directly with npx (no install needed):
npx -y swagger-doc-explorer-mcpUsage
stdio (default)
npx -y swagger-doc-explorer-mcpHTTP
SWAGGER_HTTP_PORT=3000 npx -y swagger-doc-explorer-mcpThe HTTP server accepts POST requests at / following the MCP Streamable HTTP protocol. Clients must include Accept: application/json, text/event-stream and use the mcp-session-id header for session affinity:
# Initialize session
curl -X POST http://localhost:3000/ \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"my-client","version":"1.0"}}}'
# Copy the mcp-session-id from response headers, then:
curl -X POST http://localhost:3000/ \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: <session-id>" \
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
curl -X POST http://localhost:3000/ \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: <session-id>" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"swagger_load_spec","arguments":{"url":"https://petstore.swagger.io/v2/swagger.json"}}}'Development
npm run dev # stdio mode with hot reload
npm run dev:http # HTTP mode on port 3000 with hot reloadMCP client configuration
Use npx so the client auto-installs the package:
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"swagger-doc-explorer": {
"command": "npx",
"args": ["-y", "swagger-doc-explorer-mcp"]
}
}
}VS Code (.vscode/mcp.json):
{
"servers": {
"swagger-doc-explorer": {
"type": "stdio",
"command": "npx",
"args": ["-y", "swagger-doc-explorer-mcp"]
}
}
}If installed globally, use swagger-doc-explorer-mcp directly as the command.
opencode (~/.config/opencode/opencode.json):
{
"mcp": {
"swagger-doc-explorer": {
"type": "local",
"command": ["npx", "-y", "swagger-doc-explorer-mcp"],
"enabled": true
}
}
}Environment Variables
Variable | Description |
| Set to enable HTTP mode (e.g. |
Progressive Exploration Workflow
1. swagger_load_spec / swagger_load_local_spec → load the API spec (returns spec_name)
2. swagger_get_info(spec_name="...") → overview of the API
3. swagger_list_tags(spec_name="...") → see available groups
4. swagger_list_paths(spec_name="...", tag="users") → browse endpoints in a group
5. swagger_get_endpoint(spec_name="...", path, method) → drill into endpoint details
6. swagger_list_schemas(spec_name="...") → see available data models
7. swagger_get_schema(spec_name="...", schema_name) → inspect a model
8. swagger_search(spec_name="...", query) → find anything across the specMultiple specs can be loaded and queried simultaneously — each identified by its unique spec_name.
Compatibility
OpenAPI v3.x (
openapifield)Swagger v2 (
swaggerfield)JSON format only (YAML is not supported)
Remote URLs and local file paths
Build & Test
npm run build
npm testAvailable Tools
12 toolsswagger_get_endpointGet Endpoint DetailsARead-onlyIdempotent
Get detailed information about a specific API endpoint, including parameters, request body, responses, and security requirements.
Use this tool after swagger_list_paths to drill down into a specific endpoint's complete details.
Args:
spec_name (string): Name of the previously loaded spec
path (string): URL path of the endpoint (e.g., "/pets/{petId}")
method (string): HTTP method (get, post, put, patch, delete, options, head)
Returns: Full endpoint details with parameters, request body, responses, and security.
Examples:
Use when: "Show me the details of GET /pets/{petId}" -> params with spec_name="", path="/pets/{petId}", method="get"
Use when: "What parameters does the create user endpoint take?" -> params with spec_name="", path="/users", method="post"
Error Handling:
Returns error if the spec name has not been loaded
Returns error if the path or method is not found, with suggestions
Inputs: path (required), method (required), spec_name (required).
swagger_get_endpoint_fullGet Endpoint Details (All $ref Resolved)ARead-onlyIdempotent
Get detailed information about a specific API endpoint with all schema references ($ref) recursively resolved.
Unlike swagger_get_endpoint, this tool resolves every $ref into its full schema definition. Parameters, request body schemas, and response schemas are expanded inline with no external references. Circular references are detected and marked.
Use this when you need the complete endpoint definition in a single call, without needing to follow $ref links manually.
Args:
spec_name (string): Name of the previously loaded spec
path (string): URL path of the endpoint (e.g., "/pets/{petId}")
method (string): HTTP method (get, post, put, patch, delete, options, head)
Returns: Full endpoint details with all $ref resolved recursively.
Examples:
Use when: "Show me everything about GET /pets/{petId} with all schemas expanded" -> params with spec_name="", path="/pets/{petId}", method="get"
Use when: "Give me the full request body schema for creating a user" -> params with spec_name="", path="/users", method="post"
Error Handling:
Returns error if the spec name has not been loaded
Returns error if the path or method is not found, with suggestions
Inputs: path (required), method (required), spec_name (required).
swagger_get_infoGet API InfoARead-onlyIdempotent
Get general information about a loaded OpenAPI/Swagger specification, including title, version, description, server URL, contact info, and license.
Use this tool to get a high-level summary of an API spec.
Args:
spec_name (string): Name of the previously loaded spec (use swagger_list_loaded to see available names)
Returns: { "title": string, // API title "version": string, // API version "description": string, // API description "server_url": string, // Base server URL "endpoints": number, // Total endpoint count "schemas": number, // Total schema count "tags": number, // Total tag count "openapi_version": string // OpenAPI spec version }
Examples:
Use when: "Tell me about this API" -> params with spec_name=""
Use when: "What's the base URL for this API?" -> params with spec_name=""
Error Handling:
Returns error if the spec name has not been loaded
Inputs: spec_name (required).
swagger_get_schemaGet Schema DetailsARead-onlyIdempotent
Get detailed information about a specific component schema (data model), including all properties, types, constraints, and examples.
Use this tool to drill down into a specific data model after using swagger_list_schemas.
Args:
spec_name (string): Name of the previously loaded spec
schema_name (string): Name of the schema/model (e.g., "Pet", "User", "Order", "Error")
Returns: Formatted output with the full schema definition including type, properties, required fields, enums, constraints, and examples.
Examples:
Use when: "Show me the Pet model" -> params with spec_name="", schema_name="Pet"
Use when: "What fields does the User schema have?" -> params with spec_name="", schema_name="User"
Error Handling:
Returns error if the spec name has not been loaded
Returns error if the schema name is not found, suggesting available schemas
Inputs: spec_name (required), schema_name (required).
swagger_list_loadedList Loaded SpecsARead-onlyIdempotent
List all currently loaded OpenAPI/Swagger specifications in memory.
Use this tool to see which specs have been loaded and are available for exploration.
Args: None
Returns: { "loaded": [ // Array of loaded specs { "name": string, "title": string, "version": string, "source": string, "loaded_at": string } ] }
Examples:
Use when: "What specs have I loaded?" -> no params needed
Use when: "Show my loaded APIs" -> no params needed
Inputs: no named parameters.
swagger_list_pathsList API EndpointsARead-onlyIdempotent
List all API endpoints (paths and HTTP methods) from a loaded OpenAPI spec, optionally filtered by tag.
Use this tool to get a high-level overview of all available API operations. Results can be filtered by tag for progressive exploration.
Args:
spec_name (string): Name of the previously loaded spec
tag (string, optional): Filter endpoints by this tag/group name
limit (number): Maximum results to return, between 1-200 (default: 50)
offset (number): Number of results to skip for pagination (default: 0)
Returns: { "total": number, // Total number of matching endpoints "count": number, // Number of results in this response "offset": number, // Current pagination offset "endpoints": [...], "has_more": boolean, "next_offset": number }
Examples:
Use when: "Show me all endpoints" -> params with spec_name=""
Use when: "List all user-related endpoints" -> params with spec_name="", tag="users"
Error Handling:
Returns error if the spec name has not been loaded yet
Inputs: spec_name (required), tag, limit, offset.
swagger_list_schemasList Component SchemasARead-onlyIdempotent
List all component schemas (data models) defined in the loaded OpenAPI spec.
Use this tool to get an overview of all data models used by the API, including their types and number of properties.
Args:
spec_name (string): Name of the previously loaded spec
limit (number): Maximum results to return (default: 50)
offset (number): Number of results to skip (default: 0)
Returns: { "total": number, // Total number of schemas "count": number, // Number of results in this response "offset": number, // Current pagination offset "schemas": [{ "name", "type", "description", "properties" }], "has_more": boolean, "next_offset": number }
Examples:
Use when: "What data models are defined?" -> params with spec_name=""
Use when: "Show me all schemas" -> params with spec_name=""
Error Handling:
Returns error if the spec name has not been loaded yet
Inputs: spec_name (required), limit, offset.
swagger_list_tagsList API TagsARead-onlyIdempotent
List all API tags/groups and their associated endpoint counts from a loaded OpenAPI spec.
Tags are used to group related endpoints. This tool helps with progressive exploration by showing available filter categories.
Args:
spec_name (string): Name of the previously loaded spec
Returns: { "tags": [{ "name": string, "count": number }] }
Examples:
Use when: "What tags/groups are available?" -> params with spec_name=""
Use when: "How are the endpoints organized?" -> params with spec_name=""
Error Handling:
Returns error if the spec name has not been loaded
Inputs: spec_name (required).
swagger_load_local_specLoad Local Swagger/OpenAPI Spec FileARead-only
Load and parse an OpenAPI (Swagger) specification document from a local JSON file.
This tool reads a JSON OpenAPI/Swagger spec from a local file path and stores it in memory for subsequent exploration. The file path can be absolute or relative to the current working directory.
Each loaded spec is assigned a unique name (title + version). If a spec with the same name already exists, a numeric suffix is appended.
Args:
file_path (string): Path to a local OpenAPI/Swagger JSON file (e.g., "./swagger.doc.json" or "/path/to/api-spec.json")
Returns: { "spec_name": string, // The assigned spec name for subsequent tools "title": string, // API title from the spec "version": string, // API version from the spec "description": string, // API description (if available) "endpoints": number, // Total number of API endpoints found "schemas": number, // Total number of schemas/components found "tags": number, // Total number of unique tags found "server_url": string // Base server URL from the spec }
Examples:
Use when: "Load the local swagger.doc.json" -> params with file_path="./swagger.doc.json"
Use when: "Load our API spec from disk" -> params with file_path="/home/user/projects/api/openapi.json"
Error Handling:
Returns error if the file path does not exist
Returns error if the file is not valid JSON
Returns error if the JSON is not a valid OpenAPI/Swagger spec
Inputs: file_path (required).
swagger_load_specLoad Swagger/OpenAPI SpecARead-only
Load and parse an OpenAPI (Swagger) specification document from a URL.
This tool fetches a JSON OpenAPI/Swagger spec from the given URL and stores it in memory for subsequent exploration. You must load a spec before using any other tools.
Each loaded spec is assigned a unique name (title + version). If a spec with the same name already exists, a numeric suffix is appended.
Args:
url (string): URL to the OpenAPI/Swagger JSON spec (e.g., "https://petstore.swagger.io/v2/swagger.json")
auth_header (string, optional): Authorization header value for protected specs (e.g., "Bearer token123" or "Basic base64encoded"). Only needed for authenticated endpoints.
Returns: { "spec_name": string, // The assigned spec name for subsequent tools "title": string, // API title from the spec "version": string, // API version from the spec "description": string, // API description (if available) "endpoints": number, // Total number of API endpoints found "schemas": number, // Total number of schemas/components found "tags": number, // Total number of unique tags found "server_url": string // Base server URL from the spec }
Examples:
Use when: "Load the Petstore API spec" -> params with url="https://petstore.swagger.io/v2/swagger.json"
Use when: "Load our internal API docs" -> params with url="https://api.internal.company.com/openapi.json"
Error Handling:
Returns error if URL is unreachable or times out
Returns error if the document is not valid OpenAPI/Swagger JSON
Returns error if YAML format is provided (only JSON is supported)
Inputs: url (required), auth_header.
swagger_remove_specRemove Loaded SpecADestructive
Remove a loaded OpenAPI/Swagger specification from memory.
Use this tool to free up memory or reload a spec that has changed.
Args:
spec_name (string): Name of the spec to remove
Returns: Confirmation message.
Examples:
Use when: "Remove the Petstore API spec" -> params with spec_name="Petstore v1.0.0"
Use when: "Unload the internal API spec" -> params with spec_name="Internal API v2.0"
Error Handling:
Returns error if the spec name is not found
Inputs: spec_name (required).
swagger_searchSearch API SpecARead-onlyIdempotent
Search across all endpoints and schemas in a loaded OpenAPI spec for a given query string.
Searches through endpoint paths, operation summaries, operationIds, descriptions, tags, schema names, and property names.
Args:
spec_name (string): Name of the previously loaded spec
query (string): Search term to find in endpoint paths, summaries, operationIds, tags, schema names, and property descriptions
Returns: { "total": number, // Total number of matches "results": [ { "type": "endpoint" | "schema" | "property", "path": string, // URL path (for endpoints) "method": string, // HTTP method (for endpoints) "schemaName": string, // Schema name (for schemas/properties) "propertyName": string, // Property name (for properties) "match": string, // Human-readable match description "summary": string // Brief description } ] }
Examples:
Use when: "Search for anything about pets" -> params with spec_name="", query="pet"
Use when: "Find endpoints related to users" -> params with spec_name="", query="user"
Error Handling:
Returns error if the spec name has not been loaded
Inputs: query (required), spec_name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool has a clearly distinct purpose: loading (URL vs local file), managing loaded specs, listing tags/paths/schemas, getting details, and searching. The two endpoint-detail tools differ explicitly in whether schema references are resolved, and their descriptions make this clear.
All tools follow a consistent snake_case pattern with the 'swagger_' prefix and a verb-object structure (load_spec, list_tags, get_endpoint, etc.). Exceptions like load_local_spec and get_endpoint_full are systematic and readable.
12 tools is well-scoped for a Swagger/OpenAPI explorer. The count covers the full exploration lifecycle—loading, listing, retrieving, searching, and managing specs—without unnecessary bloat or missing essentials.
The tool surface is complete for the stated exploration purpose. It supports loading (URL + local), inspecting info/tags/paths/schemas, drilling into endpoints (with optional full $ref resolution), searching, and removing specs. No obvious dead ends or missing operations.
Maintenance
Related MCP Connectors
Read-only HotAPI documentation: search integration guides and inspect OpenAPI operations.
Schema-aware API monitoring: diff OpenAPI specs for breaking changes, manage endpoints.
Detect breaking changes, generate changelogs, diff, and validate OpenAPI specs.
Search and read the Flowie Exchange API docs and OpenAPI contract. No sign-in needed.
Related MCP Servers
- AlicenseAqualityCmaintenanceDiscovers, inspects, and executes requests against OpenAPI or Swagger APIs directly from documentation URLs or specification files. It enables users to trace parameter usage across an API and perform authenticated HTTP requests through a structured toolset.815 npm5MIT
- FlicenseAqualityDmaintenanceEnables searching and retrieving Magento 2 REST API documentation offline via local OpenAPI parsing, supporting endpoint search, schema lookup, and category browsing.57-
- AlicenseAqualityDmaintenanceExposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.1420 npm2MIT
- FlicenseAqualityDmaintenanceEnables reading and parsing Swagger/OpenAPI specifications to list API endpoints, get detailed endpoint info, search APIs, and generate TypeScript types for request/response.9-