OpenAPI Schema Explorer MCP server

Provides token-efficient access to OpenAPI and Swagger specifications through URI-based references, allowing exploration of API structures without loading entire specs into context windows.
Back to servers
Setup instructions
Provider
Aleksandr Kadykov
Release date
Apr 09, 2025
Language
TypeScript
Package
Stats
4.9K downloads
47 stars

The MCP OpenAPI Schema Explorer provides token-efficient access to OpenAPI (v3.0) and Swagger (v2.0) specifications through MCP Resources. This server allows MCP clients like Claude Desktop to explore large API specifications without loading the entire file into the LLM's context window.

Installation Options

Using npx (Recommended)

The simplest way to use the MCP OpenAPI Schema Explorer is through npx, which requires no separate installation:

{
  "mcpServers": {
    "My API Spec (npx)": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-openapi-schema-explorer@latest",
        "<path-or-url-to-spec>",
        "--output-format",
        "yaml"
      ],
      "env": {}
    }
  }
}

Replace <path-or-url-to-spec> with your specification file path or URL.

Using Docker

You can run the server using the official Docker image:

For remote URL specifications:

{
  "mcpServers": {
    "My API Spec (Docker Remote)": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "kadykov/mcp-openapi-schema-explorer:latest",
        "<remote-url-to-spec>"
      ],
      "env": {}
    }
  }
}

For local file specifications:

{
  "mcpServers": {
    "My API Spec (Docker Local)": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "/full/host/path/to/spec.yaml:/spec/api.yaml",
        "kadykov/mcp-openapi-schema-explorer:latest",
        "/spec/api.yaml",
        "--output-format",
        "yaml"
      ],
      "env": {}
    }
  }
}

Global Installation

If you prefer global installation:

npm install -g mcp-openapi-schema-explorer

Then configure your MCP client:

{
  "mcpServers": {
    "My API Spec (Global)": {
      "command": "mcp-openapi-schema-explorer",
      "args": ["<path-or-url-to-spec>", "--output-format", "yaml"],
      "env": {}
    }
  }
}

Using the MCP Server

Once configured in your MCP client, you can explore OpenAPI specifications through various resource templates:

Available MCP Resources

Top-level Access

Access top-level fields of the OpenAPI document:

openapi://{field}

Example: openapi://info

Path Exploration

List available HTTP methods for a specific API path:

openapi://paths/{path}

Example: openapi://paths/users%2F%7Bid%7D

Method Details

Get detailed specifications for operations on a specific path:

openapi://paths/{path}/{method*}

Example: openapi://paths/users%2F%7Bid%7D/get

You can request multiple methods with comma separation:

openapi://paths/users%2F%7Bid%7D/get,post

Component Type Listing

List all defined components of a specific type:

openapi://components/{type}

Example: openapi://components/schemas

Component Details

Get detailed specifications for specific components:

openapi://components/{type}/{name*}

Example: openapi://components/schemas/User

You can request multiple components with comma separation:

openapi://components/schemas/User,Order

Configuration Options

When setting up the server, you can use these options:

  • Output Format: Use --output-format to specify the format of the returned data:

    • json (default): Pretty-printed JSON
    • yaml: YAML format
    • json-minified: Minified JSON for more compact representation
  • Specification Source: You can provide either:

    • A local file path to an OpenAPI/Swagger specification
    • A remote HTTP/HTTPS URL to an OpenAPI/Swagger specification

The server automatically converts Swagger v2.0 specifications to OpenAPI v3.0 format when loading.

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 "mcp-openapi-schema-explorer" '{"command":"npx","args":["-y","mcp-openapi-schema-explorer@latest","<path-or-url-to-spec>","--output-format","yaml"],"env":[]}'

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": {
        "mcp-openapi-schema-explorer": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-openapi-schema-explorer@latest",
                "<path-or-url-to-spec>",
                "--output-format",
                "yaml"
            ],
            "env": []
        }
    }
}

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": {
        "mcp-openapi-schema-explorer": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-openapi-schema-explorer@latest",
                "<path-or-url-to-spec>",
                "--output-format",
                "yaml"
            ],
            "env": []
        }
    }
}

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