Skip to content

feat(mcp): streaming execution progress and recent failures resource - #523

Merged
jahvon merged 1 commit into
mainfrom
feat/mcp-streaming-progress
Nov 19, 2026
Merged

jahvon merged 1 commit into
mainfrom
feat/mcp-streaming-progress

Conversation

@jahvon

@jahvon jahvon commented Nov 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Execution tools (execute, run_command, run_executable) now stream output line-by-line as MCP progress notifications when the client sends a progress token — real-time feedback during long builds and tests, with transparent fallback to batch output when no token is present.
  • New flow://failures/recent static resource returns the last few failed runs with tailed error output as JSON, so a new session can pick up where a previous one left off without manual log hunting.

What changed

Streaming progress — ExecuteStreaming added to CommandExecutor interface. Uses io.Pipe() to merge stdout/stderr into a single stream, bufio.Scanner for line-by-line reading, and an atomic.Int64 line counter for progress values. The executeWithStreaming helper checks for a progress token and falls back to ExecuteContext when none is present — zero behavior change for clients that don't send one.

Failures resource — flow://failures/recent shells out to flow logs --status failed --content --tail 30 --max-bytes 10000 --output json, takes the last 5 entries, and returns them as JSON. Useful for session bootstrapping.

Docs — server instructions and docs site updated. Resources table gains the failures entry; Observability section documents streaming and session bootstrapping.

Test plan

  • 81 MCP test specs pass (including new failures resource test)
  • Lint clean on internal/mcp/...
  • Build succeeds
  • No generated file drift
  • Manual: connect a client that sends progress tokens (e.g. Claude Code) and run a long build — verify line-by-line output appears
  • Manual: fail a few runs, then read flow://failures/recent — verify it returns the last 5 with tailed output

Execution tools now stream output line-by-line as MCP progress
notifications when the client sends a progress token. Clients that
support progress notifications see real-time output during long-running
builds and tests; clients without a token get the existing batch
behavior.

A new flow://failures/recent static resource returns the last few failed
runs with tailed error output as JSON, so a new session can bootstrap
from where a previous one left off.

Changes:
- Add ExecuteStreaming to CommandExecutor for piped line-by-line output
- Add executeWithStreaming helper that falls back to ExecuteContext
  when no progress token is present
- Wire streaming into execute, run_command, and run_executable handlers
- Register flow://failures/recent resource backed by flow logs CLI
- Update server instructions and docs site
@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.34615% with 61 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/mcp/command_executor.go 0.00% 44 Missing ⚠️
internal/mcp/resources.go 77.27% 6 Missing and 4 partials ⚠️
internal/mcp/tools.go 46.15% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jahvon
jahvon marked this pull request as ready for review November 19, 2026 11:57
@jahvon
jahvon merged commit ed6c9be into main Nov 19, 2026
17 checks passed
@jahvon
jahvon deleted the feat/mcp-streaming-progress branch November 19, 2026 12:00
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.

1 participant