Repository navigation
Description
Summary
mcp_openapi currently only supports kind: client: the generated mcp_http0 route's exit is always sourced from the JVM-wide zilla.binding.mcp.openapi.http.client.exit Configuration property (default sys:http_client), never overridable per binding instance. Add a kind: proxy variant that instead lets the operator declare exit directly on the binding, so the generated composite can terminate at an operator-provided binding instead of the configured default.
Motivation
#2104 added exactly this for binding-mcp-schema-registry's own kind: proxy, and in the course of that work (#2231) McpOpenapiCompositeGenerator/McpOpenapiBindingConfig were changed so that McpOpenapiCompositeGenerator now prefers a binding-level exit (read off mcp_openapi0's own routes) over the httpClientExit Configuration default when stamping mcp_http0's routes. That was necessary because mcp_openapi0 is generated in-memory by schema-registry's composite generator, not authored by an end user — but the same data channel means the underlying mechanism already works for mcp_openapi itself, it's just not exposed at the schema level (kind is still restricted to ["client"], and exit isn't a validated/required option for any kind).
A follow-up fix (already merged into #2231) closed the immediate gap by adding "exit": false to mcp_openapi's kind: client schema branch, since an authored exit: would otherwise have silently taken effect. This issue is about the other half: formally supporting kind: proxy so users get this directly, without needing to go through mcp_schema_registry (or another generator) as an intermediary.
Design
kind: proxyrequiresexit(top-level or per-route, mirroringbinding-tcp'skind: serverpattern) instead of leaving it disallowed.kind: clientkeeps disallowingexit, as already patched.options.specs.<label>.serveris untouched by this — it stays available for both kinds. Traced throughMcpOpenapiCompositeGenerator:options.specs.*.server(or the OpenAPI document's ownservers:entry as fallback) only shapes the:scheme/:authority/base:pathheaders baked into each route'sHttpBeginEx(withConfig()→resolveServerOverride/resolveServerFromSpec);exitonly controls which binding receives that stream (injectRoutes()). The two are orthogonal — unlikebinding-mcp-schema-registry, whereoptions.serverwas the only server config for a single bundled spec and became genuinely vestigial onceexittook over,mcp_openapican have multiple specs with meaningful per-specservervalues (shaping headers) all routed through the samekind: proxyexit. So no change tooptions.specs.*.servervalidation is needed.- Mechanically, no generator changes are needed —
McpOpenapiBindingConfig.exitandMcpOpenapiCompositeGenerator's preference for it already exist (from binding-mcp-schema-registry: add kind: proxy variant with operator-declared exit #2231). This is purely a schema patch change (specs/binding-mcp-openapi.spec/.../mcp_openapi.schema.patch.json): widenkindto["client", "proxy"], moveexit: falseinto aclient-only branch, add aproxybranch requiringexit.
Notes
- Independent of
kind: client— no runtime behavior change for existing users. - Should include a new IT (or extend
McpOpenapiClientIT's sibling coverage) exercisingkind: proxyend-to-end, analogous toMcpSchemaRegistryProxyITadded in binding-mcp-schema-registry: add kind: proxy variant with operator-declared exit #2231.
Activity
feat(binding-mcp-openapi): add kind: proxy variant with operator-decl…
binding-mcp-openapi: add kind: proxy variant with operator-declared e…