[PR #5877] [MERGED] mcp: answer initialize with a supported protocol version (part of #5673) #6534

Closed
opened 2026-11-03 06:22:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5877
Author: @Joansitoh
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/5673-mcp-protocol-version


📝 Commits (2)

  • 911aeba mcp: answer initialize with a protocol version we support (part of #5673)
  • 20c472f mcp: derive launcher PROTOCOL from SUPPORTED, tidy tests

📊 Changes

3 files changed (+83 additions, -10 deletions)

View changed files

📝 crates/horizon-client/src/bin/horizon-ctl/mcp.rs (+26 -4)
📝 crates/horizon-server/src/mcp.rs (+26 -4)
📝 launcher/src/mcp.rs (+31 -2)

📄 Description

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

Part of #5673.

What

The MCP initialize handlers of horizon-ctl, horizon-server and the launcher echoed whatever protocolVersion the client sent (even 2026-07-28 or 1999-01-01). The MCP lifecycle rule: the server answers with the same version only if it supports it, otherwise with another version it supports.

Each of the three now has SUPPORTED = ["2025-06-18"] and a small negotiate_version(params): a supported client version is echoed, an unknown, non-string or missing one gets SUPPORTED[0]. Older revisions are not claimed: only the revision actually implemented is advertised (no JSON-RPC batches, only capabilities.tools). The launcher's PROTOCOL is now SUPPORTED[0].

Tests

  • New version_negotiation unit test in each crate (supported echoed; 2026-07-28, 1999-01-01, non-string, missing → 2025-06-18).
  • Existing protocol_basics / the_protocol_answers_without_a_server updated (they asserted an echo of 2025-03-26).
  • cargo test -p horizon-server mcp ✅, cargo test -p horizon-client --bin horizon-ctl mcp ✅.
  • The launcher test was not run locally: the launcher workspace does not build on this machine (system fontconfig library missing). Its change is the same logic and test; rustfmt passes. CI will build it.
  • No parity harness covers MCP version negotiation; unit tests are the evidence.

Stays open in #5673

Everything else (server/discover, stateless requests, resultType, batches, ...) is not part of this slice.

pr_ready (tools/pr_ready.py --quick --base upstream/main): Python tests ✅ 515, rustfmt ✅, clippy ✅, tests horizon-client + horizon-server ✅ 1773, doc tests ✅, launcher rustfmt ✅, launcher clippy/tests ❌ only because fontconfig is missing locally (build script of yeslogic-fontconfig-sys).
Affected harnesses: run by CI's parity job (friends_integration, lan_integration, management_protocol, remote_fireball, remote_fireworks, return_to_sender, save_roundtrip, server_player_sculk, spawn_loot, world_reopen).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5877 **Author:** [@Joansitoh](https://github.com/Joansitoh) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/5673-mcp-protocol-version` --- ### 📝 Commits (2) - [`911aeba`](https://github.com/horizon-rust/horizon/commit/911aebaaf2f8de912772dcb2c057f739e509110c) mcp: answer initialize with a protocol version we support (part of #5673) - [`20c472f`](https://github.com/horizon-rust/horizon/commit/20c472f0084a85669adb22d5c090f525d2a83c42) mcp: derive launcher PROTOCOL from SUPPORTED, tidy tests ### 📊 Changes **3 files changed** (+83 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/bin/horizon-ctl/mcp.rs` (+26 -4) 📝 `crates/horizon-server/src/mcp.rs` (+26 -4) 📝 `launcher/src/mcp.rs` (+31 -2) </details> ### 📄 Description > 🤖 Opened by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally. Part of #5673. ## What The MCP `initialize` handlers of `horizon-ctl`, `horizon-server` and the launcher echoed whatever `protocolVersion` the client sent (even `2026-07-28` or `1999-01-01`). The MCP lifecycle rule: the server answers with the same version only if it supports it, otherwise with another version it supports. Each of the three now has `SUPPORTED = ["2025-06-18"]` and a small `negotiate_version(params)`: a supported client version is echoed, an unknown, non-string or missing one gets `SUPPORTED[0]`. Older revisions are not claimed: only the revision actually implemented is advertised (no JSON-RPC batches, only `capabilities.tools`). The launcher's `PROTOCOL` is now `SUPPORTED[0]`. ## Tests - New `version_negotiation` unit test in each crate (supported echoed; `2026-07-28`, `1999-01-01`, non-string, missing → `2025-06-18`). - Existing `protocol_basics` / `the_protocol_answers_without_a_server` updated (they asserted an echo of `2025-03-26`). - `cargo test -p horizon-server mcp` ✅, `cargo test -p horizon-client --bin horizon-ctl mcp` ✅. - **The launcher test was not run locally**: the launcher workspace does not build on this machine (system `fontconfig` library missing). Its change is the same logic and test; rustfmt passes. CI will build it. - No parity harness covers MCP version negotiation; unit tests are the evidence. ## Stays open in #5673 Everything else (`server/discover`, stateless requests, `resultType`, batches, ...) is not part of this slice. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main`): Python tests ✅ 515, rustfmt ✅, clippy ✅, tests horizon-client + horizon-server ✅ 1773, doc tests ✅, launcher rustfmt ✅, launcher clippy/tests ❌ only because `fontconfig` is missing locally (build script of `yeslogic-fontconfig-sys`). Affected harnesses: run by CI's parity job (friends_integration, lan_integration, management_protocol, remote_fireball, remote_fireworks, return_to_sender, save_roundtrip, server_player_sculk, spawn_loot, world_reopen). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:22:33 +07:00
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#6534
No description provided.