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.
You can use this server without explicit installation through one of these recommended methods:
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
).
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.
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": {}
}
}
}
Once configured in your MCP client, you can explore the API specification through these resource templates:
openapi://{field}
- Access top-level fields (info, servers, tags) or list paths/components
openapi://info
openapi://paths/{path}
- List available HTTP methods for a specific API path
openapi://paths/users%2F%7Bid%7D
(Note: paths must be URL-encoded)openapi://paths/{path}/{method*}
- Get details for operations on a path
openapi://paths/users%2F%7Bid%7D/get
openapi://paths/users%2F%7Bid%7D/get,post
openapi://components/{type}
- List components of a specific type
openapi://components/schemas
openapi://components/{type}/{name*}
- Get details for specific components
openapi://components/schemas/User
openapi://components/schemas/User,Order
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.
$ref
) into clickable MCP URIsThere 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 > 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"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.