# openapi [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/Docat0209/mcp-openapi  
**GitHub Stars:** 3  
**npm Downloads (last month):** 1438  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/openapi

## Description
Turn any OpenAPI/Swagger spec into MCP tools. Zero config, zero code.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "openapi": {
    "command": "npx",
    "args": ["-y","mcp-openapi"]
  }
}
```

## Documentation

## 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`:

```bash
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.

_Full upstream README: https://allmcps.com/mcp/openapi/readme_

