swagger-api-mcp-server
Parses Swagger 2.0 and OpenAPI 3.x specifications, exposing API structure through MCP tools for browsing, searching, and calling APIs defined by the spec.
Click on "Install 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-api-mcp-serverload the Petstore API spec and list all endpoints"
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 API MCP Server
An MCP (Model Context Protocol) server that parses Swagger 2.0 and OpenAPI 3.x specifications, exposing API structure through MCP tools. Features a local file-cache architecture that reduces token usage by 85-95% compared to inline responses.
Features
Swagger 2.0 & OpenAPI 3.x — Full dual-format support
Smart Caching — Spec parsed once, stored as local JSON files; tools return compact summaries + file paths (~200 chars vs 5-20KB)
11 MCP Tools — Load, browse, search, call APIs, and manage auth dynamically
3 MCP Prompts — Guided workflows for exploring, searching, and integrating APIs
3 MCP Resources — Direct access to cached API info, endpoints, and schemas
Two Transport Modes — stdio (for CLI/IDE integration) and HTTP (for multi-session web use)
2-Phase API Calls — Preview requests before executing them
Zero External Parsers — Custom
$refresolver with circular reference protection
Related MCP server: Swagger to MCP
Prerequisites
Node.js >= 24
Quick Start
Install from npm
npm install -g swagger-api-mcp-serverOr clone and build
git clone https://github.com/NekoTarou/swagger-api-mcp-server.git
cd swagger-api-mcp-server
npm install
npm run buildRun
# stdio mode (default) — for MCP clients like Claude Desktop
npm start
# Auto-load a spec on startup
SWAGGER_URL=https://petstore.swagger.io/v2/swagger.json npm start
# HTTP mode — multi-session with Express
npm run start:httpMCP Client Configuration
Claude Desktop
Add to your Claude Desktop config file (claude_desktop_config.json):
{
"mcpServers": {
"swagger-api": {
"command": "npx",
"args": ["-y", "swagger-api-mcp-server"],
"env": {
"SWAGGER_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}Cursor / VS Code
Add to your MCP settings:
{
"mcpServers": {
"swagger-api": {
"command": "npx",
"args": ["-y", "swagger-api-mcp-server"],
"env": {
"SWAGGER_URL": "https://your-api.example.com/openapi.json"
}
}
}
}Tools
Tool | Description |
| Load a Swagger/OpenAPI spec from URL, parse and cache it |
| Re-fetch spec and rebuild cache |
| Get API metadata (title, version, servers, auth schemes) |
| List all tags with endpoint counts |
| List endpoints with filtering (tag, method, keyword) and pagination |
| Get endpoint summary + cached file path for full details |
| List schema definitions with filtering and pagination |
| Get schema summary + cached file path for full definition |
| Search across endpoints and schemas by keyword |
| Execute HTTP requests with 2-phase confirmation |
| Dynamically set or clear the Authorization header at runtime |
Prompts
Prompt | Arguments | Description |
|
| Guided workflow to load and fully explore an API spec |
|
| Search for endpoints by keyword and view full details |
|
| Find the right endpoint for a task and execute an API call |
Resources
Resource | URI | Description |
|
| API basic information (title, version, servers, auth) |
|
| Index of all API endpoints |
|
| Index of all schema/model definitions |
Cache Architecture
When a spec is loaded, it's parsed once and stored as structured JSON files:
.swagger-cache/
├── meta.json # Cache metadata (URL, counts, timestamp)
├── info.json # Full API info (title, servers, auth)
├── tags.json # Tag list with endpoint counts
├── paths-index.json # Endpoint index for fast lookup
├── schemas-index.json # Schema index for fast lookup
├── endpoints/ # One file per endpoint (deep-resolved)
│ └── GET__users__{id}.json
└── schemas/ # One file per schema (deep-resolved)
└── User.jsonTools return brief summaries with file paths. The LLM reads full details on demand via the Read tool — saving 85-95% of tokens per call.
Environment Variables
Variable | Default | Description |
| (empty) | Auto-load spec on startup |
|
| Transport mode: |
|
| HTTP server port |
|
| HTTP server host |
| (empty) | Override API base URL for calls |
| (empty) | Initial Authorization header value (can be updated at runtime via |
|
| Custom cache directory path |
|
| HTTP session timeout (30 min) |
|
| Max concurrent HTTP sessions |
Development
npm run dev # Dev mode with auto-reload (tsx watch)
npm test # Run tests
npm run build # TypeScript compilation → dist/
npm run clean # Remove dist/License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -license-quality-maintenanceDynamically generates MCP tools from Swagger/OpenAPI specifications by extracting swagger.json files at runtime. Enables natural language interaction with any REST API that has Swagger documentation.Last updated
- Alicense-quality-maintenanceAutomatically converts Swagger/OpenAPI specifications into dynamic MCP tools, enabling interaction with any REST API through natural language by loading specs from local files or URLs.Last updated
- Alicense-qualityBmaintenanceExposes OpenAPI specifications as MCP tools, enabling AI assistants to explore and understand API structures, endpoints, schemas, and documentation through semantic queries.Last updated24MIT
- AlicenseAqualityBmaintenanceA read-only MCP server for navigating OpenAPI / Swagger specifications, enabling agents to search endpoints, retrieve parameters and schemas, and inspect authentication without loading the full spec into context.Last updated916MIT
Related MCP Connectors
APIs.guru MCP — keyless directory of 2,500+ public APIs and their OpenAPI specs.
34 production API tools over one hosted MCP endpoint.
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NekoTarou/swagger-api-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server