home / mcp / openapi mcp server

Openapi MCP Server

Provides an MCP server to explore OpenAPI specs by querying endpoints, parameters, request bodies, and response schemas.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "abumalick-openapi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@abumalick/openapi-mcp"
      ]
    }
  }
}

You can run an MCP server that lets you explore OpenAPI specifications with natural language. Load OpenAPI docs, ask about endpoints, parameters, request bodies, and response schemas, and get structured results as you chat with your agent.

How to use

Install the MCP server and run it alongside your preferred client. Connect your client to the local stdio server you configured, or to the HTTP endpoint if you choose a remote setup. You can then ask your language model to list loaded specs, inspect endpoints by tag, or fetch details for a specific operation. Use practical prompts like “What endpoints exist for pets?”, “Show me the details for GET /pet/{petId}”, or “Load the Petstore API spec” to begin querying your loaded specs.

How to install

Prerequisites: you need Node.js and npm installed on your system.

npm install -g @abumalick/openapi-mcp

Configuration and examples

You can preload OpenAPI specs at startup or load them on demand through your MCP client. The server supports two common local configurations and a workflow for adding specs at startup.

{
  "mcp": {
    "openapi": {
      "type": "local",
      "command": ["npx", "-y", "@abumalick/openapi-mcp"],
      "enabled": true
    }
  }
}

OpenCode integration

If you are using OpenCode, you can pre-load specs at startup by adding an mcp section that uses a local command to run the MCP server.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "openapi": {
      "type": "local",
      "command": ["npx", "-y", "@abumalick/openapi-mcp"],
      "enabled": true
    }
  }
}

OpenCode with multiple pre-loaded specs

You can preload multiple specs by extending the command with --spec entries.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "openapi": {
      "type": "local",
      "command": [
        "npx", "-y", "@abumalick/openapi-mcp",
        "--spec", "petstore=https://petstore3.swagger.io/api/v3/openapi.yaml",
        "--spec", "myapi=https://api.example.com/openapi.json"
      ],
      "enabled": true
    }
  }
}

Claude Desktop integration

For Claude Desktop, add an mcpServers entry that runs the MCP server via a local command.

{
  "mcpServers": {
    "openapi": {
      "command": "npx",
      "args": ["-y", "@abumalick/openapi-mcp"]
    }
  }
}

Claude Desktop with pre-loaded specs

Pre-load a spec by passing --spec in the arguments.

{
  "mcpServers": {
    "openapi": {
      "command": "npx",
      "args": [
        "-y", "@abumalick/openapi-mcp",
        "--spec", "petstore=https://petstore3.swagger.io/api/v3/openapi.yaml"
      ]
    }
  }
}

Workflow examples

With pre-loaded specs, you can immediately query them from your chat agent. For example, ask what specs are available, list endpoints for a tag, or fetch detailed information about a specific operation.

Troubleshooting and notes

OpenAPI versions supported include 3.0.x and 3.1.x. If you have Swagger 2.0 specs, convert them to OpenAPI 3.x format before loading.

Available tools

openapi_list_specs

Lists all currently loaded OpenAPI specs so you can see what is available.

openapi_load

Loads an OpenAPI spec from a URL or file path and assigns it an alias.

openapi_list_endpoints

Lists endpoints with optional filtering by alias, tag, or search term.

openapi_get_endpoint

Gets detailed information about a specific endpoint given alias, method, and path.

Openapi MCP Server - abumalick/openapi-mcp