OpenAPI MCP Server
raw JSON → 2.1.0 verified Sat Apr 25 auth: no javascript
An MCP (Model Context Protocol) server (v2.1.0) that enables AI assistants like Claude and Cursor to search and explore OpenAPI specifications through oapis.org. It follows a three-step process: identifying the needed OpenAPI identifier, fetching a plain-language summary, and examining specific endpoints. Unlike v1, v2 focuses purely on exploration and code generation without executing API calls, since authentication is not yet standardized in MCP. Supports JSON and YAML. Node.js >=18 required, ESM-only, published on npm.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/openapi-mcp-server/index.js not supported. ↓
cause Package is ESM-only since v2, but you used require().
fix
Change to
import OpenAPIMCPServer from 'openapi-mcp-server'. If you cannot use ESM, stay on v1.x. error TypeError: OpenAPIMCPServer is not a constructor ↓
cause Default import was used incorrectly or the module exports differently.
fix
Use
import OpenAPIMCPServer from 'openapi-mcp-server' (no curly braces). The default export is the class. Warnings
breaking V2 is a complete rewrite: no tool execution, no authentication handling. V1 APIs are removed. ↓
fix If you relied on v1's ability to call endpoints directly, do not upgrade. Stay on v1.x (e.g., `npm install openapi-mcp-server@1.2.0`).
deprecated V1.x is deprecated and no longer maintained. All development effort is on v2. ↓
fix Migrate to v2 if you only need exploration; otherwise consider alternative MCP servers that support API execution.
gotcha Package is ESM-only from v2. Using `require()` throws a runtime error. ↓
fix Use `import` statements. Ensure `"type": "module"` in your package.json.
gotcha Node.js 18+ is required. Older versions fail with SyntaxError or missing APIs. ↓
fix Update Node.js to 18 or newer (e.g., using nvm).
Install
npm install openapi-mcp-server yarn add openapi-mcp-server pnpm add openapi-mcp-server Imports
- OpenAPIMCPServer wrong
const OpenAPIMCPServer = require('openapi-mcp-server')correctimport OpenAPIMCPServer from 'openapi-mcp-server' - getOpenAPISummary
import { getOpenAPISummary } from 'openapi-mcp-server' - getEndpointDetails
import { getEndpointDetails } from 'openapi-mcp-server'
Quickstart
import OpenAPIMCPServer from 'openapi-mcp-server';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const server = new OpenAPIMCPServer();
const transport = new StdioServerTransport();
await server.connect(transport);
console.error('OpenAPI MCP Server running on stdio');