
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@prodbybuddha/openapi-mcp-server
Advanced tools
Generic OpenAPI → MCP tool server with n8n integration and CLI utilities
Generic OpenAPI → MCP tool server with first‑class Docker, n8n & Hostinger integrations. It can:
This server empowers your agents to seamlessly control various backend systems and cloud infrastructure, including:
This means you can build powerful automation that spans your entire digital ecosystem, from frontends to backend services and cloud resources.
No credentials are stored; set env vars when running.
This project provides comprehensive documentation to help you get started and make the most of its features:
If you only have a docs page (Swagger UI, Redoc, Stoplight), use the discovery helper to extract the underlying OpenAPI URLs:
npm run discover:spec -- --url https://docs.example.com/reference.js swagger init bundles to extract url or urls entries.If this project helps you, consider supporting:
Programmatic-friendly wallet addresses are published in donate.json at the repo root as a destination for users, developers, and AI agents to support the cause:
0xe4fdf9076dca468d839b51f75af35983b898821b0x5f596473Dea9043B6338EF33a747CF0426EBcf92bc1qctmts3a2kmtfqskp0d5hrrew4gy9nhalu6mc4m2yUpjfwiQiv4pme1BSMLPpWgUcuWUMj6Q1KDetrPMc19addr1qyqn6zvqrhmx8h83eady5kk9ytfskrz4dgw6fcj32cxaetxyvpz05tv3rqhgc28qqpq5f9rvkvmpu60j43lfn4crcphs747ushSupporters can either read donate.json directly or run:
npm run donate:print
From npm (use inside your project):
npm install @prodbybuddha/openapi-mcp-serverOPENAPI_SPEC_URL='https://api.example.com/openapi.json' node node_modules/@prodbybuddha/openapi-mcp-server/examples/mcp-openapi-server.jsN8N_API_URL='https://your-n8n/api/v1' N8N_API_KEY='<key>' node node_modules/@prodbybuddha/openapi-mcp-server/examples/mcp-n8n-server.jsFrom source (clone/fork):
npm installOPENAPI_SPEC_URL='https://api.example.com/openapi.json' npm run mcp:openapiN8N_API_URL='https://your-n8n/api/v1' N8N_API_KEY='<key>' npm run mcp:n8nThe OpenAPI→MCP tool generator is bundled in this package and exposed via a subpath export. Use it programmatically or via the example CLI to pre‑generate tools JSON.
const { generateMcpTools } = require('@prodbybuddha/openapi-mcp-server/lib/openapi-generator');node examples/generate-openapi-mcp-tools.js --from-url <specUrl> --out examples/generated/n8n-openapi-tools.jsonThe server can also load OpenAPI specs dynamically on startup via env vars
(OPENAPI_SPEC_FILE or OPENAPI_SPEC_URL) without pre‑generation.
dotenvx CLI to load .env, .env.local, and Vault keys.
npx -y @dotenvx/dotenvx run -- node examples/mcp-multi-host.js --config services.dynamic.jsondotenv.config() internally to load .env if present.${VAR} sequences in services.*.specUrl, services.*.specFile, and services.*.baseUrl are expanded from process.env at runtime.specUrl, external $ref resolve relative to the URL. For specFile, they resolve relative to the file path.services.dynamic.json entry with placeholders:
{
"services": [
{
"name": "acme",
"type": "openapi",
"specUrl": "${ACME_SPEC_URL}",
"baseUrl": "${ACME_BASE_URL}",
"auth": { "kind": "bearer", "env": "ACME_TOKEN" }
}
]
}
Then set .env or exported envs: ACME_SPEC_URL, ACME_BASE_URL, ACME_TOKEN.If your OpenAPI defines custom security schemes or you want to override default behavior, pass securityHandlers to generateMcpTools:
const tools = await generateMcpTools(spec, {
baseUrl: 'https://api.example.com/v1',
securityHandlers: {
myApiKey: ({ def, headers, args }) => { headers[def.name] = process.env.MY_API_KEY; },
oauth2scheme: async ({ def, headers }) => { /* fetch token from vault and set headers.Authorization */ }
}
});
Each handler receives { def, headers, query, args }. Set headers/query as needed. Default handlers cover apiKey, http: bearer/basic, and oauth2: clientCredentials.
N8N_API_KEY='<key>' npm run mcp:gen -- --from-url https://your-n8n/api/v1/docs/swagger-ui-init.jsnpm run mcp:gen -- --from-file path/to/openapi.jsonnpm run mcp:tools:readme → writes examples/generated/TOOLS.mdFrom file:
OPENAPI_BASE_URL=https://api.example.com/v1 npm run mcp:gen:server -- --from-file path/to/openapi.json --generate-server ./generated-serverFrom URL:
OPENAPI_BASE_URL=https://api.example.com/v1 npm run mcp:gen:server -- --from-url https://api.example.com/openapi.json --generate-server ./generated-serverFilters (optional):
--include-tags billing,domains --exclude-ops opA,opB --include-text "widget|order"--include-tags-re tag1,tag2 --include-ops-re "^get.*" --include-paths-re "/v1/.*" (case-insensitive)TypeScript output (optional):
--ts true to generate a TS server with index.ts, tools.ts, http-client.ts, and tsconfig.jsonThe generated project includes a minimal HTTP client and tool handlers with input validation (Zod) and supports stdio transport via the entry index.
The server can load OpenAPI tools at startup via the bundled generator. Set one of:
OPENAPI_SPEC_FILE=./path/to/openapi.json npm run mcp:openapiOPENAPI_SPEC_URL=https://api.example.com/openapi.json npm run mcp:openapiOptionally override the base URL used by generated tools:
OPENAPI_BASE_URL=https://api.example.com/v1If neither env is set, the server will fall back to loading examples/generated/n8n-openapi-tools.json when present.
This repo also includes a generic OpenAPI→MCP server that can expose any OpenAPI 3.x API as MCP tools.
OPENAPI_SPEC_FILE=./openapi.json npm run mcp:openapiOPENAPI_SPEC_URL=https://api.example.com/openapi.json npm run mcp:openapiOPENAPI_BASE_URL=https://api.example.com/v1The multi‑host server can now load SOAP services from a WSDL and expose each operation as an MCP tool.
{
"services": [
{
"name": "irs-mef",
"type": "soap",
"wsdlUrl": "${IRS_WSDL_URL}",
"endpoint": "${IRS_ENDPOINT}"
}
]
}
{ "body": { /* request payload matching WSDL */ }, "headers": { /* optional HTTP headers */ } }.soap package to parse the WSDL and generate operations.This repo includes a first-class Hostinger MCP server that dynamically loads tools from the bundled Hostinger OpenAPI spec (examples/specs/hostinger-api.json) or a URL/file.
HOSTINGER_API_TOKEN=... npm run mcp:hostingerHOSTINGER_API_TOKEN=... npm run mcp:hostinger:once -- tools/list {}Env:
HOSTINGER_API_TOKEN (required): sets Authorization: Bearer <token>HOSTINGER_API_URL (optional): override base URL; defaults to spec servers[0].urlHOSTINGER_SPEC_FILE or HOSTINGER_SPEC_URL (optional): provide a custom OpenAPI specDEBUG_HTTP=1 to log summarized HTTP trafficHOSTINGER_USE_SDK=1 (optional): if the official Node/TypeScript SDK hostinger-api-sdk is installed, expose a few curated helpers (catalog list, domains list, availability) that use the SDK under the hood. Falls back to OpenAPI-generated tools when not set or SDK absent.HOSTINGER_PROFILE=curated (optional): show curated helpers first and, by default, hide raw OpenAPI tools. Combine with:
HOSTINGER_INCLUDE_RAW=1 to include raw tools alongside curated ones.HOSTINGER_ALLOW_RAW="name1,name2" to allowlist specific raw tool names when using the curated profile.Hardening (applies to generated tools):
OPENAPI_MCP_ALLOWED_METHODS (e.g., GET,POST)OPENAPI_MCP_ALLOWED_PATHS (e.g., /api/*)OPENAPI_MCP_RATE_LIMIT, OPENAPI_MCP_RATE_WINDOW_MSList catalog items (optional filters: category, name):
HOSTINGER_API_TOKEN=... node examples/mcp-hostinger-server.js --once billing_getCatalogItemListV1 '{"category":"vps"}'List domains (no args required):
HOSTINGER_API_TOKEN=... node examples/mcp-hostinger-server.js --once domains_getDomainListV1 '{}'Tip: Run npm run mcp:hostinger:once -- tools/list {} to see all tool names and input schemas. Many tools support optional query parameters; supply them in the JSON object as shown above.
hostinger-api-sdk)This project focuses on:
Guidance:
Auth helpers (optional, used to populate security handlers):
OPENAPI_API_KEY or scheme-specific OPENAPI_APIKEY_<SCHEMENAME>OPENAPI_BEARER_TOKENOPENAPI_BASIC_USER and OPENAPI_BASIC_PASSPolicy controls (optional):
OPENAPI_MCP_ALLOWED_METHODS (e.g., GET,POST)OPENAPI_MCP_ALLOWED_PATHS (e.g., /v1/users*,/v1/*)OPENAPI_MCP_RATE_LIMIT and OPENAPI_MCP_RATE_WINDOW_MSOPENAPI_MCP_LOG_FILE, OPENAPI_MCP_LOG_MAX_SIZE, OPENAPI_MCP_LOG_MAX_FILES, OPENAPI_MCP_LOG_FORMATFor both the generic server and generated servers, you can enable verbose HTTP logs when troubleshooting:
DEBUG_HTTP=1 — Prints outbound request headers and summarized responses. Also logs OAuth2 token exchanges (without secrets) during client credentials flow.See also: examples/README.md for script quickstarts.
npm run openapi:lint (defaults to examples/specs/hostinger-api.json)npm run openapi:lint:all — recursively lints all specs under specs/npm run openapi:lint:file -- ./path/to/openapi.jsonValidates structure (via swagger-parser if installed), checks duplicate/missing operationIds, presence of paths/servers.
examples/http-html-client.html in a browser./mcp.tools/list or tools/call payloads interactively.Example:
DEBUG_HTTP=1 OPENAPI_SPEC_FILE=./openapi.json npm run mcp:openapi
Set environment variables directly or via .env (see .env.example):
N8N_API_URL: Base API URL ending with /api/v1N8N_API_KEY: API key sent as X-N8N-API-KEYN8N_BEARER_TOKEN, N8N_BASIC_AUTH_USER/PASSN8N_API_URL=... N8N_API_KEY=... npm test
Validate specs structurally and then fuzz each operation with randomized, no-network dry runs. Catches missing params, bad path templates, enum/constraints issues early and reinforces the “no errors if the host spec is good” promise.
npm run openapi:spec-gate:allnode examples/scripts/spec-gate.js --file examples/specs/hostinger-api.json --runs 3node examples/scripts/spec-gate.js --file examples/specs/hostinger-api.json --runs 3 --include-tags Domains--include-ops domains_getDomainListV1,domains_getDomainDetailsV1--include-paths-re "/v1/domains/.*"SPEC_GATE_OPT_PROB=0.6 node examples/scripts/spec-gate.js --file ... --runs 3Convenience scripts:
npm run openapi:spec-gate:hostingernpm run openapi:spec-gate:domainsnpm run openapi:spec-gate:dnsnpm run openapi:spec-gate:vpsThe repo includes sample GitHub Actions workflows (in .github/workflows/):
CI: installs deps and runs tests. E2E runs only if repo secrets are configured.Update Generated MCP Tools: regenerates OpenAPI tools on a schedule or manual dispatch.For on‑prem CI with n8n workers, see docs/ONPREM-CI.md.
Tip: In your fork, set N8N_API_URL and N8N_API_KEY repository secrets to enable E2E in CI and auto‑update the generated tools.
npm run n8n:listnpm run n8n:export -- --id <id> --out backups/workflows/<name>.jsonnpm run n8n:update -- --id <id> --file backups/workflows/<name>.jsonEnvironment variables to restrict behavior:
N8N_MCP_ALLOWED_METHODS=GET,POST — Allowed HTTP methodsN8N_MCP_ALLOWED_PATHS=/workflows*,/executions* — Allowed path patternsN8N_MCP_RATE_LIMIT=120 N8N_MCP_RATE_WINDOW_MS=60000 — Basic rate limitingN8N_MCP_LOG_FILE=./logs/mcp-n8n.log.npmignore excludes local data and generated filesCreated by Billy Coleman III.
LICENSE and NOTICE for attribution guidance.This repo includes a workflow that regenerates the MCP tool registry from your n8n API’s OpenAPI spec and commits changes automatically.
${N8N_API_URL}/docs/swagger-ui-init.js, regenerates examples/generated/n8n-openapi-tools.json and examples/generated/TOOLS.md, validates load.You can restrict and rate-limit what the MCP server can call against your n8n API using environment variables:
N8N_MCP_DISABLE_GENERIC:
n8n.request tool entirely when set to 1/true.N8N_MCP_ALLOWED_METHODS:
GET,POST,PUT,PATCH,DELETE).N8N_MCP_ALLOWED_METHODS=GET,POST.N8N_MCP_ALLOWED_PATHS:
*) relative to N8N_API_URL base path.N8N_MCP_ALLOWED_PATHS=/workflows*,/executions* (allows workflows/executions)* (allow all paths under the configured API origin).N8N_MCP_RATE_LIMIT and N8N_MCP_RATE_WINDOW_MS:
60 calls per 60000 ms).N8N_MCP_RATE_LIMIT=30 N8N_MCP_RATE_WINDOW_MS=60000.These checks apply to all tools, including the OpenAPI-generated ones. Requests use the pinned origin from N8N_API_URL and do not accept arbitrary URLs.
Enable minimal, safe audit logs (method, path, status, duration; no bodies or headers):
N8N_MCP_LOG_FILE: path to a writable log file enables logging (e.g., ./logs/mcp-n8n.log).N8N_MCP_LOG_MAX_SIZE: rotate when file exceeds this many bytes (default: 1048576).N8N_MCP_LOG_MAX_FILES: keep at most N rotated files (default: 5).N8N_MCP_LOG_FORMAT: json (default) or tsv.Example:
N8N_MCP_LOG_FILE=./logs/mcp-n8n.log N8N_MCP_LOG_MAX_SIZE=1048576 N8N_MCP_LOG_MAX_FILES=7 npm run mcp:n8n
node examples/mcp-multi-host.js --config ./services.json{
"services": [
{ "name": "n8n", "type": "openapi", "specUrl": "https://your-n8n/api/v1/docs/swagger-ui-init.js", "baseUrl": "https://your-n8n/api/v1", "auth": { "kind": "header", "name": "X-N8N-API-KEY", "env": "N8N_API_KEY" } },
{ "name": "hostinger", "type": "openapi", "specFile": "./examples/specs/hostinger-api.json", "baseUrl": "https://developers.hostinger.com", "auth": { "kind": "bearer", "env": "HOSTINGER_API_TOKEN" } },
{ "name": "third", "type": "openapi", "specUrl": "https://api.example.com/openapi.json", "baseUrl": "https://api.example.com/v1", "auth": { "kind": "bearer", "env": "THIRD_TOKEN" } }
]
}
<service>.<toolName> to avoid collisions.examples/multi-host-README.mdexamples/services.example.jsonmcp.config.jsonspecs/ (place your own OpenAPI specs here and reference in configs)
node examples/scripts/generate-services-from-specs.js --out examples/services.generated.jsonnpm run services:mergenpm run services:regennode examples/scripts/merge-services.js --base examples/services.example.json --add examples/services.generated.json --out examples/services.merged.json --strategy report --report-out examples/services.conflicts.jsonnpm run services:reportnpm run services:lint:confignpm run services:regen:reportWraps Docker CLI and Docker Engine API with safety gates.
node examples/mcp-docker-server.jsdocker.ps, docker.images, docker.logsdocker.run (gated by DOCKER_ALLOW_RUN=1; optional DOCKER_ALLOWED_IMAGES allowlist)docker.stop, docker.rm, docker.exec (exec gated by DOCKER_ALLOW_RUN=1)docker.compose.up, docker.compose.downdocker.engine.request (calls Engine API via DOCKER_SOCK or DOCKER_API_HOST)Env:
DOCKER_BIN (default docker), DOCKER_COMPOSE_BIN (default docker)DOCKER_SOCK=/var/run/docker.sock or DOCKER_API_HOST=http://localhost:2375DOCKER_ALLOW_RUN=1, DOCKER_ALLOWED_IMAGES="nginx,redis"DEBUG_DOCKER=1 for command/API logsTip: Add the Docker Engine OpenAPI spec to multi-host config via specUrl: https://docs.docker.com/reference/api/engine/version/v1.51.yaml
FAQs
Generic OpenAPI → MCP tool server with n8n integration and CLI utilities
We found that @prodbybuddha/openapi-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.