Skip to content

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

Merged
jfallows merged 4 commits into
developfrom
claude/zilla-issue-2104-lechxn
Jul 31, 2026
Merged

jfallows merged 4 commits into
developfrom
claude/zilla-issue-2104-lechxn

Conversation

@jfallows

Copy link
Copy Markdown
Contributor

Description

Adds a kind: proxy variant to binding-mcp-schema-registry, alongside the existing kind: client (#2068). Instead of baking a real HTTP options.server into the generated composite, kind: proxy exposes an operator-declared exit (naming a downstream binding in the same namespace), letting the generated composite terminate there instead — e.g. a virtual schema-registry binding that implements Schema Registry semantics against Kafka rather than proxying to a real REST endpoint.

The exit travels through the generated mcp_openapi0 binding's own top-level exit: shorthand (resolved to a fully-qualified qname up front, via the same resolveId/supplyQName mechanism used for guarded refs and catalog references elsewhere in this generator). binding-mcp-openapi's composite generator now prefers a binding-level exit over the zilla.binding.mcp.openapi.http.client.exit Configuration default when building mcp_http0's routes, so the override is per-instance rather than JVM-wide.

Changes

  • specs/binding-mcp-schema-registry.spec: schema patch allows kind: proxy with a required exit (disallows options.server); kind: client keeps disallowing exit. New fixtures + SchemaTest cases for the valid/invalid combinations.
  • config/binding-mcp-schema-registry.conf: McpSchemaRegistryOptionsConfigAdapter treats server as optional (needed since kind: proxy has no options.server).
  • runtime/binding-mcp-schema-registry: McpSchemaRegistryBinding/BindingContext widened to accept kind: proxy; McpSchemaRegistryBindingConfig resolves the binding's own exit to a qname (filtering the synthetic exit-only route out of the declared-routes list, so "no declared routes" still means "expose all tools" under kind: proxy); McpSchemaRegistryCompositeGenerator passes the resolved exit through and omits options.server for kind: proxy.
  • runtime/binding-mcp-openapi: McpOpenapiBindingConfig picks up a binding-level exit; McpOpenapiCompositeGenerator uses it in preference to the configured httpClientExit default when stamping mcp_http0's routes.
  • New McpSchemaRegistryProxyIT reuses the existing shared .rpt scripts (the bundled OpenAPI spec's own servers: entry already matches what those scripts expect, so no script changes were needed) against a kind: proxy fixture with an exit: binding, in place of the client-kind IT's zilla.binding.mcp.openapi.http.client.exit system property override.

Verified locally: ./mvnw verify (with local -o -Djacoco.skip=true for iteration speed) is green for specs/binding-mcp-schema-registry.spec, config/binding-mcp-schema-registry.conf, runtime/binding-mcp-openapi, and runtime/binding-mcp-schema-registry, including checkstyle, license checks, and all ITs (both McpSchemaRegistryProxyIT and the existing McpSchemaRegistryClientIT/McpOpenapiClientIT).

Independent of and does not require touching the kind: client implementation in #2068, per the issue.

Fixes #2104


Generated by Claude Code

claude added 2 commits July 31, 2026 06:03
…tor-declared exit

Adds a kind: proxy variant alongside the existing kind: client, letting the
generated composite terminate at an operator-declared exit (a downstream
binding in the same namespace) instead of baking in options.server. The
exit travels through the generated mcp_openapi0 binding's own top-level
exit (resolved to a fully-qualified qname up front) and mcp-openapi's
composite generator now prefers a binding-level exit over the
zilla.binding.mcp.openapi.http.client.exit configuration default when
building mcp_http0's routes.

Closes #2104.
mcp_openapi's own binding-level exit was schema-permitted even though
kind: client never used it -- since McpOpenapiCompositeGenerator now
prefers a binding-level exit over the httpClientExit configuration
default (needed for mcp-schema-registry's new kind: proxy), an
authored exit would have silently taken effect. Disallow it explicitly,
matching how binding-mcp-schema-registry's own kind: client already
disallows exit.
claude added 2 commits July 31, 2026 16:12
Bring in binding-mcp-openapi kind: proxy support (#2242) and update
binding-mcp-schema-registry to generate its inner mcp_openapi0 binding
with the operator's own kind/exit instead of hardcoding kind: client,
per the handoff on #2104.
@jfallows
jfallows merged commit 4fbadb5 into develop Jul 31, 2026
42 checks passed
jfallows pushed a commit that referenced this pull request Aug 20, 2026
common-lang reaches binding-tcp only transitively through engine, which
is a provided-scope dependency here; the notice-plugin's includeScopes
is compile-only, so provided-scope transitives are correctly excluded
(engine and its own dependencies are attributed via the Docker image
assembly, not per-binding). The checked-in NOTICE incorrectly listed
common-lang since #2231 -- unrelated to this branch's own change of
adding common-lang as a real (compile-scope) dependency of engine.

Verified against the authoritative NOTICE.expected produced by a full
reactor build (mirroring CI's ./mvnw clean package): the only diff was
this one stray line.
jfallows added a commit that referenced this pull request Aug 20, 2026
* feat(engine): encapsulate label management in the Router SPI

Router/RouterContext gain supplyLabelId/supplyLabel (and Router gains
watchLabels) so a Router implementation owns label-id assignment and
lookup consistency, instead of the engine's own internal.LabelManager
singleton. EngineRouter/TestRouter absorb LabelManager's in-memory
behavior; the Engine remains solely responsible for bootstrapping from
and flushing to the on-disk labels file, independent of which Router
implementation is active, so zilla dump keeps working unchanged.

* refactor(engine): make label bootstrap/id-assignment lock-free and file-agnostic

EngineRouter/TestRouter drop all knowledge of the labels file and the
synchronized block used to serialize new-label registration. Id
assignment is now a plain ConcurrentHashMap + AtomicInteger (mirroring
MemoryStoreHandler's lock-free style) since computeIfAbsent's per-key
atomicity is the only guarantee actually needed.

Engine now owns bootstrapping too: it reads the labels file itself and
replays each entry through the ordinary supplyLabelId call before
registering the watchLabels flush listener, so a Router implementation
never needs file-reading logic to reproduce prior label ids.

* refactor(engine): avoid autoboxing on Router.watchLabels notifications

Router.watchLabels now takes ObjectIntBiConsumer<String> instead of
BiConsumer<String, Integer>, mirroring the existing LongObjectBiConsumer
pattern in this package. The primitive int overload lets EngineRouter/
TestRouter notify listeners on every new-label registration without
boxing the label id.

* refactor: consolidate ObjectIntBiConsumer into common-lang util.function

binding-http and engine each carried their own copy of this helper
functional interface. Helper functional interfaces of this shape
already live in common-lang's util.function package (LongObjectBiFunction,
LongObjectPredicate), so ObjectIntBiConsumer moves there too and both
call sites reference the shared type instead of a local duplicate.

engine now depends on common-lang (a dependency-free leaf module, no
cycle risk) and re-exports it transitively so any Router implementation
can reference ObjectIntBiConsumer; binding-http picks it up the same
way it already does common-agrona, transitively through its existing
engine dependency, with no pom.xml or module-info change needed there.

* fix(binding-tcp): drop stray common-lang entry from NOTICE

common-lang reaches binding-tcp only transitively through engine, which
is a provided-scope dependency here; the notice-plugin's includeScopes
is compile-only, so provided-scope transitives are correctly excluded
(engine and its own dependencies are attributed via the Docker image
assembly, not per-binding). The checked-in NOTICE incorrectly listed
common-lang since #2231 -- unrelated to this branch's own change of
adding common-lang as a real (compile-scope) dependency of engine.

Verified against the authoritative NOTICE.expected produced by a full
reactor build (mirroring CI's ./mvnw clean package): the only diff was
this one stray line.

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants