Skip to content

binding-mcp-schema-registry: add kind: proxy variant with operator-declared exit #2104

Description

@jfallows

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: proxy exposes exit (operator-declared, naming a downstream binding in the same namespace) instead of options.server.
  • That exit gets fed down into the generated composite's mcp_http0.route.exit, replacing whatever mcp_openapi's own generator would otherwise wire up by default (currently sourced from the zilla.binding.mcp.openapi.http.client.exit Configuration property — a JVM-wide default, not overridable per composite instance today).
  • Mechanically: whichever generator constructs the inner mcp_http0 binding (today mcp_openapi's own composite generator, invoked by mcp_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 to binding-mcp-openapi is 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 any http kind:server consumer — mcp_http's downstream stream already carries a fully-formed HttpBeginEx (:method/:scheme/:authority/:path/content-type headers), confirmed via direct engine tracing while debugging binding-mcp-schema-registry: composite mcp_schema_registry · client binding #2068's k3po fixtures.

Notes

Activity

  1. added theissue type on Jul 10, 2026
  2. self-assigned this
    on Jul 10, 2026
  3. jfallows commented on Jul 31, 2026

    @jfallows
    ContributorAuthor

    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-openapi now supports kind: client / kind: proxy itself (the zilla.binding.mcp.openapi.http.client.exit Configuration property this issue's Design section references no longer exists — it was removed as redundant once binding-mcp-http gained its own kind: client with zilla.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.injectBinding no longer takes an explicit exit-override parameter. It now propagates its own binding.kind directly onto the generated mcp_http0 (.kind(binding.kind)), stamping the resolved exit on every generated route when one exists (.exit(binding.exit) in injectRoutes). client (no exit anywhere) and proxy (exit required, top-level or per-route) now have a precisely-specified, schema-enforced meaning, and the generator trusts kind literally 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 own kind: proxy

    Mirror the exact same pattern, one level up:

    1. Schema (specs/binding-mcp-schema-registry.spec/.../mcp_schema_registry.schema.patch.json): widen kind to ["client", "proxy"]. client keeps disallowing exit (top-level and per-route) and keeps requiring options.server; proxy requires exit (mirror the if: {required:[with]} then: {required:[exit]} per-route shape now in mcp_openapi.schema.patch.json, not binding-tcp's original array-level "required" — that's a no-op) and should disallow options.server (unlike mcp_openapi, where options.specs.*.server stays valid for both kinds because it can have multiple specs with meaningful per-spec servers — mcp_schema_registry has exactly one bundled spec, so server is genuinely vestigial once exit takes over).
    2. McpSchemaRegistryBinding/McpSchemaRegistryBindingContext: widen the kind == CLIENT gates to also accept PROXY (mirror McpOpenapiBinding/McpOpenapiBindingContext from binding-mcp-openapi: add kind: proxy variant with operator-declared exit #2242) — otherwise kind: proxy bindings never reach attach() and every stream aborts immediately.
    3. McpSchemaRegistryBindingConfig: add an exit field resolved the same way McpOpenapiBindingConfig.exit is — scan binding.routes for the first non-null route.exit, resolve via that route's already-populated route.id (context.supplyQName(exitRoute.id)), not by re-resolving the raw string through resolveId a 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-level exit: shorthand's synthesized catch-all route doesn't get mistaken for a real tool route.
    4. McpSchemaRegistryCompositeGenerator: when building the intermediate mcp_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 threading exit through 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 in McpOpenapiCompositeGenerator; setting it there would make mcp_openapi (now trusting kind literally) generate mcp_http0 as kind: client and silently drop the operator-declared exit. Nothing else needs to change in binding-mcp-openapi for this — McpOpenapiBindingConfig's exit resolution just reads route.exit off whatever BindingConfig it's handed, and McpOpenapiBinding/BindingContext already accept both CLIENT and PROXY.
    5. Tests: new McpSchemaRegistryProxyIT mirroring McpOpenapiProxyIT (binding-mcp-openapi: add kind: proxy variant with operator-declared exit #2242) — reuse the existing .rpt scripts against a kind: proxy + exit: fixture instead of any config-property override. Plus SchemaTest cases for the valid/invalid kind/exit/options.server combinations, and a McpSchemaRegistryCompositeGeneratorTest case asserting the generated mcp_openapi0's kind/exit match the outer binding's.

    Rebase/catch up onto develop past #2242 before starting so this mechanism is actually present.


    Generated by Claude Code

  4. added a commit that references this issue on Aug 4, 2026
    4fbadb5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions