Skip to content

fix(mcp): advertise ttlMs and cacheScope on list responses - #287

Open
BigWebstas wants to merge 1 commit into
dinglebear-ai:mainfrom
BigWebstas:fix/mcp-list-cache-hints
Open

BigWebstas wants to merge 1 commit into
dinglebear-ai:mainfrom
BigWebstas:fix/mcp-list-cache-hints

Conversation

@BigWebstas

Copy link
Copy Markdown

Problem

Claude Code 2.1.301 rejects tools/list, prompts/list and resources/list results that lack ttlMs and cacheScope (the 2026-07-28 MCP spec makes both mandatory). The client logs Invalid result for tools/list: expected number, received undefined for ttlMs and drops the whole server, so Cortex never connects even though initialize and auth succeed.

Change

Send ttlMs: 60000 and cacheScope: private on all three list responses. The lists only change when the server binary does and are auth-gated, so a private 60s hint is conservative. The tools/list test now asserts both fields.

Verification

  • Deployed a build with this change and confirmed ttlMs=60000 cacheScope=private on tools/list, prompts/list and resources/list; Claude Code then connected.
  • Not run locally: cargo test / rustfmt (no Rust toolchain on the authoring machine). The import list was re-wrapped by hand to rustfmt width, so please let CI confirm formatting.

🤖 Generated with Claude Code

Clients implementing the 2026-07-28 MCP spec (Claude Code 2.1.301) reject
tools/list, prompts/list and resources/list results that lack ttlMs and
cacheScope, which drops the whole server. Send a 60s private cache hint.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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