Skip to content

Long-running index / backfill_fold tools emit no notifications/progress events #1684

Description

@Widthdom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions