Skip to content

v2.10.0 — OpenAPI 3.2, Swagger 2.0 and security hardening

Latest

Choose a tag to compare

@github-actions github-actions released this 18 Nov 05:59
a7d82ed

The largest release since 2.0: OpenAPI 3.2 and Swagger 2.0 support, version-aware validation, multi-file documents, and a security hardening pass over loading, $ref fetching, schema conversion and request building. Some generated tools change shape; read Upgrading before you update.

✨ Highlights

Every current OpenAPI version, and Swagger 2.0. Swagger 2.0 is converted to OpenAPI 3.0 and goes through the same pipeline; OpenAPI 3.2 adds query and additionalOperations, in: querystring, style: cookie, content parameters, streamed responses (itemSchema) and $self. Validation follows the version the document declares.

import { OpenAPIToolGenerator } from 'mcp-from-openapi';

const generator = await OpenAPIToolGenerator.fromURL('https://api.example.com/openapi.yaml'); // 2.0, 3.0, 3.1 or 3.2
const tools = await generator.generateTools();
console.log(generator.getSpecVersion(), generator.getDiagnostics());

Multi-file documents. Relative $refs resolve against where the document came from (fromURL, fromFile, or LoadOptions.documentUri), references to the document's own URI resolve locally, and every fetch is bounded.

Nothing skipped in silence. What the generator ignores or cannot build is reported in getDiagnostics() with a code from DIAGNOSTIC_CODES and a JSON Pointer.

🔒 Security

  • The SSRF guard compares hosts, not spellings: blockedHosts matches an address however it is written (IPv4-mapped, NAT64, 6to4, decimal, a Unicode name), and allowedHosts admits exactly its own hosts.
  • Fetching $refs is bounded in documents, bytes, concurrency and time; local file references read only regular files up to 10 MiB.
  • The pinned HTTP transport settles on every response a server can send, so a hostile server can no longer hang a load or crash the process.
  • YAML alias graphs and shared objects that would expand without bound are refused, and schema conversion has a node budget per tool and per run.
  • A built request keeps the path its template names (no ., .., empty segment, backslash or second leading slash) and never adds or replaces a credential through a parameter or a name the input chooses.
  • Reference errors no longer reveal internal addresses, the working directory or URL credentials, and document text is escaped in every message.
  • Linear-time path globs, validation, lint, Arazzo and overlay handling for documents built to be slow.

🛠 Also in this release

  • Encoding Objects applied per field in form and multipart bodies; boolean schemas; response status ranges (2XX).
  • Security requirement alternatives stay a choice (metadata.securityAlternatives), and SecurityResolver applies exactly one.
  • A schema over maxSchemaNodes is cut shallower instead of failing its tool (SCHEMA_DEPTH_REDUCED).
  • Own OpenAPI types per version (OAS20, OAS30, OAS31, OAS32) and the operation walker (listOperations, resolveOperationLayout).

⚠️ Upgrading

Change Impact
validate() checks the field types generation reads, and header/cookie parameter names Some documents that passed now fail validation
An operation whose security cannot be satisfied makes no tool (UNSATISFIABLE_SECURITY) Fewer tools for such operations
readOnly properties are left out of inputs, writeOnly ones out of outputs Input and output schemas change
Client-set header parameters (Accept, Content-Type, Authorization, Host, X-Forwarded-*, ...) are not inputs Fewer inputs (PARAMETER_IGNORED)
Several responses join with anyOf (was oneOf); a non-status response key is ignored Output schema changes
In 3.1+ a $ref applies together with the keywords beside it Stricter schemas where siblings were dropped
An open object body (additionalProperties not false) is one body input Body inputs change
Path-level servers are honoured Requests may go to another server
allowedHosts matches exactly; buildHttpRequest refuses dot-segment and empty path values Some calls now fail with SsrfError / RequestBuildError
Default maxSchemaNodes is 25,000 (was 100,000) Large schemas are cut shallower

Every change to existing output, with before and after: Changes to existing output.

Full change list

