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.
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.
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": {}
}
}
}
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": {}
}
}
}
Once configured in your MCP client, you can explore OpenAPI specifications through various resource templates:
Access top-level fields of the OpenAPI document:
openapi://{field}
Example: openapi://info
List available HTTP methods for a specific API path:
openapi://paths/{path}
Example: openapi://paths/users%2F%7Bid%7D
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
List all defined components of a specific type:
openapi://components/{type}
Example: openapi://components/schemas
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
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 JSONyaml
: YAML formatjson-minified
: Minified JSON for more compact representationSpecification Source: You can provide either:
The server automatically converts Swagger v2.0 specifications to OpenAPI v3.0 format when loading.
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.
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.
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": []
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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