Summary
index and backfill_fold MCP tools can run for many seconds or minutes on large repos, but the server does not emit notifications/progress during execution. MCP clients (especially web/streaming UIs) interpret long silence as a hung server and may close the connection. The MCP spec defines notifications/progress with a progressToken (echoed from the request's _meta.progressToken) precisely to keep clients informed during long ops.
Distinct from #1461 (MCP backfill_fold cannot resume after interrupt; no progress field) — that is about result-shape progress for resume; C282 is about real-time progress notifications during execution to prevent client timeout.
Where
src/CodeIndex/Mcp/McpToolHandlers.cs:1528-1650 (synchronous index path, no progress emission)
Suggested approach
(1) Read _meta.progressToken from incoming tools/call requests on index / backfill_fold. (2) From the index loop, emit notifications/progress periodically (e.g., every 500ms or every N files) with {progressToken, progress: filesScanned, total: filesEstimated}. (3) Document the progressToken flow in MCP tool descriptions. (4) Add a unit test that asserts at least one progress notification fires for an index over a multi-file fixture.
Summary
indexandbackfill_foldMCP tools can run for many seconds or minutes on large repos, but the server does not emitnotifications/progressduring execution. MCP clients (especially web/streaming UIs) interpret long silence as a hung server and may close the connection. The MCP spec definesnotifications/progresswith aprogressToken(echoed from the request's_meta.progressToken) precisely to keep clients informed during long ops.Distinct from #1461 (MCP backfill_fold cannot resume after interrupt; no progress field) — that is about result-shape progress for resume; C282 is about real-time progress notifications during execution to prevent client timeout.
Where
src/CodeIndex/Mcp/McpToolHandlers.cs:1528-1650(synchronous index path, no progress emission)Suggested approach
(1) Read
_meta.progressTokenfrom incomingtools/callrequests onindex/backfill_fold. (2) From the index loop, emitnotifications/progressperiodically (e.g., every 500ms or every N files) with{progressToken, progress: filesScanned, total: filesEstimated}. (3) Document theprogressTokenflow in MCP tool descriptions. (4) Add a unit test that asserts at least one progress notification fires for an index over a multi-file fixture.