Repository navigation
Closed
Copy link
Description
Summary
mcp_schema_registry currently only supports kind: client (see #2068): self-contained, with options.server (a real HTTP base URL) baked into the generated composite and no operator-facing exit. Add a kind: proxy variant that instead exposes an operator-declared exit, letting the generated composite terminate at an operator-provided binding instead of a real HTTP server.
Motivation
This lets mcp_schema_registry compose naturally with something like a virtual schema-registry binding (e.g. in zilla-plus) that implements the Schema Registry semantics locally/against Kafka rather than proxying to a real REST endpoint — without needing any raw-byte protocol translation layer.
Design
kind: proxyexposesexit(operator-declared, naming a downstream binding in the same namespace) instead ofoptions.server.- That exit gets fed down into the generated composite's
mcp_http0.route.exit, replacing whatevermcp_openapi's own generator would otherwise wire up by default (currently sourced from thezilla.binding.mcp.openapi.http.client.exitConfiguration property — a JVM-wide default, not overridable per composite instance today). - Mechanically: whichever generator constructs the inner
mcp_http0binding (todaymcp_openapi's own composite generator, invoked bymcp_schema_registry) needs to accept an explicit exit override as a plain parameter, rather than relying on that global Configuration property. No config-level change tobinding-mcp-openapiis needed for this — the exit is just an ordinary value the generator writes into the route it builds. - The consuming binding at that exit only needs to speak the same
http-typed stream contract as anyhttp kind:serverconsumer —mcp_http's downstream stream already carries a fully-formedHttpBeginEx(:method/:scheme/:authority/:path/content-typeheaders), confirmed via direct engine tracing while debugging binding-mcp-schema-registry: composite mcp_schema_registry · client binding #2068's k3po fixtures.
Notes
- Independent of and does not require touching the
kind: clientimplementation in binding-mcp-schema-registry: composite mcp_schema_registry · client binding #2068. - Independent of binding-mcp-openapi: support operator-declared guarded routes independent of OpenAPI security schemes #2103 (guarded routes) and the
when.toolrouting follow-up — no shared code paths.
Activity
jfallows commentedon Jul 31, 2026
Handoff: mechanism this issue's Design section assumed has changed
#2242 (fixing the analogous #2237 for
binding-mcp-openapi) landed a different — and better — mechanism than what this issue's Design section describes. Before starting implementation here, read this so the schema-registry work uses the current pattern rather than the now-superseded one.What changed
binding-mcp-openapinow supportskind: client/kind: proxyitself (thezilla.binding.mcp.openapi.http.client.exitConfiguration property this issue's Design section references no longer exists — it was removed as redundant oncebinding-mcp-httpgained its ownkind: clientwithzilla.binding.mcp.http.client.exit, binding-mcp-http: add kind: client (implicit sys:http_client exit) and require exit for kind: proxy #2238/binding-mcp-http: add kind: client and require exit for kind: proxy #2243).McpOpenapiCompositeGenerator.injectBindingno longer takes an explicit exit-override parameter. It now propagates its ownbinding.kinddirectly onto the generatedmcp_http0(.kind(binding.kind)), stamping the resolvedexiton every generated route when one exists (.exit(binding.exit)ininjectRoutes).client(noexitanywhere) andproxy(exitrequired, top-level or per-route) now have a precisely-specified, schema-enforced meaning, and the generator trustskindliterally rather than deriving it from exit presence — because every caller lives in this codebase, so an inconsistent caller (kind set one way, exit implying another) will simply fail to route and get caught by tests, rather than needing to be defended against in the generator.What this means for
mcp_schema_registry's ownkind: proxyMirror the exact same pattern, one level up:
specs/binding-mcp-schema-registry.spec/.../mcp_schema_registry.schema.patch.json): widenkindto["client", "proxy"].clientkeeps disallowingexit(top-level and per-route) and keeps requiringoptions.server;proxyrequiresexit(mirror theif: {required:[with]} then: {required:[exit]}per-route shape now inmcp_openapi.schema.patch.json, notbinding-tcp's original array-level"required"— that's a no-op) and should disallowoptions.server(unlikemcp_openapi, whereoptions.specs.*.serverstays valid for both kinds because it can have multiple specs with meaningful per-spec servers —mcp_schema_registryhas exactly one bundled spec, soserveris genuinely vestigial onceexittakes over).McpSchemaRegistryBinding/McpSchemaRegistryBindingContext: widen thekind == CLIENTgates to also acceptPROXY(mirrorMcpOpenapiBinding/McpOpenapiBindingContextfrom binding-mcp-openapi: add kind: proxy variant with operator-declared exit #2242) — otherwisekind: proxybindings never reachattach()and every stream aborts immediately.McpSchemaRegistryBindingConfig: add anexitfield resolved the same wayMcpOpenapiBindingConfig.exitis — scanbinding.routesfor the first non-nullroute.exit, resolve via that route's already-populatedroute.id(context.supplyQName(exitRoute.id)), not by re-resolving the raw string throughresolveIda second time (that path doesn't reliably reproduce the engine's own resolution). Filter that route out of the "declared routes" list so a top-levelexit:shorthand's synthesized catch-all route doesn't get mistaken for a real tool route.McpSchemaRegistryCompositeGenerator: when building the intermediatemcp_openapi0, propagate this binding's own kind and exit directly —.kind(binding.kind)and.exit(binding.exit)on the generated route(s) — instead of hardcoding.kind(CLIENT)unconditionally while separately threadingexitthrough only when proxy. That hardcode-kind-but-vary-exit shape is exactly the kind/exit inconsistency binding-mcp-openapi: add kind: proxy variant with operator-declared exit #2242 stopped tolerating inMcpOpenapiCompositeGenerator; setting it there would makemcp_openapi(now trustingkindliterally) generatemcp_http0askind: clientand silently drop the operator-declared exit. Nothing else needs to change inbinding-mcp-openapifor this —McpOpenapiBindingConfig's exit resolution just readsroute.exitoff whateverBindingConfigit's handed, andMcpOpenapiBinding/BindingContextalready accept bothCLIENTandPROXY.McpSchemaRegistryProxyITmirroringMcpOpenapiProxyIT(binding-mcp-openapi: add kind: proxy variant with operator-declared exit #2242) — reuse the existing.rptscripts against akind: proxy+exit:fixture instead of any config-property override. PlusSchemaTestcases for the valid/invalidkind/exit/options.servercombinations, and aMcpSchemaRegistryCompositeGeneratorTestcase asserting the generatedmcp_openapi0's kind/exit match the outer binding's.Rebase/catch up onto
developpast #2242 before starting so this mechanism is actually present.Generated by Claude Code
Merge branch 'develop' into claude/zilla-issue-2104-lechxn
binding-mcp-schema-registry: add kind: proxy variant with operator-de…