OpenAPI Schema MCP server

Transforms OpenAPI specifications into YAML-formatted tools for exploring API paths, operations, parameters, schemas, and security definitions, enabling seamless API documentation navigation and understanding.
Back to servers
Provider
Hannes Junnila
Release date
Mar 15, 2025
Language
TypeScript
Package
Stats
647 downloads
31 stars

The OpenAPI Schema Model Context Protocol server creates an interface for Large Language Models like Claude to interact with OpenAPI specifications. It allows exploration of API endpoints, schemas, parameters, and more, providing a way for LLMs to understand and work with API documentation.

Installation and Setup

Basic Installation

The MCP server can be run directly using npx:

# Use the default openapi.yaml in current directory
npx -y mcp-openapi-schema

# Use a specific schema file (relative path)
npx -y mcp-openapi-schema ../petstore.json

# Use a specific schema file (absolute path)
npx -y mcp-openapi-schema /absolute/path/to/api-spec.yaml

# Show help
npx -y mcp-openapi-schema --help

Setting Up with Claude Desktop

To integrate with Claude Desktop, edit your configuration file located at:

  • macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: $env:AppData\Claude\claude_desktop_config.json

Add the following to your configuration:

{
  "mcpServers": {
    "OpenAPI Schema": {
      "command": "npx",
      "args": ["-y", "mcp-openapi-schema", "/ABSOLUTE/PATH/TO/openapi.yaml"]
    }
  }
}

Setting Up with Claude Code CLI

To integrate with Claude Code CLI:

# Add the MCP server with a basic configuration
claude mcp add openapi-schema npx -y mcp-openapi-schema

# Add with a specific schema file
claude mcp add petstore-api npx -y mcp-openapi-schema ~/Projects/petstore.yaml

Verify your configuration:

# List all configured servers
claude mcp list

# Get details for your OpenAPI schema server
claude mcp get openapi-schema

Remove the server if needed:

claude mcp remove openapi-schema

Using the MCP Server

The server provides several tools that Claude can use to interact with OpenAPI schemas:

Available Tools

  • list-endpoints: Shows all API paths and their HTTP methods with summaries
  • get-endpoint: Retrieves detailed information about a specific endpoint
  • get-request-body: Gets the request body schema for a specific endpoint and method
  • get-response-schema: Returns the response schema for a specific endpoint, method, and status code
  • get-path-parameters: Shows parameters for a specific path
  • list-components: Lists all schema components (schemas, responses, parameters, etc.)
  • get-component: Retrieves detailed definition for a specific component
  • list-security-schemes: Shows all available security schemes
  • get-examples: Provides examples for a specific component or endpoint
  • search-schema: Searches across paths, operations, and schemas

Example Queries

When interacting with Claude with this MCP server configured, you can ask questions like:

  • What endpoints are available in this API?
  • Show me the details for the POST /pets endpoint.
  • What parameters does the GET /pets/{petId} endpoint take?
  • What is the request body schema for creating a new pet?
  • What response will I get from the DELETE /pets/{petId} endpoint?
  • What schemas are defined in this API?
  • Show me the definition of the Pet schema.
  • What are the available security schemes for this API?
  • Are there any example responses for getting a pet by ID?
  • Search for anything related to "user" in this API.

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