Skip to content

fix(mcp): work with protocol 2026-07-28 clients (2.3.2) - #10

Merged
mrramdn merged 2 commits into
mainfrom
fix/mcp-cache-hints
Oct 11, 2026
Merged

mrramdn merged 2 commits into
mainfrom
fix/mcp-cache-hints

Conversation

@mrramdn

@mrramdn mrramdn commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Why

Claude Code 2.1.296 connects to MCP servers with protocol 2026-07-28. It skips initialize and sends server/discover with _meta["io.modelcontextprotocol/protocolVersion"] = "2026-07-28". Laci 2.3.1 lists that version in supportedVersions, but its tools/list result then has no ttlMs or cacheScope, which 2026-07-28 requires on list results (SEP-2549). Claude Code rejects the list, so Laci's tools are missing:

Status: ! Connected · tools fetch failed
Issue: Invalid result for tools/list: [ { "expected": "number", "code": "invalid_type", "path": [ "ttlMs" ], "message": "Invalid input: expected number, received undefined" }, { "code": "invalid_value", "values": [ "public", "private" ], "path": [ "cacheScope" ], "message": "Invalid option: expected one of \"public\"|\"private\"" } ]

Cause

rmcp 3.5.0 added the hints only to results built by its #[tool_handler] and #[prompt_handler] macros. Laci implements list_tools itself (ListToolsResult::with_all_items), so the fields stayed empty and were left out of the JSON.

What changes

  • rmcp 3.5.0 → 3.5.1, with rmcp-macros, in Cargo.lock only. 3.5.1 fills in missing hints for every 2026-07-28 peer (rust-sdk#1308): ttlMs: 0 and cacheScope: "private", so clients never cache the list. Sessions that start with initialize keep the old shape. mcp.rs is unchanged.
  • MCP smoke check: a second laci mcp is spoken to with 2026-07-28. server/discover must list 2026-07-28, and tools/list with the same _meta must return the 15 tools with a numeric ttlMs and a cacheScope of public or private. 28 → 30 checks. Starting and stopping the server moved into start() and stop(); the existing checks are unchanged.
  • 2.3.2: version in Cargo.toml, Cargo.lock, package.json, ui/package.json and tauri.conf.json, the changelog entry, and the README status line, which still said 2.1.0.

Checks

  • cargo fmt --all -- --check, strict Clippy and cargo test --workspace --features custom-protocol: 180 passed, 1 ignored.
  • UI typecheck, lint and build; node scripts/ui-state-smoke.mjs.
  • node scripts/mcp-smoke.mjs target/debug/laci: MCP smoke passed: 15 tools, 30 checks, …. Against 2.3.1 the new check fails with tools/list must carry ttlMs for 2026-07-28 clients.
  • tools/list keys for a 2026-07-28 request: 2.3.1 ["resultType","tools"], this branch ["resultType","ttlMs","cacheScope","tools"] (ttlMs: 0, cacheScope: "private"). A session started with initialize at 2025-11-25 still gets ["tools"].
  • Claude Code 2.1.296: claude mcp add --scope local <name> -e LACI_HOME=<empty dir> -- <binary> mcp, then claude mcp get <name>:
    • 2.3.1 (~/.local/bin/laci): Status: ! Connected · tools fetch failed, with the issue above
    • this branch (target/debug/laci): Status: ✔ Connected

After merge

v2.3.2 is tagged and the release is published.

Claude Code 2.1.296 talks to MCP servers with protocol 2026-07-28: it
sends server/discover instead of initialize, with the version in _meta.
Laci offered that version, but its tools/list result lacked ttlMs and
cacheScope, which 2026-07-28 requires on list results, so Claude Code
rejected Laci's tools ("tools fetch failed").

rmcp 3.5.0 added the hints only to results built by its handler macros,
and Laci builds its tool list itself. rmcp 3.5.1 fills in missing hints
for every 2026-07-28 peer (ttlMs 0, cacheScope private). Sessions that
start with initialize keep the old shape.

The MCP smoke check now also speaks 2026-07-28: server/discover must
offer it, and tools/list with the same _meta must return the 15 tools
with both hints.
@mrramdn
mrramdn merged commit 211e791 into main Oct 11, 2026
2 of 3 checks passed
@mrramdn
mrramdn deleted the fix/mcp-cache-hints branch October 11, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant