What problem does this solve?
index_repository can run for minutes or hours on large repositories, but an MCP client currently receives no quantitative progress until the synchronous tool call completes.
index_status reports the already-published graph (nodes, edges, and ready|empty), not the active indexing attempt. The UI job endpoint similarly exposes only indexing|done|error.
The indexer already emits useful structured events such as:
pipeline.discover files=N
pass.start pass=... files=N
parallel.extract.progress done=N total=M
These events are consumed by the one-shot CLI progress sink, but are not exposed through MCP progress notifications or an in-flight status snapshot. This makes a healthy long-running index indistinguishable from a stalled one.
Proposed solution
Expose live per-attempt indexing progress to MCP clients.
- When the client supplies an MCP progress token, publish progress notifications while
index_repository is running.
- Include a structured snapshot for the active/latest attempt in
index_status, so another client or session can poll it.
- At minimum expose:
- attempt/run identifier
- state:
queued, running, completed, failed, or cancelled
- current phase/pass
- processed and total units for phases that have real counters
- discovered file count
- started and last-updated timestamps
- Do not invent a single overall percentage unless the pipeline has a well-defined weighted model. Phase-local
processed/total is enough initially.
- Preserve the current final
index_repository response and existing index_status fields for compatibility.
- Ensure daemon-supervised jobs propagate progress without mixing it into MCP stdout or JSON-RPC responses.
- Rate-limit or coalesce updates to avoid flooding clients.
Suggested acceptance criteria:
- A long-running MCP
index_repository call emits monotonic progress updates for the extraction phase.
index_status shows the same in-flight attempt state and counters.
- A client that does not request progress sees unchanged behavior.
- Completion, failure, and cancellation leave a terminal attempt record, and the final notification agrees with the tool result.
- Tests cover daemon transport, multiple subscribers, and compatibility when no progress token is supplied.
Related work:
Alternatives considered
- Rely on daemon logs: they are not available through MCP and require client-specific parsing.
- Return only final node and edge counts: this is too late to distinguish progress from a stall.
- Expose only an overall percentage: it would be misleading because pipeline phases have different costs and not every phase has a meaningful total.
Confirmations
What problem does this solve?
index_repositorycan run for minutes or hours on large repositories, but an MCP client currently receives no quantitative progress until the synchronous tool call completes.index_statusreports the already-published graph (nodes,edges, andready|empty), not the active indexing attempt. The UI job endpoint similarly exposes onlyindexing|done|error.The indexer already emits useful structured events such as:
pipeline.discover files=Npass.start pass=... files=Nparallel.extract.progress done=N total=MThese events are consumed by the one-shot CLI progress sink, but are not exposed through MCP progress notifications or an in-flight status snapshot. This makes a healthy long-running index indistinguishable from a stalled one.
Proposed solution
Expose live per-attempt indexing progress to MCP clients.
index_repositoryis running.index_status, so another client or session can poll it.queued,running,completed,failed, orcancelledprocessed/totalis enough initially.index_repositoryresponse and existingindex_statusfields for compatibility.Suggested acceptance criteria:
index_repositorycall emits monotonic progress updates for the extraction phase.index_statusshows the same in-flight attempt state and counters.Related work:
dbab4d37implemented the CLI presentation.Alternatives considered
Confirmations