Swagger Docs MCP Server
Allows fetching, parsing, and validating Swagger/OpenAPI documentation from JSON/YAML files, Swagger UI endpoints, or multi-API configs; provides tools to list and search endpoints, retrieve schema definitions, and get API metadata.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Swagger Docs MCP Server
A Model Context Protocol (MCP) server that fetches and interacts with Swagger/OpenAPI documentation with built-in authentication support.
Features
Fetch and parse Swagger/OpenAPI documentation from various sources:
Direct JSON/YAML files (e.g.,
/swagger.json,/openapi.yaml)Swagger UI endpoints (e.g.,
/api-docs)Multi-API swagger-config.json setups
Multiple authentication methods:
Basic Authentication
Bearer Token
API Key
No authentication
Cache fetched documentation for improved performance (configurable TTL)
Comprehensive tools for:
Fetching and validating Swagger docs
Listing all API endpoints (with optional tag filtering)
Searching endpoints by keywords
Retrieving schema/model definitions
Getting API information and metadata
Working with multiple API sources
Related MCP server: mcp-swagger
Installation
npm install
npm run buildConfiguration
Quick Start
There are two ways to configure this MCP server:
Option A: Using .env file (Local Development)
Option B: Using MCP Settings (Recommended for Claude Desktop/Code)
Option A: Using .env File
Copy
.env.exampleto.env:cp .env.example .envEdit
.envand configure your Swagger URL and authentication:# Required: Your Swagger/OpenAPI documentation URL SWAGGER_URL=https://api.example.com/swagger.json # Choose authentication method AUTH_TYPE=basic # or: none, bearer, apiKey # For Basic Auth AUTH_USERNAME=your_username AUTH_PASSWORD=your_passwordBuild and run:
npm install npm run build npm start
Option B: MCP Settings Configuration (Recommended)
Configure directly in your MCP settings file:
For Claude Code (CLI): Create
.mcp.jsonat your project rootFor Claude Desktop: Edit settings via the app or
~/Library/Application Support/Claude/claude_desktop_config.json(macOS)For other MCP clients: Check their documentation for the correct config file location
Claude Code Configuration
For Claude Code CLI, create a .mcp.json file in your project root:
Create
.mcp.jsonwith your configuration:{ "mcpServers": { "swagger-docs": { "command": "node", "args": ["/absolute/path/to/swagger-docs-mcp/dist/index.js"], "env": { "SWAGGER_URL": "https://api.example.com/swagger.json", "AUTH_TYPE": "basic", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password" } } } }Replace
/absolute/path/to/swagger-docs-mcpwith the actual path to your MCP server installationImportant: Restart Claude Code for the configuration to take effect
Claude Desktop Configuration Examples
For Claude Desktop, configure via the app settings or edit the config file directly:
Example 1: Basic Authentication
{
"mcpServers": {
"swagger-docs": {
"command": "node",
"args": ["/absolute/path/to/swagger-docs-mcp/dist/index.js"],
"env": {
"SWAGGER_URL": "https://api.example.com/swagger.json",
"AUTH_TYPE": "basic",
"AUTH_USERNAME": "your_username",
"AUTH_PASSWORD": "your_password"
}
}
}
}Example 2: Bearer Token Authentication
{
"mcpServers": {
"swagger-docs": {
"command": "node",
"args": ["/absolute/path/to/swagger-docs-mcp/dist/index.js"],
"env": {
"SWAGGER_URL": "https://api.example.com/swagger.json",
"AUTH_TYPE": "bearer",
"AUTH_TOKEN": "your_bearer_token"
}
}
}
}Example 3: API Key Authentication
{
"mcpServers": {
"swagger-docs": {
"command": "node",
"args": ["/absolute/path/to/swagger-docs-mcp/dist/index.js"],
"env": {
"SWAGGER_URL": "https://api.example.com/swagger.json",
"AUTH_TYPE": "apiKey",
"API_KEY": "your_api_key",
"API_KEY_HEADER": "X-API-Key"
}
}
}
}Example 4: No Authentication
{
"mcpServers": {
"swagger-docs": {
"command": "node",
"args": ["/absolute/path/to/swagger-docs-mcp/dist/index.js"],
"env": {
"SWAGGER_URL": "https://api.example.com/swagger.json",
"AUTH_TYPE": "none"
}
}
}
}Configuration Options
Variable | Required | Description | Default |
| Yes | URL to your Swagger/OpenAPI documentation | - |
| No | Authentication method: |
|
| Conditional | Username for Basic Auth (required if | - |
| Conditional | Password for Basic Auth (required if | - |
| Conditional | Bearer token (required if | - |
| Conditional | API Key (required if | - |
| No | Header name for API Key |
|
| No | Cache duration in milliseconds |
|
Important Notes:
Replace
/absolute/path/to/swagger-docs-mcpwith the actual absolute path to your installationThe
SWAGGER_URLshould point to your Swagger/OpenAPI documentationSensitive credentials should be stored securely and never committed to version control
Usage
The MCP server provides the following tools:
1. Fetch Swagger Documentation
fetch_swagger({
url: "https://api.example.com/swagger.json"
})2. Get All Endpoints
get_endpoints({
tag: "users" // optional - filter by tag
})3. Search Endpoints
search_endpoints({
query: "user"
})4. Get Schema Definition
get_schema({
schemaName: "User"
})5. Get API Information
get_api_info({})6. Validate Swagger Document
validate_swagger({
url: "https://api.example.com/swagger.json"
})Development
# Run in development mode
npm run dev
# Build TypeScript
npm run build
# Start production server
npm startExample Usage with Claude
Configure the MCP server with your
SWAGGER_URLand authentication credentials in your MCP settings (.mcp.jsonfor Claude Code or Claude Desktop settings)Build the server if you haven't already:
npm install npm run buildRestart Claude Code/Desktop to load the MCP server
Start using the tools in Claude:
Claude: "Fetch the Swagger documentation from https://api.example.com/swagger.json" → Uses fetch_swagger({ url: "https://api.example.com/swagger.json" }) Claude: "Show me all the user-related endpoints" → Uses get_endpoints({ tag: "users" }) Claude: "Search for authentication endpoints" → Uses search_endpoints({ query: "auth" }) Claude: "Show me the User schema" → Uses get_schema({ schemaName: "User" }) Claude: "What's the API version and description?" → Uses get_api_info({})Work with the documentation - Claude can now answer questions about your API, help generate code that uses the endpoints, explain request/response formats, and more
Security Notes
Store sensitive credentials in environment variables
Never commit
.envfiles to version controlUse appropriate authentication method for your API
The cache TTL can be adjusted based on how frequently your API documentation changes
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
Turn any task into the right API calls: discover, evaluate, and integrate public APIs.
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.
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.149 npm2MIT
- FlicenseNot gradedqualityDmaintenanceTurns any OpenAPI/Swagger spec into queryable tools for LLMs, enabling endpoint search, detail retrieval, and schema exploration.1-
- FlicenseAqualityDmaintenanceDynamically fetches and exposes OpenAPI/Swagger documentation as tools for AI assistants, enabling them to explore and interact with any REST API.31-