[GH-ISSUE #5673] MCP servers advertise protocol versions they don't implement #1769

Closed
opened 2026-11-02 15:49:32 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @calclb on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5673

🤖 Filed by calclb's AI agent (T3 Code, deepseek-v4.1-flash), not by calclb personally.

What

horizon-ctl mcp, horizon-server's MCP and horizon-launcher mcp all pin
PROTOCOL = "2025-06-18" and, on initialize, echo params.protocolVersion back:

  • crates/horizon-client/src/bin/horizon-ctl/mcp.rs:9, :137
  • crates/horizon-server/src/mcp.rs:13, :391
  • launcher/src/mcp.rs:15, :261

The current revision is 2026-07-28
(https://modelcontextprotocol.io/specification/2026-07-28/changelog). It removes the
handshake: requests are stateless and carry _meta with
io.modelcontextprotocol/protocolVersion and clientCapabilities, servers MUST answer
server/discover, every result carries resultType ("complete" / "input_required"),
and list results carry ttlMs + cacheScope. Roots, Sampling and Logging are deprecated;
ping, logging/setLevel and resources/subscribe are gone.

Echoing a version we do not implement makes a modern client believe the stateless
contract holds, which is exactly what UnsupportedProtocolVersionError exists to
prevent: it calls server/discover, gets an error or a 2025-06-18-shaped result, and
mis-parses it.

Why it is worth fixing

All three servers are stdio JSON-RPC and only use tools/list + tools/call — no
resources, sampling or roots — so the surface is small, but it is duplicated three
times. One shared helper instead of three constants also keeps them from drifting.

Fix

  • Implement server/discover for 2026-07-28 (versions, capabilities, identity).
  • Parse and echo _meta (protocolVersion, clientCapabilities, clientInfo), and
    stamp serverInfo in each result's _meta.
  • Add resultType to every result and ttlMs/cacheScope to list results.
  • Keep accepting initialize for older clients, and treat a missing resultType as
    "complete" (the spec requires this).
  • Share the implementation between the three servers.

Test

Connect an MCP client that speaks 2026-07-28 (it probes server/discover first), then
tools/list and one tools/call; and connect an older client that still sends
initialize and expect the same tools.

Originally created by @calclb on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5673 > 🤖 Filed by calclb's AI agent (T3 Code, deepseek-v4.1-flash), not by calclb personally. ## What `horizon-ctl mcp`, `horizon-server`'s MCP and `horizon-launcher mcp` all pin `PROTOCOL = "2025-06-18"` and, on `initialize`, echo `params.protocolVersion` back: - `crates/horizon-client/src/bin/horizon-ctl/mcp.rs:9`, `:137` - `crates/horizon-server/src/mcp.rs:13`, `:391` - `launcher/src/mcp.rs:15`, `:261` The current revision is `2026-07-28` (https://modelcontextprotocol.io/specification/2026-07-28/changelog). It removes the handshake: requests are stateless and carry `_meta` with `io.modelcontextprotocol/protocolVersion` and `clientCapabilities`, servers MUST answer `server/discover`, every result carries `resultType` (`"complete"` / `"input_required"`), and list results carry `ttlMs` + `cacheScope`. Roots, Sampling and Logging are deprecated; `ping`, `logging/setLevel` and `resources/subscribe` are gone. Echoing a version we do not implement makes a modern client believe the stateless contract holds, which is exactly what `UnsupportedProtocolVersionError` exists to prevent: it calls `server/discover`, gets an error or a `2025-06-18`-shaped result, and mis-parses it. ## Why it is worth fixing All three servers are stdio JSON-RPC and only use `tools/list` + `tools/call` — no resources, sampling or roots — so the surface is small, but it is duplicated three times. One shared helper instead of three constants also keeps them from drifting. ## Fix - Implement `server/discover` for `2026-07-28` (versions, capabilities, identity). - Parse and echo `_meta` (`protocolVersion`, `clientCapabilities`, `clientInfo`), and stamp `serverInfo` in each result's `_meta`. - Add `resultType` to every result and `ttlMs`/`cacheScope` to list results. - Keep accepting `initialize` for older clients, and treat a missing `resultType` as `"complete"` (the spec requires this). - Share the implementation between the three servers. ## Test Connect an MCP client that speaks `2026-07-28` (it probes `server/discover` first), then `tools/list` and one `tools/call`; and connect an older client that still sends `initialize` and expect the same tools.
Author
Owner

@Joansitoh commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

Claimed by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally.

Cause: the initialize handlers of the three MCP servers (crates/horizon-client/src/bin/horizon-ctl/mcp.rs, crates/horizon-server/src/mcp.rs, launcher/src/mcp.rs) return params.protocolVersion verbatim (falling back to "2025-06-18"), so a client asking for any version, even one that does not exist, is told it is supported. The MCP lifecycle rule is that the server answers with the same version only if it supports it, otherwise with a version it does support.

Plan (first slice, Part of #5673): reply with the client's version only if it is in a SUPPORTED list of the versions the servers really implement (just 2025-06-18 for now: the serve loops do not handle JSON-RPC batches, so older revisions are not claimed), else with the newest implemented one. Unit tests in each crate (the ones that assert an echo of 2025-03-26 are updated). The newer stateless revision described in the issue (server/discover, resultType, ...) is out of scope for this slice.

<!-- gh-comment-id:6555896711 --> @Joansitoh commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim Claimed by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally. Cause: the `initialize` handlers of the three MCP servers (`crates/horizon-client/src/bin/horizon-ctl/mcp.rs`, `crates/horizon-server/src/mcp.rs`, `launcher/src/mcp.rs`) return `params.protocolVersion` verbatim (falling back to `"2025-06-18"`), so a client asking for any version, even one that does not exist, is told it is supported. The MCP lifecycle rule is that the server answers with the same version only if it supports it, otherwise with a version it does support. Plan (first slice, `Part of #5673`): reply with the client's version only if it is in a `SUPPORTED` list of the versions the servers really implement (just `2025-06-18` for now: the serve loops do not handle JSON-RPC batches, so older revisions are not claimed), else with the newest implemented one. Unit tests in each crate (the ones that assert an echo of `2025-03-26` are updated). The newer stateless revision described in the issue (`server/discover`, `resultType`, ...) is out of scope for this slice.
Author
Owner

@Joansitoh commented on GitHub (Nov 1, 2026):

🤖 Agent: /unclaim

Released by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally. The part the title describes (servers echoing protocol versions they don't implement) was fixed in #5877. What remains is implementing the 2026-07-28 revision (stateless requests, server/discover, resultType, ...), a larger change that I am not working on, so anyone can take it.

<!-- gh-comment-id:6562807681 --> @Joansitoh commented on GitHub (Nov 1, 2026): 🤖 Agent: /unclaim Released by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally. The part the title describes (servers echoing protocol versions they don't implement) was fixed in #5877. What remains is implementing the 2026-07-28 revision (stateless requests, `server/discover`, `resultType`, ...), a larger change that I am not working on, so anyone can take it.
Author
Owner

@kira-horizon[bot] commented on GitHub (Nov 1, 2026):

Claimed by JustKrabby on Discord (GitHub: JustKarkat), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #5673).

<!-- gh-comment-id:6565271839 --> @kira-horizon[bot] commented on GitHub (Nov 1, 2026): Claimed by `JustKrabby` on Discord (GitHub: `JustKarkat`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #5673). <!-- kira:work -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#1769
No description provided.