# OpenAPI Swagger MCP

> OpenAPI Swagger MCP is an open-source MCP server for developer tools. Local MCP server with 11 fixed tools for searching, previewing and calling OpenAPI APIs. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Repository:** https://github.com/nhan7777/openapi-swagger-mcp
- **MCP Registry name:** io.github.nhan7777/openapi-swagger-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

Instead of generating one tool per endpoint, this server keeps the tool list fixed at 11 however large the API is. The README argues that per-endpoint bridges fall apart on a 400-route backend, so the agent searches the spec, reads one operation's contract and then acts.

A typical session runs `list_apis` and `search_operations` to find an endpoint, `get_operation_schema` to read its parameters and auth, `preview_operation` for an offline dry run that reports `sent: false`, and `invoke_operation` to make the real HTTP call and check the response against the spec. A local Request Inspector web UI on 127.0.0.1 shows every tool call and HTTP exchange, with secrets masked by name.

It reads a YAML config listing each service's base URL and spec (a URL or a local file) and supports Swagger 2.0 and OpenAPI 3.0/3.1. The README warns that `invoke_operation` sends real POST, PUT, PATCH and DELETE requests, so it recommends pointing it at local, test or staging environments only. It runs locally over stdio with no telemetry.

## Features

- **Fixed 11-tool surface:** The tool count stays the same whether the API has 10 routes or 400.
- **Offline dry run:** `preview_operation` builds and validates a request without touching the network.
- **Real calls with checks:** `invoke_operation` sends the HTTP request and checks the response against the spec.
- **Local request inspector:** A read-only web UI on 127.0.0.1 shows tool calls, HTTP exchanges, auth runs and cURL export.
- **Config check and demo:** `--check` validates the config offline, and a `demo` command starts a mock backend.
- **Spec refresh:** `refresh_specs` reloads specs without a restart and keeps the last valid snapshot if reloading fails.

## Good for

- Let an agent find and call an endpoint in a large internal API
- Dry-run a request before sending it to a staging service
- Test an API with deliberately bad inputs and compare responses with the spec
- Audit what an agent actually sent using the local inspector

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add openapi-swagger-mcp -- npx -y @nhan7777/openapi-swagger-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

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

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

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

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "openapi-swagger-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@nhan7777/openapi-swagger-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add openapi-swagger-mcp -- npx -y @nhan7777/openapi-swagger-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.openapi-swagger-mcp]
command = "npx"
args = ["-y", "@nhan7777/openapi-swagger-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

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

Or run: gemini mcp add -s user openapi-swagger-mcp npx -- -y @nhan7777/openapi-swagger-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

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

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

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

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

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

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "openapi-swagger-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@nhan7777/openapi-swagger-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

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

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

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

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

From the tool list in its README, going by the names, 4 of 6 tools read data; 2 names don't say. From the server's own tool labels and tool names; not verified by us.

- `list_apis` (name suggests: reads): List configured services, spec readiness, revisions, warnings and Inspector status
- `search_operations` (name suggests: reads): Search endpoints by path, operationId, text, parameters or request and response fields
- `get_operation_schema` (name suggests: reads): Read the full contract for one operation: parameters, body, responses and auth
- `refresh_specs`: Reload OpenAPI specs without restarting the server
- `preview_operation` (name suggests: reads): Build and validate a request offline without sending it
- `invoke_operation`: Send the real HTTP request and check the response against the spec

## FAQ

### Which spec formats work?

Swagger 2.0 and OpenAPI 3.0 and 3.1.

### Is OpenAPI Swagger MCP safe to point at production?

The README recommends non-production environments only, because real POST, PUT, PATCH and DELETE calls have no undo.

### Does OpenAPI Swagger MCP send telemetry?

No. The README says it runs locally over stdio with zero telemetry, though any tool output your assistant reads goes to your model provider.

### What Node version is needed?

The demo requires Node.js 22.19 or newer.

### Is OpenAPI Swagger MCP free?

Yes. OpenAPI Swagger MCP is open source, so you can use and self-host it for free.

### How do I add OpenAPI Swagger MCP to Claude Code?

Run this command in your terminal: claude mcp add openapi-swagger-mcp -- npx -y @nhan7777/openapi-swagger-mcp

### What are the best alternatives to OpenAPI Swagger MCP?

The closest alternatives to OpenAPI Swagger MCP are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/openapi-swagger-mcp
