What would you like to be added?
Handle notifications/tools/list_changed from MCP servers during an interactive session: when a connected server sends it, re-run tools/list for that server and replace its tools in the session's tool registry (the same remove-then-register step SessionMcpView.applyTools already does after a restart).
Today nothing in the CLI path listens for it (checked on main at 2a69a2f and on 0.24.5). connectToMcpServer (packages/core/src/tools/mcp-client.ts) registers only the roots capability. The toolsChanged pool event in mcp-pool-entry.ts is emitted on restart/reconnect, but not when a server sends the notification. The only way to pick up new tools is /mcp → reconnect or restarting the CLI.
Why is this needed?
MCP servers that change their tools at runtime rely on this notification. The spec has had it since 2024-11-05, and Claude Code, Gemini CLI and OpenCode re-list on it. Some examples: a server that only exposes tools after login, or a server that enables tools based on workspace state.
Our case: NeuroSquad, a desktop app, runs Qwen Code as one of several agents. Its MCP server grants tools when the user connects the agent to a new resource mid-session (a terminal, a browser, a note), and sends tools/list_changed. With Qwen Code the new tools only show up after the session restarts. We verified this live on 0.24.5: a note's note_* tools were missing from the request until a restart and present after it.
Additional context
What would you like to be added?
Handle
notifications/tools/list_changedfrom MCP servers during an interactive session: when a connected server sends it, re-runtools/listfor that server and replace its tools in the session's tool registry (the same remove-then-register stepSessionMcpView.applyToolsalready does after a restart).Today nothing in the CLI path listens for it (checked on
mainat 2a69a2f and on 0.24.5).connectToMcpServer(packages/core/src/tools/mcp-client.ts) registers only therootscapability. ThetoolsChangedpool event inmcp-pool-entry.tsis emitted on restart/reconnect, but not when a server sends the notification. The only way to pick up new tools is/mcp→ reconnect or restarting the CLI.Why is this needed?
MCP servers that change their tools at runtime rely on this notification. The spec has had it since 2024-11-05, and Claude Code, Gemini CLI and OpenCode re-list on it. Some examples: a server that only exposes tools after login, or a server that enables tools based on workspace state.
Our case: NeuroSquad, a desktop app, runs Qwen Code as one of several agents. Its MCP server grants tools when the user connects the agent to a new resource mid-session (a terminal, a browser, a note), and sends
tools/list_changed. With Qwen Code the new tools only show up after the session restarts. We verified this live on 0.24.5: a note'snote_*tools were missing from the request until a restart and present after it.Additional context