Installation
Requirements
- Node.js
>=20.11(declared inengines).
Install
npm install @powerduck/openapi-mcp-server
Yarn:
yarn add @powerduck/openapi-mcp-server
pnpm:
pnpm add @powerduck/openapi-mcp-server
CLI
The package registers the openapi-mcp binary.
# global install
npm install -g @powerduck/openapi-mcp-server
# or run without installing
npx openapi-mcp --help
The CLI has a single serve command (see Quickstart).
ESM / CommonJS
Dual builds with bundled type declarations. No extra @types/* are required:
// ESM
import { buildMcpServer, startStdioServer } from "@powerduck/openapi-mcp-server";
// CommonJS
const { buildMcpServer, startStdioServer } = require("@powerduck/openapi-mcp-server");
Subpath export
| Import | Contents |
|---|---|
@powerduck/openapi-mcp-server | Core library: spec loading, tool/prompt/resource generation, request execution, MCP server builder, stdio and HTTP transports. |
@powerduck/openapi-mcp-server/server | The admin HTTP server and auth middleware (startAdminServer, createAuthMiddleware). |
Dependencies
These are installed automatically with the package:
@modelcontextprotocol/sdk— MCP protocol implementation.@powerduck/openapi-parser— OpenAPI validation, dereferencing and upgrade.expressandcors— admin HTTP server and CORS.axios— upstream HTTP client for tool execution.commander— CLI framework.js-yaml— YAML parsing.multer— spec upload handling.terser— minification of embedded Web UI assets.
Verify
npx openapi-mcp --help