Swagger MCP Server
Enables AI assistants to discover configured Swagger/OpenAPI services and fetch, search, and analyze their documentation, endpoints, and schemas across microservices.
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 MCP Server show me all endpoints in the user-service API"
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 MCP Server
An MCP (Model Context Protocol) server that provides AI tools access to multiple Swagger/OpenAPI documentation endpoints. This allows AI assistants to browse, search, and understand API specifications across your microservices architecture.
Features
Service Discovery: List and search available microservices
Swagger Fetching: Retrieve full OpenAPI/Swagger documentation
Endpoint Analysis: Extract and search API endpoints
Schema Extraction: Get data models and schemas
Service Comparison: Compare endpoints between services
Caching: Built-in caching mechanism for performance
Group Filtering: Organize services by groups
Related MCP server: mcp-swagger
Installation
npm install
npm run buildQuick Start
Clone and build the project:
git clone <repository-url>
cd swagger-mcp
npm install
npm run buildGenerate an example MCP configuration:
node generate-example-config.jsThis will create an example.mcp.json file with the correct paths to your swagger-mcp installation.
Copy the generated configuration to LLM MCP configuration
Add your Swagger endpoints to
swagger-config.json:
[
{
"name": "Service Name",
"slug": "service-slug",
"baseUrl": "http://service.example.com",
"openApiPath": "/documentation/json",
"group": "Service Group"
}
]Restart Agent to load the MCP server.
Configuration
The server reads service configurations from swagger-config.json file. Each service should have:
{
"name": "Service Name",
"slug": "service-slug",
"baseUrl": "http://service.example.com",
"openApiPath": "/documentation/json",
"group": "Service Group"
}Usage
Adding to Claude Code
The generate-example-config.js script creates an MCP configuration with the correct absolute paths. The generated configuration will look like:
{
"mcpServers": {
"swagger": {
"command": "node",
"args": ["/absolute/path/to/swagger-mcp/dist/index.js"]
}
}
}After adding the configuration, restart Agent for the changes to take effect.
Available Tools
The MCP server provides the following tools:
list_services - List all available microservices
Optional: Filter by group
search_services - Search for services by name, slug, or group
Required: query string
get_swagger - Get full OpenAPI/Swagger documentation
Required: service slug
get_endpoints - List all endpoints from a service
Required: service slug
search_endpoints - Search for specific endpoints
Required: service slug and query
get_endpoint_details - Get detailed endpoint information
Required: service slug, path, and HTTP method
get_schemas - Extract data schemas/models
Required: service slug
compare_services - Compare endpoints between two services
Required: two service slugs
Available Resources
Each service is exposed as a resource with URI format: swagger://{service-slug}
Development
# Run in development mode
npm run dev
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Lint and format code
npm run lint
# Check linting without fixing
npm run lint:checkArchitecture
The server is built with:
TypeScript for type safety
@modelcontextprotocol/sdk for MCP server implementation
Biome for linting and formatting
Vitest for testing
node-fetch for HTTP requests
Main Components
index.ts- MCP server implementation and tool handlersswagger-fetcher.ts- Service for fetching and caching Swagger documentsswagger-analyzer.ts- Utilities for analyzing Swagger documentstypes.ts- TypeScript type definitions
Testing
Tests are written using Vitest and cover:
Service discovery and filtering
Swagger document fetching and caching
Endpoint extraction and searching
Schema extraction
Base URL resolution
Run tests with:
npm testLicense
MIT
Available Tools
12 toolscompare_servicesC
Compare endpoints between two services
Inputs: slug1 (required), slug2 (required).
find_similarC
Find endpoints similar to a given endpoint
Inputs: path (required), method (required), service (required), limit.
get_endpoint_detailsC
Get detailed information about a specific endpoint
Inputs: path (required), slug (required), method (required).
get_endpointsB
Get all endpoints from a service's API
Inputs: slug (required).
get_schemasB
Get all data schemas/models from a service
Inputs: slug (required).
get_swaggerB
Get the full OpenAPI/Swagger documentation for a service
Inputs: slug (required).
indexing_statusC
Check the status of background indexing
Inputs: no named parameters.
list_servicesB
List all available microservices
Inputs: group.
search_endpointsC
Search for specific endpoints in a service
Inputs: slug (required), query (required).
search_servicesB
Search for microservices by name, slug, or group
Inputs: query (required).
search_statsC
Get statistics about indexed swagger documentation
Inputs: no named parameters.
semantic_searchC
Search across all API documentation using natural language queries
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools target a clearly distinct resource+action (list_services vs. search_services, get_endpoints vs. get_endpoint_details, compare_services, find_similar). The riskiest pairs are search_endpoints vs. semantic_search (keyword-in-service vs. natural-language-across-all) and indexing_status vs. search_stats (status vs. statistics), but descriptions give enough signal to separate them.
Eight tools follow a clean verb_noun pattern (list_services, get_endpoints, compare_services). Deviations are minor but present: noun-first names like indexing_status and search_stats, plus adjective_noun semantic_search and the objectless find_similar, which break the otherwise predictable convention.
Twelve tools sit squarely in the well-scoped range and each maps to a concrete browsing/search need. There's no obviously redundant or filler tool for a Swagger documentation server.
The surface covers listing, searching, fetching specs, endpoints, schemas, details, semantic search, similarity, comparison, indexing and stats — a full read-only lifecycle. Minor gaps remain: no filtering endpoints by method/tag, no batch multi-endpoint fetch, and no way to resolve a schema referenced by name across services.
Maintenance
Related MCP Connectors
Publish your API docs so AI assistants can look up endpoints and call your API correctly.
Discover, compare, route, and execute machine-accessible capabilities for AI agents.
Schema-aware API monitoring: diff OpenAPI specs for breaking changes, manage endpoints.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to load, parse, and query OpenAPI/Swagger documentation from URLs with intelligent search across endpoints, schemas, and authentication methods. Provides 10 specialized tools for comprehensive API exploration including path details, operation lookups, and multi-criteria search capabilities.4-
- AlicenseAqualityDmaintenanceExposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.1427 npm2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to browse, read, compare, and validate OpenAPI contracts for providers and consumers.1MIT
- FlicenseAqualityDmaintenanceEnables LLMs to dereference and query OpenAPI/Swagger specifications, search endpoints and schemas, validate payloads, extract security schemes, and generate production-ready integration code in multiple languages.8-