Openapi logo

Openapi

Converts OpenAPI 3.x or Swagger 2.0 specs into callable MCP tools over stdio or SSE.

Install Openapi

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "openapi": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-openapi"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

npx -y mcp-openapi

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 11d ago.

Overview

The openapi MCP server converts OpenAPI 3.x and Swagger 2.0 specifications into MCP tools for REST API endpoints. It reads a remote URL or local file, derives tool names from operation IDs or HTTP paths, and flattens path, query, header, and body parameters. It can apply Bearer, API key, or OAuth2 client-credentials authentication, retry selected failures, and truncate large responses. Reach for it when an API already has a usable specification and you want an MCP client to call selected or all endpoints without writing tool definitions.

Use cases

  • Expose a documented REST API to an MCP-compatible assistant
  • Connect Claude Desktop to a public API specification
  • Filter generated tools to selected operation IDs
  • Route a documented API to a local or staging base URL
  • Add authentication to generated API tools

Key features

  • Supports OpenAPI 3.x and Swagger 2.0
  • Generates one MCP tool per API endpoint
  • Flattens path, query, header, and body parameters
  • Supports Bearer, API key, and OAuth2 client-credentials authentication
  • Retries 429 and 5xx responses with exponential backoff
  • Provides stdio and SSE transports

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

14/14 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 10d ago via OSV.dev · mcp-openapi (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
npm downloads1.4kPackage downloads in the last 30 days.
Last commit7mo agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Openapi works

What the openapi MCP server does

The openapi MCP server turns an OpenAPI 3.x or Swagger 2.0 document into a set of MCP tools. Each documented API endpoint becomes a callable tool. Tool names come from an endpoint's operationId, converted to snake case, or from its HTTP method and path when no operation ID is available.

It is intended for APIs that already publish a specification. The specification can be hosted at a URL or stored as a local JSON or YAML file. The generated tools let an MCP-compatible assistant make HTTP requests to the described API rather than requiring handwritten MCP wrappers.

How it works

At startup, the openapi MCP server parses and validates the selected specification, determines the API server URL, and registers endpoint tools through MCP. Tool inputs use one flat schema that combines path, query, header, and body parameters. This design avoids requiring the assistant to construct deeply nested parameter objects for common requests.

When an assistant calls a tool, the process builds and sends the corresponding HTTP request. Responses are limited to approximately 50 KB before being returned to the assistant. HTTP 429 and 5xx responses can be retried with exponential backoff, with three retries as the default maximum.

The default transport is stdio. An SSE transport is also available, with port 3000 as its default listening port.

Setup and configuration

Run it without a global installation through npx:

Terminal
npx mcp-openapi --spec https://petstore3.swagger.io/api/v3/openapi.json

The required --spec value accepts either a specification URL or a local path. You can use --base-url to send requests to a different API host, which is useful when a published document describes a development or staging deployment. --server selects a server entry from a specification by index, partial URL, or exact URL.

For Claude Desktop, add a server entry whose command is npx and whose arguments include mcp-openapi and the --spec option. A JSON config file can also replace command-line flags through --config.

Authentication options include Bearer tokens, API keys placed in a header or query parameter, and OAuth2 client credentials. Token and key values support $ENV_VAR syntax. Additional headers can be supplied repeatedly with --header.

Tools and capabilities

Supported controls include:

  • --include and --exclude to limit generated tools by operation ID
  • --prefix to add a namespace to every tool name
  • --timeout to change the 30-second default request timeout
  • --max-retries to set the retry limit for 429 and 5xx responses
  • --transport stdio or --transport sse to select the connection mode
  • --port to choose the SSE port
  • --dynamic-discovery for large APIs, enabled automatically for APIs with 100 or more operations
  • --no-doc-warnings to suppress specification quality warnings at startup

Limitations and notes

Generated coverage depends on what the OpenAPI or Swagger document describes. Endpoints that are absent, incomplete, or inaccurately documented cannot be exposed correctly. Large responses are truncated at about 50 KB, so the assistant may not receive the complete response body. Retry behavior is limited to HTTP 429 and 5xx responses and does not imply that every failed request is safe to repeat.

The project is licensed under MIT.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Openapi

openapi is an MCP server that connects OpenAPI 3.x or Swagger 2.0 specifications to AI assistants by exposing one MCP tool per REST endpoint. Its main capabilities include generated tool names, flattened parameters, Bearer/API-key/OAuth2 authentication, retries for selected errors, and response truncation over stdio or SSE.

Run it with `npx mcp-openapi --spec <url-or-path>`, so no separate installation is required. Provide a remote specification URL or local JSON/YAML path, then add the command and arguments to an MCP client configuration such as Claude Desktop.

It supports OpenAPI 3.x and Swagger 2.0 specifications. Pass the document URL or local file path with `--spec`; the server parses the document and generates tools from its documented endpoints.

Use the authentication flags for Bearer tokens, API keys, or OAuth2 client credentials. Bearer tokens use `--auth-type bearer` and `--auth-token`; API keys also require a name and header or query location; OAuth2 requires client credentials, a token URL, and optional scopes.

Yes. Add an `mcpServers` entry that runs `npx mcp-openapi` with `--spec` and the specification URL or path. Claude Desktop can then see the generated endpoint tools and call the corresponding REST API.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewOpenapi AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/openapi?style=directory)](https://allmcps.com/mcp/openapi)
HTML Embed
<a href="https://allmcps.com/mcp/openapi"><img src="https://allmcps.com/api/badge/openapi?style=directory" alt="Openapi on AllMCPs" /></a>