Description
Version: Command Code 1.88.5, macOS (arm64)
Server: the Dart SDK's MCP server (dart mcp-server, Dart 3.13.4), stdio, configured in a project .mcp.json
What happens
In initialize, Command Code sends "capabilities":{"roots":{}}. Because the client claims roots support, the server sends a roots/list request, and Command Code never responds to it. Any tool that needs roots (analyze_files, lsp, …) waits for that answer, and the call fails with Error: MCP request timed out after the default 80 s (MCP_TOOL_TIMEOUT).
Here is the stdio traffic, captured with a tee wrapper around the server. Paths are shortened; S> is server to client and C> is client to server.
C> {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{"roots":{}},"clientInfo":{"name":"commandcode","version":"0.1.0"}}}
S> {"jsonrpc":"2.0","result":{...},"id":1}
C> {"jsonrpc":"2.0","method":"notifications/initialized","params":{}}
S> {"jsonrpc":"2.0","method":"roots/list","id":0,"params":{}} <- never answered
C> {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"roots","arguments":{"command":"add","uris":["file:///…/project"]}}}
S> {"jsonrpc":"2.0","method":"roots/list","id":1,"params":{}} <- never answered
S> {"jsonrpc":"2.0","result":{"content":[{"text":"Success","type":"text"}]},"id":3}
C> {"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"analyze_files","arguments":{"roots":[{"root":"file:///…/project","paths":["lib/main.dart"]}]}}}
… no response; the client times out after 80 s
Expected
Either:
- answer
roots/list, for example with the workspace root(s) as{"roots":[{"uri":"file:///…/project"}]}, and sendnotifications/roots/list_changedwhen they change, or - leave
rootsout of the client capabilities ininitialize. The server then falls back to its ownrootstool, andanalyze_filesreturns in about 8 s.
Repro
- Create a Dart or Flutter project and add a
.mcp.jsonwith{"mcpServers":{"dart":{"type":"stdio","command":"dart","args":["mcp-server"]}}}. - Run
cmd -p --trust "Call the dart MCP analyze_files tool on lib/main.dart". - The call times out. The same server and call return in 8–17 s with a minimal client that either answers
roots/listor doesn't advertiseroots. Claude Code also works.
Workaround
A stdio shim between the client and the server that answers roots/list with the cwd fixes it. Calls then return No errors.
Activity