Add MCP_PROTOCOL_MODE era selection and modern tools/list cache directives to fast-time-server - #20
Merged
jonpspri merged 1 commit intoAug 7, 2026
Conversation
…tives to fast-time-server - Emit cacheScope/ttlMs on tools/list responses at 2026-07-28, which the modern wire format requires for cacheable results; legacy responses keep the fields absent (#19) - Add MCP_PROTOCOL_MODE=legacy|modern|dual (default dual) to select the served MCP era(s); single-era modes also reject the other era's initialize handshake with -32022, and invalid values fail startup (#16) - Build the image on pinned registry.access.redhat.com/ubi10/ubi-minimal for both stages (Rust 1.92 from AppStream, no nightly), default the image to MCP_PROTOCOL_MODE=dual, and exclude target/ via .dockerignore Signed-off-by: Jonathan Springer <jps@s390x.com>
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.
Closes #16. Closes #19.
What
#19 — cache directives on modern
tools/list.tools/listis cacheable at 2026-07-28, whose wire format requirescacheScope/ttlMson every response (mcp SDK 2.0.0 / mcp-types 2.0.0 reject replies without them, breaking gateway federation). The server now overrideslist_toolsto emitcacheScope: "private",ttlMs: 0for requests carrying the 2026-07-28_metaversion — the same conservative defaultsserver/discoveralready uses. Legacy-era responses keep the fields absent, mirroring the SDK's version-gatedresultTypehandling.#16 —
MCP_PROTOCOL_MODEenv var + pinned UBI 10 build.MCP_PROTOCOL_MODE=legacy|modern|dualselects the served MCP era(s) without rebuilding or editing the entrypoint; unknown values fail startup with an error listing the accepted values.initializenegotiation accepts any known revision regardless ofsupported_protocol_versions(), so single-era modes also overrideinitializeto reject the other era's handshake with-32022(e.g. modern mode rejectsinitialize(2025-11-25)withsupported: ["2026-07-28"]).rustlang/rust:nightly-slimto the same pinnedregistry.access.redhat.com/ubi10/ubi-minimal:10.2-1777462752as the runtime (UBI 10.2 AppStream ships Rust 1.92, above the crate's 1.88 floor — no nightly). Image defaults toENV MCP_PROTOCOL_MODE=dual; new.dockerignoreexcludestarget/.Deviations from #16's text (it predates the rmcp rewrite in #17)
--protocol/--strictCLI flags no longer exist, so "CLI overrides env" is moot — the env var is the only mode selector.dual, notlegacy, preserving the server's current documented dual-era behavior rather than regressing it.Verification
cargo fmt --check,cargo clippy --all-targets,cargo test: clean, 37/37 (7 new tests: mode parsing, per-era wire gating, cache-directive presence/absence,/versionper mode).tools/listreturnsresultType/cacheScope/ttlMs; legacy mode rejects modern requests with-32022;MCP_PROTOCOL_MODE=nightlyexits 1 with guidance).Note:
/versionnow reportsprotocol_mode+mcp_versions; the singularmcp_versionfield was dropped.