Repository navigation
binding-mcp-openapi: add kind: proxy variant with operator-declared exit - #2242
Merged
Merged
Conversation
…ared exit Widens mcp_openapi's kind enum to [client, proxy]. kind: proxy requires exit (top-level or per-route, mirroring binding-tcp's kind: server pattern, written to actually enforce per-route via "contains" rather than tcp's vacuous array-typed "required"); kind: client keeps disallowing exit. McpOpenapiBindingConfig now resolves a binding-level exit from the engine's own pre-resolved route.id (set generically by EngineManager for every route before binding-specific code runs) rather than re-resolving the raw route.exit string, and McpOpenapiCompositeGenerator prefers it over the configured httpClientExit default when stamping mcp_http0's routes. McpOpenapiBinding/McpOpenapiBindingContext widen their kind == CLIENT gates to also accept PROXY, mirroring the client+proxy dual-kind pattern binding-mcp-schema-registry uses for its own kind: proxy variant. Adds McpOpenapiProxyIT (reusing the existing mcp/http .rpt scripts against a kind: proxy + exit fixture) and SchemaTest coverage for the valid/invalid kind/exit combinations. Fixes #2237 Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SgdvrgkrnhEy7uUpoan62L
…t/proxy kind Now that binding-mcp-http supports kind: client (implicit sys:http_client exit via zilla.binding.mcp.http.client.exit, #2243), the generated mcp_http0 no longer needs to always be kind: proxy defaulting to a JVM-wide httpClientExit Configuration property owned by mcp_openapi itself. McpOpenapiCompositeGenerator now mirrors kind: proxy when a resolved exit exists (whether authored directly or passed through by a generator like binding-mcp-schema-registry), kind: client otherwise, relying entirely on mcp-http's own default. Removes the now-redundant zilla.binding.mcp.openapi.http.client.exit Configuration property. McpOpenapiClientIT and McpSchemaRegistryClientIT switch their exit override to zilla.binding.mcp.http.client.exit (owned by mcp-http) since there is no longer an mcp-openapi-level exit for kind: client. Also updates the mcp_openapi schema patch's kind: proxy per-route exit requirement to match binding-mcp-http's actual if/with-then/exit shape (and binding-tcp's now-fixed #2241 items-based enforcement) rather than the vacuous array-level "required" this mirrored initially. Rebased onto latest develop (#2241, #2243, #2244). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SgdvrgkrnhEy7uUpoan62L
jfallows
force-pushed
the
claude/github-issue-2237-95q79x
branch
from
July 31, 2026 16:21
7c6a702 to
0949181
Compare
…http0 directly Replace the derived binding.exit != null ? PROXY : CLIENT check with a direct .kind(binding.kind) propagation. client (no exit anywhere) and proxy (exit required) now have a precisely-specified meaning enforced by the schema, and every caller of McpOpenapiBindingConfig lives in this codebase — so trust the kind a caller sets rather than deriving it defensively from exit presence. A caller that sets kind and exit inconsistently (e.g. kind: client with an exit stamped on a route) will now simply not route correctly, which is the right failure mode: it gets caught by tests and fixed at the source, rather than silently papered over here. Updates the one unit test exercising this path to author its binding as kind: proxy (the real, schema-valid way to declare an exit) instead of kind: client + exit (a caller-side inconsistency this no longer special-cases). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SgdvrgkrnhEy7uUpoan62L
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
mcp_openapipreviously supported onlykind: client, with the generatedmcp_http0route'sexitalways sourced from the JVM-widezilla.binding.mcp.openapi.http.client.exitConfiguration property. This adds akind: proxyvariant that lets the operator declareexitdirectly on the binding (top-level or per-route), so the generated composite can terminate at an operator-provided binding instead of the configured default — the same splitbinding-mcp-schema-registrygot in #2068/#2231.Rebased onto latest
develop(post #2241, #2243, #2244), which landedbinding-mcp-http's ownkind: client(#2243, #2238). That unlocked a cleaner design than originally planned:mcp_openapino longer needs its ownzilla.binding.mcp.openapi.http.client.exitdefault for the generatedmcp_http0— it now propagates its ownkinddirectly ontomcp_http0(client→client,proxy→proxywith the resolvedexitstamped per route), relying entirely onmcp_http's ownzilla.binding.mcp.http.client.exitdefault (sys:http_client) for the client case. The mcp-openapi-level property is removed as redundant.client(noexitanywhere) andproxy(exitrequired) now have a precisely-specified meaning enforced by the schema, soMcpOpenapiCompositeGeneratortrustsbinding.kinddirectly (.kind(binding.kind)) rather than deriving the generated kind from exit presence — every caller ofMcpOpenapiBindingConfiglives in this codebase, so a caller that ever set kind/exit inconsistently would simply fail to route correctly and get caught by tests, rather than needing to be defended against here.Changes
specs/binding-mcp-openapi.spec: schema patch widenskindto["client", "proxy"].clientkeeps disallowingexit(top-level and per-route);proxyrequiresexiteither top-level or per-route — the per-route branch mirrorsbinding-mcp-http's ownif: {required: [with]} then: {required: [exit]}shape (and the corrected, non-vacuous form ofbinding-tcp's pattern from fix(binding-tcp): enforce per-route exit requirement for kind: server #2241) rather thanbinding-tcp's original array-level"required", which is a no-op sincerequiredonly constrains object instances. New fixtures (kind.proxy.yaml,kind.proxy.invalid.yaml,kind.proxy.route.exit.yaml,exit.invalid.yaml) plusSchemaTestcoverage for the valid/invalid combinations.runtime/binding-mcp-openapi:McpOpenapiBindingConfigresolves a binding-levelexitfrom the first route with a non-nullexit, using that route's already-resolvedroute.id(set generically byEngineManagerfor every route before any binding-specific code runs) rather than re-resolving the rawroute.exitstring a second time.McpOpenapiCompositeGeneratorgeneratesmcp_http0with the samekindas the outermcp_openapibinding, stamping the resolvedexiton every route when one exists.McpOpenapiBinding/McpOpenapiBindingContextwiden theirkind == CLIENTgates to also acceptPROXY— without this,kind: proxybindings never reachattach()at all and every stream aborts immediately, mirroringMcpSchemaRegistryBinding/McpSchemaRegistryBindingContext's existing client+proxy dual-kind pattern from binding-mcp-schema-registry: add kind: proxy variant with operator-declared exit #2231.McpOpenapiClientIT/McpSchemaRegistryClientIT: switch their exit override from the removedzilla.binding.mcp.openapi.http.client.exittozilla.binding.mcp.http.client.exit(now owned bybinding-mcp-http), since there's no longer an mcp-openapi-level exit forkind: clientto override.McpOpenapiProxyITreuses the existingmcp/http.rptscripts already exercised byMcpOpenapiClientIT, driven by akind: proxy+exit:fixture — analogous toMcpSchemaRegistryProxyIT.options.specs.*.serveris untouched — it stays available for both kinds, since it shapes per-spec HTTP headers independently of which binding receives the stream.Follow-up for
binding-mcp-schema-registry(once #2104/#2231 lands and picks this up): its own composite generator currently hardcodes.kind(CLIENT)on the intermediatemcp_openapi0it generates, regardless of its own kind. It should instead propagate its own kind the same way this PR does —.kind(schemaRegistryBinding.kind)with.exit(schemaRegistryBinding.exit)stamped on the generated route(s) — rather than hardcodingCLIENTwhile separately threadingexitthrough, which is exactly the kind/exit inconsistency this PR moved away from tolerating.Verified locally:
./mvnw verifyis green forspecs/binding-mcp-openapi.spec,runtime/binding-mcp-openapi, andruntime/binding-mcp-schema-registry, including checkstyle, license checks, JaCoCo coverage, and all ITs.Fixes #2237