Swagger/OpenAPI Explorer MCP server

Loads and explores Swagger/OpenAPI specifications from URLs or files, providing endpoint discovery, documentation access, and natural language summaries for API integration workflows.
Back to servers
Setup instructions
Provider
gulbaki
Release date
Jun 17, 2025
Language
TypeScript
Stats
13 stars

This MCP server enables Large Language Models (LLMs) to explore and interact with Swagger/OpenAPI specifications, providing tools for loading API specifications, browsing endpoints, and retrieving detailed information about API operations.

Installation

To set up the Swagger/OpenAPI MCP server:

  1. Clone or create the project directory
  2. Install dependencies:
npm install
  1. Build the TypeScript code:
npm run build

Usage

Available Tools

The server provides several tools that LLMs can use to interact with API specifications:

load_api

This tool loads an OpenAPI/Swagger specification into the server.

Parameters:

  • apiId (string): Unique identifier for this API
  • source (string): URL or file path to the OpenAPI/Swagger specification

Example:

{
  "name": "load_api",
  "arguments": {
    "apiId": "petstore",
    "source": "https://petstore.swagger.io/v2/swagger.json"
  }
}

get_endpoint_details

Retrieves detailed information about a specific API endpoint.

Parameters:

  • apiId (string): ID of the loaded API
  • method (string): HTTP method (GET, POST, etc.)
  • path (string): API endpoint path
  • natural (boolean, optional): If true, returns a human-readable summary

Example:

{
  "name": "get_endpoint_details",
  "arguments": {
    "apiId": "petstore",
    "method": "GET",
    "path": "/pet/{petId}",
    "natural": true
  }
}

list_apis

Lists all currently loaded API specifications.

Parameters: None

search_endpoints

Searches for endpoints matching a specific pattern.

Parameters:

  • apiId (string): ID of the loaded API
  • pattern (string): Search pattern for endpoint paths or descriptions

Example:

{
  "name": "search_endpoints",
  "arguments": {
    "apiId": "petstore",
    "pattern": "pet"
  }
}

Available Resources

The server provides these resource endpoints:

swagger://{apiId}/load

Get overview information about a loaded API specification.

swagger://{apiId}/endpoints

Get a list of all available endpoints for an API.

swagger://{apiId}/endpoint/{method}/{path}

Get detailed information about a specific endpoint.

Configuration with Claude Desktop

To use this server with Claude Desktop, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "swagger-explorer": {
      "command": "node",
      "args": ["/path/to/your/swagger-mcp-server/build/index.js"]
    }
  }
}

Replace /path/to/your/swagger-mcp-server with the actual path to your project directory.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "swagger-explorer" '{"command":"node","args":["/path/to/your/swagger-mcp-server/build/index.js"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "swagger-explorer": {
            "command": "node",
            "args": [
                "/path/to/your/swagger-mcp-server/build/index.js"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "swagger-explorer": {
            "command": "node",
            "args": [
                "/path/to/your/swagger-mcp-server/build/index.js"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later