Skip to content

feat(mcp): stream progress notifications for long-running tools - #1686

Open
unicoderbot[bot] wants to merge 4 commits into
mainfrom
vgv-ai-bot/issue-1616
Open

feat(mcp): stream progress notifications for long-running tools#1686
unicoderbot[bot] wants to merge 4 commits into
mainfrom
vgv-ai-bot/issue-1616

Conversation

@unicoderbot

@unicoderbot unicoderbot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Implement streaming MCP notifications/progress from long-running tools (test, packages_get, packages_check_licenses, create) so clients can show live progress while a command runs.

Changes

  • Pass progressToken from request metadata to _runToolCommand()
  • Emit notifications/progress messages as each line of command output is settled
  • Use monotonically-increasing progress counter per MCP spec requirements
  • Enhanced CapturingStdout to detect line boundaries (\n and \r) and invoke an optional onLine callback
  • Progress notifications are fire-and-forget UX signals; the final tool result remains the source of truth
  • Server stays silent when client omits progressToken (per MCP spec)

Details

  • Added onLine parameter to CapturingStdout to report each settled, sanitized line as command output is captured
  • \r boundaries (spinner redraws) are treated as settled-line boundaries so intermediate states surface
  • Each progress notification includes the line's text as a human-readable message
  • Initial "Starting" notification emitted immediately when token is provided
  • Blank/whitespace-only lines are filtered out

Testing

  • Verified progress notifications are not sent without a token
  • Confirmed progress counter strictly increases across notifications
  • Tested both string and integer token types
  • Validated \r boundaries are detected and reported separately
  • Confirmed all relevant tools emit progress when token is supplied

Closes #1616

Closes #1616

Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
@unicoderbot

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): stream progress notifications for long-running tools

1 participant