SuperAPIAI Directory

mcp-openapi-schema-explorer

github.com · AI developer platforms

mcp-openapi-schema-explorer is an MCP (Model Context Protocol) server that provides token-efficient access to OpenAPI (v3.0) and Swagger (v2.0) specifications through MCP Resource Templates. Its main goal is to enable MCP clients (such as Cline or Claude Desktop) to explore the structure and details of large OpenAPI specifications without loading the entire file into the LLM's context window. The project exposes various parts of the specification through MCP Resource Templates and provides a parameterized read-only data exploration access pattern. The server supports loading specifications from local file paths and remote HTTP/HTTPS URLs, and Swagger v2.0 specifications are automatically converted to OpenAPI v3.0 when loaded.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Purpose

mcp-openapi-schema-explorer is an MCP (Model Context Protocol) server used to provide token-efficient access to OpenAPI (v3.0) and Swagger (v2.0) specifications through MCP Resource Templates. Its core goal is to enable MCP clients (such as Cline or Claude Desktop) to explore the structure and details of large OpenAPI specifications without loading the entire specification file into the LLM context window.

Main Capabilities

  • Explore OpenAPI specifications through parameterized URI templates, such as openapi://info, openapi://paths/{path}/{method}, openapi://components/{type}/{name}.
  • Supports OpenAPI v3.0 and Swagger v2.0 formats, automatically converting v2.0 to v3.0 when loading.
  • Supports loading specifications from local file paths or HTTP/HTTPS URLs.
  • Token-efficient design for LLMs, reducing token consumption through structured access.
  • Supports multiple output formats: JSON (default), YAML, or minified JSON (configured via the --output-format parameter).
  • The server name in the MCP client reflects the info.title of the loaded specification.
  • Internal $ref references (#/components/...) are converted into clickable MCP URIs.

Usage

The server is run by MCP clients (such as Claude Desktop, Windsurf, Cline, etc.). To use it, add a configuration entry in the client settings file (usually a JSON file) specifying how the client should execute the server process (such as using npx, docker, or node). The server itself requires no additional configuration beyond the command-line arguments in the client configuration.

Method 1: npx (recommended)

Using npx avoids global or local installation and ensures the client uses the latest released version. Add a JSON object in the mcpServers section of the MCP client configuration file, replacing "My API Spec (npx)" with a unique name, and replacing <path-or-url-to-spec> with the local absolute path or full remote URL of the specification. --output-format is an optional parameter (json, yaml, json-minified), defaulting to json. To explore multiple specifications, add multiple entries in mcpServers, each with a unique name and pointing to a different specification.

Method 2: Docker

The official Docker image kadykov/mcp-openapi-schema-explorer can be used. Add a JSON object in the mcpServers section of the client configuration. When using a remote URL, pass the URL directly to docker run; when using a local file, the file needs to be mounted into the container, for example:

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

Using a local file:

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

Replace /full/host/path/to/spec.yaml with the correct absolute path on the host, and /spec/api.yaml with the corresponding path inside the container.

Method 3: Global installation (less commonly used)

After installing globally via npm install -g mcp-openapi-schema-explorer, the client can be configured to run it directly. Ensure the command is available in the PATH of the client's execution environment.

Method 4: Local development/installation

Run the following in sequence in the terminal:

git clone https://github.com/kadykov/mcp-openapi-schema-explorer.git
cd mcp-openapi-schema-explorer
npm install
npm run build

Then, in the client configuration, use node to run the locally built server, and you need to replace the path in the configuration with the absolute path of the built index.js in the cloned repository.

Available MCP resources

This server provides resource templates (rather than pre-enumerated resources). When using an MCP client: the client calls resources/templates/list to discover the available template patterns; the user constructs a concrete URI by filling in the template parameters (for example, replacing {path} with users%2F%7Bid%7D); the client uses resources/read to retrieve the actual content with the constructed URI. If resources/list is called (without "templates"), an empty list is returned, and this is expected behavior.

Some resource templates contain parameters ending with an asterisk (), such as {method} or {name*}, indicating that the parameter accepts multiple comma-separated values. For example, to request details for the GET and POST methods of a certain path, you can use openapi://paths/users/get,post.

Resource templates include:

  • openapi://{field}: access top-level fields of the OpenAPI document (such as info, servers, tags), or list the contents of paths or components. Example: openapi://info. Output: paths and components are text/plain lists; other fields are in the configured format (JSON/YAML/compressed JSON). Provides dynamic completion based on the top-level keys of the loaded specification.
  • openapi://paths/{path}: list the HTTP methods (operations) available for a specific API path. The parameter {path} is an API path string and must be URL-encoded (for example, /users/{id} becomes users%2F%7Bid%7D). Example: openapi://paths/users%2F%7Bid%7D. Output: a text/plain list of methods. Provides dynamic completion based on the paths in the loaded specification (URL-encoded).
  • openapi://paths/{path}/{method*}: retrieve the detailed specification of one or more operations (HTTP methods) on a specific API path. The parameter {path} must be URL-encoded; {method*} is one or more HTTP methods (such as get, post, get,post), case-insensitive. Example (single): openapi://paths/users%2F%7Bid%7D/get; example (multiple): openapi://paths/users%2F%7Bid%7D/get,post. Output: configured format (JSON/YAML/compressed JSON). Provides dynamic completion for {path} and static completion for {method*} (common HTTP verbs such as GET, POST, PUT, DELETE).
  • openapi://components/{type}: list the names of all defined components of a specific type (such as schemas, responses, parameters). The specific available types depend on the loaded specification. Also provide a brief description for each listed type. Example: openapi://components/schemas. Output: a text/plain list of component names and descriptions. Provides dynamic completion based on the component types in the loaded specification.
  • openapi://components/{type}/{name*}: retrieve the detailed specification of one or more named components of a specific type.

Applicable scenarios

Suitable for scenarios where you need to explore the structure and details of a large OpenAPI/Swagger specification while hoping to avoid loading the entire specification file into the LLM context window, used with MCP clients such as Cline, Claude Desktop, and Windsurf.

Limitations

This server provides resource templates, rather than pre-enumerated resources. If resources/list is called (without "templates"), an empty list is returned, and this is expected behavior. Other features, fees, prices, or platform information not explicitly described in the materials are not currently provided.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools