
christopherdond/mcp-generator
API developmentЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Wide MCP generator, easy and fast
Обзор
Generate MCP servers from OpenAPI specs. : @christopher_dondici/mcp-gen 2.3.7 is the latest published version on npm; 2.4.0 is prepared (publication pending). See release notes (PT-BR). mcp-gen turns an OpenAPI v3 or Swagger 2.0 spec into an MCP server in , , or . It maps each route to a tool, generates typed models (including enums, oneOf/anyOf), and keeps custom code when you regenerate. (Minor release — no breaking changes. Prepared, publication pending. Includes the unreleased 2.3.8 content.) - Inline oneOf/anyOf variants become synthetic union members with expanded properties instead of warnings; discriminator stays advisory-only. - Nested inline allOf members expand recursively; requestBody.$ref to schemas/* resolves as the body param (to parameters/* warns instead of dropping silently). - $ref parameters via components.parameters are resolved; unresolvable ones warn; pnpm-lock.yaml and bun.lock/bun.lockb are skipped by the credential scan. - Also: SDK 1.30.0 → 1.32.
README
Показан фрагмент оригинального README. Открыть оригинал.
MCP-Generator
Also available in: Português (Versão em Português)
Generate MCP servers from OpenAPI specs.
Status:
@christopher_dondici/mcp-gen2.3.7 is the latest published version on npm; 2.4.0 is prepared (publication pending). See release notes (PT-BR).
mcp-gen turns an OpenAPI v3 or Swagger 2.0 spec into an MCP server in TypeScript, Python, or Go. It maps each route to a tool, generates typed models (including enums, oneOf/anyOf), and keeps custom code when you regenerate.
What’s new in 2.4.0
(Minor release — no breaking changes. Prepared, publication pending. Includes the unreleased 2.3.8 content.)
- Inline
oneOf/anyOfvariants become synthetic union members with expanded properties instead of warnings;discriminatorstays advisory-only. - Nested inline
allOfmembers expand recursively;requestBody.$reftoschemas/*resolves as thebodyparam (toparameters/*warns instead of dropping silently). $refparameters viacomponents.parametersare resolved; unresolvable ones warn;pnpm-lock.yamlandbun.lock/bun.lockbare skipped by the credential scan.- Also: SDK 1.30.0 → 1.32.1,
proxy-addr→ 2.0.8,handlebars→ 4.7.10 (prod audit clean); streamed remote reads with 50MB cap; CI on Node 22 with pinnedubuntu-24.04; 4 Wave 1 lows. - Local verification: 19 Jest suites / 265 tests, CLI exit-code smoke 4/4, TypeScript/Python/Go generated-server smokes,
npm audit --omit=devclean.
What’s new in 2.3.7
What’s new in 2.5.0
(Minor release — no breaking changes.)
- Remote URL
watchretries transient fetch failures instead of dropping the polling cycle: network errors and408/425/429/500/502/503/504responses are retried with exponential backoff, while other4xxresponses fail immediately. - New
--retries(default2) and--retry-delay(default500) flags control the retry budget and the base backoff, which doubles on each attempt.--retries 0keeps the previous single-attempt behaviour. - Fetch failures now carry the HTTP status code, so callers can branch on it without parsing error messages.
- Local verification: 19 Jest suites / 272 tests, HTTPS retry smoke against a live TLS server (503, 503, 200 → success), lint + typecheck clean.
(Patch release — no breaking changes.)
- Tool names use the sanitized
operationIdwhen present, with fallback tomethod_path. allOfwith$refmerges referenced properties;requestBodyresolves viacomponents.requestBodies;traceis a supported method.security --jsonprints pure JSON on stdout for CI parsing;--pluginaccepts a directory or a module file.- URL
watchvalidates the URL, enforces a 30s timeout and content checks, and compares by SHA-256 hash. security-linthas fewer false positives (anchored base64 regex, lockfiles skipped, all specs scanned).- CI adds generated-Python smoke and production dependency audit.
Установка
npx tsc --noEmitКонфигурация
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["/absolute/path/to/my-server/dist/server.js"]
}
}
}