Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/mcp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,16 @@ mcpServer.registerTool(
void sendProgress(msg);
});

// Do NOT embed `progressEvents` in the response. Every event was
// already streamed live via `notifications/progress` (see sendProgress
// above); duplicating them here only inflates the tool result.
// An 8-reviewer chat routinely produced 50KB+ payloads that exceeded
// the MCP client's per-result token budget — the client then spills
// the whole blob to a file and forces a chunked re-read. `eventCount`
// gives callers the cardinality for debug without the bloat.
const response = {
...(result as Record<string, unknown>),
events: progressEvents,
eventCount: progressEvents.length,
};

return {
Expand Down
Loading