Skip to content

feat(mcp): forward tools/call progress to Host - #5070

Open
wutongyuonce wants to merge 1 commit into
apache:mainfrom
wutongyuonce:feat/mcp-tool-call-progress
Open

feat(mcp): forward tools/call progress to Host#5070
wutongyuonce wants to merge 1 commit into
apache:mainfrom
wutongyuonce:feat/mcp-tool-call-progress

Conversation

@wutongyuonce

Copy link
Copy Markdown

Summary

Long-running MCP tools currently look frozen: the SDK already supports onprogress / notifications/progress, and Runtime Host already forwards admitted (current, total) as transcript tool_progress, but McpClientManager.callTool never asked for a progress token and the CLI capability provider never called options.progress.

This PR wires those two existing seams. Invalid or incomplete progress is dropped so a noisy server cannot fail the tool. Listeners that throw are ignored for the same reason.

Fixes #5069

Verification

  • npm --workspace @maka/mcp run build && npm --workspace @maka/mcp run test:dist — 191 passed
  • node --test packages/cli/dist/__tests__/runtime-host-capability-provider-command.test.js — 6 passed
  • Did not run root lint / format:check / full npm test

Did not attach UI evidence: this is protocol-to-Host wiring; coverage is the modern Streamable HTTP fixture plus the CLI provider snapshot test.

Review

Independent Codex review (read-only) found no must-fix issues. Follow-up from that review: the omit-onProgress path now asserts the tools/call request has no progressToken. Skipped an extra E2E for invalid payloads — tool-progress.test.ts already covers drop behavior.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Pi implemented the wiring, tests, issue, and PR text. Codex ran a read-only review.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Wire SDK onprogress through McpClientManager.callTool into the CLI
capability provider's existing Host progress hook. Drop incomplete
or invalid step counts so a noisy server cannot fail the tool.

Refs apache#5069

Generated-by: Pi
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): forward MCP tools/call progress onto the existing Host progress channel

1 participant