Skip to content

DRAFT: MCP progress notifications for long pkg actions (needs upstream MCP.jl release)#16

Draft
samtalki wants to merge 1 commit into
mainfrom
feat/mcp-progress-notifications
Draft

DRAFT: MCP progress notifications for long pkg actions (needs upstream MCP.jl release)#16
samtalki wants to merge 1 commit into
mainfrom
feat/mcp-progress-notifications

Conversation

@samtalki

@samtalki samtalki commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Wires long pkg actions to MCP notifications/progress, using the progress support added on the ModelContextProtocol.jl fork (samtalki/ModelContextProtocol.jl#feat/progress-notifications).

What changed

  • _run_with_heartbeat (worker.jl) runs the worker eval on a child task and, every couple of seconds while it runs, tees a status line through _tee_status! (server stderr + the session recent_output ring + the live log viewer) and calls a progress callback. The eval runs on the child task and the heartbeat on the calling task, so only one task ever writes the transport, and the heartbeat stops before the handler returns.
  • run_pkg_action_on_worker takes an optional progress_cb; without it the action runs as a single blocking call, exactly as before.
  • The pkg tool handler now takes (params, ctx) and passes a callback that calls ModelContextProtocol.send_progress. It is a no-op when the client sent no progressToken, so behavior is unchanged for clients that do not ask for progress.

Status

Tests

test/test_competitive_features.jl adds a heartbeat testset: it asserts the heartbeat fires and tees to the ring, and drives _run_with_heartbeat through a real RequestContext with a buffer-backed StdioTransport, asserting a real notifications/progress carrying the progress token reaches the wire. Full suite green (346 tests).

🤖 Generated with Claude Code

@samtalki samtalki force-pushed the feat/clean-errors-prompts-progress branch from aaa2722 to bc232f3 Compare June 7, 2026 05:59
@samtalki samtalki force-pushed the feat/mcp-progress-notifications branch from c240f14 to 7e35d78 Compare June 7, 2026 06:00
@samtalki samtalki deleted the branch main June 7, 2026 17:45
@samtalki samtalki closed this Jun 7, 2026
@samtalki samtalki reopened this Jun 7, 2026
@samtalki samtalki changed the base branch from feat/clean-errors-prompts-progress to main June 7, 2026 17:46
Long pkg actions (add, update, instantiate, test, ...) ran as a single
blocking call with no feedback until they finished. This wires them to the
progress support added on the ModelContextProtocol.jl fork.

- _run_with_heartbeat runs the worker eval on a child task and, every couple
  of seconds while it runs, tees a status line through _tee_status! (server
  stderr + the session recent_output ring + the live log viewer) and calls a
  progress callback. The eval runs on the child task and the heartbeat on the
  calling task, so only one task ever writes the transport, and the heartbeat
  stops before the handler returns its response.
- run_pkg_action_on_worker takes an optional progress_cb; without it the
  action runs blocking exactly as before.
- The pkg tool handler now takes (params, ctx) and passes a callback that
  calls ModelContextProtocol.send_progress. It is a no-op when the client
  sent no progressToken, so behavior is unchanged for clients that do not ask
  for progress (Claude Code does not render progress notifications yet).

DRAFT: depends on send_progress / RequestContext-passing handlers, which are
not yet in a released ModelContextProtocol.jl. Project.toml [sources] pins the
fork branch; drop the pin and bump [compat] once upstream releases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@samtalki samtalki force-pushed the feat/mcp-progress-notifications branch from 7e35d78 to 8928da9 Compare June 7, 2026 17:46
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