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
Provider
Aleksandr Kadykov
Release date
Apr 09, 2025
Language
TypeScript
Package
Stats
1.2K downloads
13 stars

The MCP OpenAPI Schema Explorer is a specialized server that provides token-efficient access to OpenAPI and Swagger specifications through MCP Resources. It allows MCP clients like Claude Desktop or Cline to explore API structures without loading entire specifications into their context windows.

Installation and Setup

You can use this server without explicit installation through one of these recommended methods:

Using npx (Recommended)

Add this configuration to your MCP client's settings file:

{
  "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 either a local file path or a remote URL to your API specification. The --output-format parameter is optional (options: json, yaml, json-minified).

Using Docker

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": {}
    }
  }
}

Make sure to replace /full/host/path/to/spec.yaml with the absolute path to your specification file.

Global Installation (Alternative)

If preferred, you can install globally:

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 the API specification through these resource templates:

Available Resource Templates

  • openapi://{field} - Access top-level fields (info, servers, tags) or list paths/components

    • Example: openapi://info
  • openapi://paths/{path} - List available HTTP methods for a specific API path

    • Example: openapi://paths/users%2F%7Bid%7D (Note: paths must be URL-encoded)
  • openapi://paths/{path}/{method*} - Get details for operations on a path

    • Example: openapi://paths/users%2F%7Bid%7D/get
    • Multiple methods: openapi://paths/users%2F%7Bid%7D/get,post
  • openapi://components/{type} - List components of a specific type

    • Example: openapi://components/schemas
  • openapi://components/{type}/{name*} - Get details for specific components

    • Example: openapi://components/schemas/User
    • Multiple components: openapi://components/schemas/User,Order

Multi-Value Parameters

Parameters marked with an asterisk (*) like {method*} or {name*} accept multiple comma-separated values, allowing you to fetch details for multiple items in a single request.

Features

  • Supports both OpenAPI v3.0 and Swagger v2.0 specifications (auto-converts v2.0 to v3.0)
  • Loads specifications from local file paths or remote HTTP/HTTPS URLs
  • Provides token-efficient exploration via MCP Resources
  • Supports multiple output formats: JSON (default), YAML, or minified JSON
  • Transforms internal references ($ref) into clickable MCP URIs
  • Server name in MCP clients reflects the API title from the loaded specification

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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