Skip to content

fix(mcp): stop advertising tools.listChanged in Code Mode - #244

Open
mattzcarey wants to merge 1 commit into
mainfrom
fix/tools-list-changed-false
Open

mattzcarey wants to merge 1 commit into
mainfrom
fix/tools-list-changed-false

Conversation

@mattzcarey

Copy link
Copy Markdown
Contributor

Code Mode advertised tools: { listChanged: true } on server/discover and initialize. That value is the default registerTool sets. We never send notifications/tools/list_changed:

  • tool lists change only on deploy or the daily spec refresh
  • mcp-handler.ts rejects subscriptions/listen (maxSubscriptions: 0), so a 2026-07-28 client that asks for toolsListChanged gets Subscription limit reached
Code Mode ?codemode=false
before listChanged: true listChanged: false
after listChanged: false listChanged: false

createServer now declares the capability once, before either surface registers tools, and registerNonCodemodeTools drops its own copy:

const server = new McpServer(SERVER_INFO)
server.server.registerCapabilities({ tools: { listChanged: false } })

registerTool advertises tools: { listChanged: true } by default, so Code
Mode's server/discover and initialize told clients to wait for
notifications/tools/list_changed. This server never sends one: tool lists
change only on deploy or the daily spec refresh, and the handler rejects
subscriptions/listen with maxSubscriptions: 0. The endpoint tools
(?codemode=false) already declared false.

createServer now declares listChanged: false once, before either surface
registers tools, and registerNonCodemodeTools drops its own copy.
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