home / mcp / swagger mcp server
Provides dynamic Swagger/OpenAPI session management with fast search and lightweight caching for API exploration.
Configuration
View docs{
"mcpServers": {
"alleyway-boop-swagger-mcp": {
"command": "node",
"args": [
"path/to/swagger-mcp/build/index.js"
],
"env": {
"PORT": "3000",
"NODE_ENV": "development",
"LOG_LEVEL": "info"
}
}
}
}Improved Swagger MCP is a high‑performance MCP server designed for exploring Swagger/OpenAPI definitions with dynamic session management, fast multi‑dimensional search, and lightweight memory usage. It lets you configure API sessions on the fly, search large APIs instantly, and monitor session health and resource use while keeping memory footprint small.
You use this MCP server by running it as a local process (stdio) or by integrating it with a client that communicates via standard MCP commands. Start a session to load a Swagger/OpenAPI definition, then search endpoints, inspect details, and manage caches. All actions are designed to be fast, memory-efficient, and isolated per session so different APIs or environments don’t interfere with each other.
Prerequisites: Node.js version 14 or higher and npm or yarn.
1. Clone the project and navigate into the repository.
git clone https://github.com/readingdancer/swagger-mcp.git
cd swagger-mcp2. Install dependencies.
npm install3. Create a configuration file based on the example.
cp .env.example .env4. Edit the configuration file to set your environment variables (port, environment, log level, etc.).
Configuration and startup details help you run and manage the Swagger MCP server effectively.
Starting the MCP server locally (stdio) requires running the built index file with Node. Use the final start command shown here to run the server.
node build/index.jsIf you prefer a path that mirrors the original project structure, you can also start with the explicit path to the built file.
node path/to/swagger-mcp/build/index.jsDynamically configure a Swagger session with on‑the‑fly settings, including swagger URLs, headers, and cache TTL.
Perform fast endpoint searches without loading the full Swagger document, supporting keywords, tags, patterns, and method filtering.
Fetch on‑demand detailed information for specific endpoints within a session.
Retrieve real‑time stats for a session and the system, including memory and cache status.
Manage and clear cached Swagger data to optimize memory usage.
Provide smart suggestions for searches and frequently accessed endpoints.
Download a Swagger definition from a given URL.
List all endpoints from a loaded Swagger definition.
List all models used by a specific endpoint.
Generate TypeScript code for a Swagger model.
Generate a complete MCP tool definition for an endpoint.