Features

  • feat(spec): own OpenAPI 3.0/3.1/3.2 types written from the official schemas
  • feat(spec): version registry, operation walker and diagnostics
  • feat: version-aware validation and OpenAPI 3.2 query and additional operations
  • feat: OpenAPI 3.2 parameters, cookie style, response streams and parameter content
  • feat: base URI for references, self-references resolved locally and OpenAPI 3.2 $self
  • feat(spec): Swagger 2.0 reader types and a bounded conversion to OpenAPI 3.0
  • feat(request-builder): per-field Encoding Objects, and allowReserved or deepObject input can no longer add or replace a query pair
  • feat: Swagger 2.0 through the pipeline, boolean schemas, status ranges and review fixes

Fixes

  • fix: keep $refs inside schema extensions as written, and cut a schema over maxSchemaNodes shallower instead of dropping the tool
  • fix: Arazzo workflow schemas are cut shallower too, and the default maxSchemaNodes is 25,000
  • fix: never roots in type signatures, nullable wrappers around never, oversize 2.0 lint, additionalItems and reads settled before a failed load rejects
  • fix: query credentials in the Swagger 2.0 example, untruncated index-signature keys in the type differential and an order-independent story test
  • fix: responses join with anyOf, response keys are status codes, status metadata comes from the responses, and trimming never refuses what the document accepts
  • fix: alternative security requirements stay a choice, and a scheme map that is not a map defines no scheme
  • fix: a security scheme the library cannot send drops its requirement, and SecurityResolver applies each credential only where it belongs
  • fix: document keys are never read or written through the prototype, the builder fails only with RequestBuildError, and lint and loaders escape document text
  • fix: validate() checks the types generation reads, only a string $ref is a reference, and invisible characters are escaped
  • fix: tool building reads fields by their type, keeps its own annotations, honours path-item servers, and reports a path item left as a reference
  • fix: flattened bodies keep every allOf constraint, bodies with unflattenable constraints stay whole, and readOnly and writeOnly properties are left out
  • fix: a 3.1 schema $ref applies with the keywords beside it, cuts and cycles never refuse what the document accepts, and open object bodies stay whole
  • fix: a path parameter the template lacks is no input, a required body is sent empty, and an unreadable reference is located in a 3.1 document
  • fix: one alternative is signed and sent, a missing client certificate is reported, and an allOf fallback keeps its annotations
  • fix: address review comments across the hardening stack
  • fix: a dist-tag never moves back, the $ref walk reads every named map and appends to allOf, and signing follows resolve
  • fix: every candidate dist-tag is checked, certificate alternatives keep their credentials, cuts add no node, and signing without a choice reads no credential

Security

  • fix: refuse YAML alias graphs and shared objects that a copy would expand without bound
  • fix: the pinned transport settles on every response a server can send
  • fix: bound schema conversion per tool and across a run, and read bad limit options as defaults
  • fix: a request path keeps the resource its template names and starts with one slash
  • fix: overlay updates are copied per target, includeOperations is an allow-list, $ref reads are bounded, scopes merge in linear time
  • fix: one dereference placeholder per target, a linear relative-reference search, and a diagnostic for every operation that makes no tool
  • fix: unique input keys, no parameter for a credential or a client-set header, canonical path filters, readOnlyOnly by method
  • fix: linear path globs, address-aware blockedHosts, and reference errors that name no address, directory or credential
  • fix: file references read only bounded regular files, a type list renders each case once, validate() and lint() stay linear, long method keys are cut
  • fix: bounded Arazzo inputs, outputs and name dedup, linear overlay descent, case-insensitive excludeMethods, reserved names as servers read them

Release

  • ci: pin actions and npm, test before publishing, keep inputs out of scripts, and narrow what the release jobs run
  • ci: release through a reviewed release pull request, and publish with OIDC from a job that runs nothing else
  • ci: a push never cancels a pending release run, and release branch creation has its own environment
  • ci: dist-tags are read once, by exact name, and a failed registry request stops the publish
  • ci: the release summary reports the dist-tag the publish used
  • ci: test on Node 26 (Active LTS)

Installation

npm install mcp-from-openapi@2.10.0

Release line: 2.10.x · Branch: release/2.10.x · Type: stable