Swagger MCP Server
Provides tools for inspecting, searching, and navigating Swagger/OpenAPI 2.x and 3.x specifications. It can list API modules/tags, search endpoints by path, summary, description, operationId, or tags, retrieve full endpoint details, and fetch request/response schemas.
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 search the API for endpoints related to users"
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 (NestJS / TypeScript)
A production-ready Model Context Protocol (MCP) server built with NestJS and TypeScript to inspect, search, and navigate Swagger / OpenAPI 2.x and 3.x specifications via stdio.
π Project Structure
swagger-mcp/
βββ src/
β βββ config/
β β βββ swagger.config.ts # ConfigModule loader for Swagger settings & auth
β βββ services/
β β βββ swagger.service.ts # Fetching, caching, parsing OpenAPI schemas & operations
β βββ tools/
β β βββ swagger.tools.ts # MCP tools registration (list, search, details, schema)
β βββ app.module.ts # Root NestJS module wiring DI dependencies
β βββ main.ts # Application bootstrap & StdioServerTransport setup
βββ .env # Local environment variables
βββ .env.example # Example configuration template
βββ package.json # Scripts and dependencies
βββ tsconfig.json # TypeScript NodeNext ESM compiler optionsRelated MCP server: Swagger MCP
βοΈ Configuration (.env)
Configure your Swagger/OpenAPI target URL and credentials in .env:
SWAGGER_URL=https://api.example.com/api-json
SWAGGER_USERNAME=example
SWAGGER_PASSWORD=example
# Optional: Bearer token authentication (takes precedence over basic auth if provided)
# SWAGGER_TOKEN=your-bearer-token-hereπ οΈ MCP Tools Provided
Tool | Parameters | Description |
| None | Lists all API tags/modules, API title, and version. |
|
| Searches endpoints by path, summary, description, operationId, or tags. |
|
| Returns full endpoint documentation (parameters, request body, responses). |
|
| Returns request/response DTO schemas from |
π Getting Started
1. Install Dependencies
npm install2. Build TypeScript
npm run build3. Run the Server
# Production mode (dist/main.js)
npm start
# Development mode (with live tsx execution)
npm run start:devπ Connecting to MCP Clients
Add the server to your MCP client configuration (e.g., Claude Desktop, Cursor, Antigravity, or Cline):
Using NPX (Recommended - No installation required)
{
"mcpServers": {
"swagger-api-reference": {
"command": "npx",
"args": ["-y", "@tsiva18/swagger-mcp-server"],
"env": {
"SWAGGER_URL": "https://api.example.com/api-json",
"SWAGGER_USERNAME": "example",
"SWAGGER_PASSWORD": "example"
}
}
}
}Using Local Source
{
"mcpServers": {
"swagger-api-reference": {
"command": "node",
"args": ["c:/Users/Sivaram/Documents/swagger-mcp/dist/main.js"],
"env": {
"SWAGGER_URL": "https://api.example.com/api-json",
"SWAGGER_USERNAME": "example",
"SWAGGER_PASSWORD": "example"
}
}
}
}Note on Stdio Isolation: NestJS logs are directed strictly to
stderrthrough a customStderrLogger, guaranteeing thatstdoutremains reserved solely for clean MCP JSON-RPC protocol frames.
Available Tools
4 toolsget_api_detailsB
Get complete endpoint documentation including parameters, request body and responses.
Inputs: path (required), method (required).
get_api_schemaC
Get request or response DTO schema definitions by schema name.
Inputs: schemaName (required).
list_api_modulesB
List all API modules/tags in Swagger.
Inputs: no named parameters.
search_apiB
Search API endpoints by module, path, summary or operation ID.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 4 tools
Each tool targets a distinct stage of exploring a Swagger spec: listing modules, searching endpoints, retrieving endpoint details, and fetching DTO schemas. Search vs. get_api_details could superficially overlap, but the descriptions make clear one returns matches while the other returns full documentation for a specific endpoint.
All names use snake_case with verb-first phrasing (list_api_modules, search_api, get_api_details, get_api_schema), which is predictable. The minor deviation is search_api, which omits the noun suffix and breaks the verb_api_noun pattern used by the other three.
Four tools are appropriately lean for a read-only Swagger documentation server, with no redundant entries. It is on the thin sideβone more tool (e.g., listing endpoints within a module) would make the surface feel complete rather than minimal.
The core consumption workflowβdiscover modules, search endpoints, read full details, resolve schemasβis fully covered. Minor gaps remain: no way to enumerate all endpoints in a module without a search query, and no tool for global definitions or servers, but agents can work around these.
Maintenance
Related MCP Connectors
Remote MCP for 1,500+ APIs. Vault-managed credentials; OAuth or API key. Search, load, and execute.
MCP server for AI access to Swagger by SmartBear.
Find, document and execute authenticated API calls across 1000+ apps via one MCP server
Schema-aware API monitoring: diff OpenAPI specs for breaking changes, manage endpoints.
Related MCP Servers
- 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-
- AlicenseNot gradedqualityDmaintenanceLoads and queries OpenAPI/Swagger documents, providing tools to list APIs, get details, search endpoints, and manage schemas for efficient API exploration.4MIT
- AlicenseAqualityDmaintenanceParses Swagger 2.0 and OpenAPI 3.x specifications, exposing API endpoints, schemas, and authentication through MCP tools with local caching to reduce token usage.1115 npm1MIT
- AlicenseAqualityDmaintenanceA 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.997 npmMIT