Preserve MCP identifiers for single-backend hosts - #57
Merged
Conversation
Signed-off-by: lucarlig <luca.carlig@ibm.com>
lucarlig
force-pushed
the
user/luca/preserve-mcp-identifiers
branch
from
July 14, 2026 15:43
507f0a4 to
5e811d4
Compare
dawid-nowak
self-requested a review
July 14, 2026 15:54
dawid-nowak
approved these changes
Jul 14, 2026
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.
Why
MCP tool names, prompt names, resource URIs, resource-template URIs, and completion references are protocol-visible identifiers. A transparent gateway should preserve them unless a namespace is needed to disambiguate multiple backends.
The conformance virtual host has one backend. Prefixing its identifiers with the backend UUID changes the upstream MCP contract, leaks an internal control-plane identifier, and prevents clients from using canonical values such as
test_simple_textandtest://template/{id}/data.Routing contract
{backend-map-key}-{identifier}This rule applies to tool calls, prompts, resources and resource templates, completion references, resource subscriptions, and resource-update notification URIs. Multi-backend virtual hosts retain collision-safe prefixing.
What changed
subscribeandunsubscribewith the same single-versus-multi-backend ruleConformance evidence
The original pinned conformance profile was rerun through the full public route against merged commit
0c24df5(tree-identical to PR head5e811d4) usingcf-integration@6bf4000:CF_DATAPLANE_REF=0c24df5e0affd3febe3e7589503a4b26000ed66f \ cargo run --locked -- compliance conformance \ --mode dataplane --start --spec-version 2025-11-25 --suite all@modelcontextprotocol/conformance@0.1.1621a9a2febd7100d7c17ac1021ee7f2ed9f66a1e0allfor specification2025-11-25— 32 scenarios+16); failing scenarios 23 → 7 (-16)Completion, JSON Schema 2020-12, prompts, resources, resource templates, subscriptions, and tool calls using canonical identifiers pass. The seven remaining failures are outside identifier routing:
logging-set-level,tools-call-with-loggingtools-call-sampling,tools-call-elicitation,elicitation-sep1034-defaults,elicitation-sep1330-enumsdns-rebinding-protectionThe command exits non-zero because the default expected-failure baseline does not suppress these known gaps; all 32 scenarios completed and the result artifacts were marked complete.
Validation
The merged commit
0c24df5is tree-identical to tested PR head5e811d4.cargo test -p contextforge-gateway-rs-lib— 42 passedcargo clippy -p contextforge-gateway-rs-lib --all-targets -- -D warningscargo fmt --all --checkmdbook build docs/bookmdbook test docs/bookgit diff --check