Skip to content

feat: implement MCP progress notifications in MCPClient#2290

Draft
joshwand wants to merge 3 commits into
strands-agents:mainfrom
joshwand:copilot/implement-mcp-progress-notifications
Draft

feat: implement MCP progress notifications in MCPClient#2290
joshwand wants to merge 3 commits into
strands-agents:mainfrom
joshwand:copilot/implement-mcp-progress-notifications

Conversation

@joshwand
Copy link
Copy Markdown

@joshwand joshwand commented May 14, 2026

Description

Adds basic support for MCP-Progress notifications in Strands MCPClient.

Related Issues

#1812

Documentation PR

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare
  • I ran full sdk test suite
  • I created a test agent that processes the callbacks by sending them in the agent stream as progress messages.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copilot AI and others added 3 commits May 5, 2026 06:05
- Add `progress_callback: ProgressFnT | None` parameter to `MCPClient.__init__`
- Thread callback through `call_tool_sync`, `call_tool_async`, and
  `_create_call_tool_coroutine` to `ClientSession.call_tool()`
- Support per-call override: per-call callback takes precedence over instance callback
- Export `ProgressFnT` from `strands.tools.mcp` package
- Update existing tests to include `progress_callback` in call assertions
- Add new tests for instance-level callback, per-call override, and default None behavior

Agent-Logs-Url: https://github.com/joshwand/strands-sdk-python/sessions/7ab253b3-c748-48ed-9a8a-ae5c8508e938

Co-authored-by: joshwand <22531+joshwand@users.noreply.github.com>
@yonib05 yonib05 added the area-mcp MCP related label May 27, 2026
- Docs: https://www.anthropic.com/news/model-context-protocol
"""

from mcp.shared.session import ProgressFnT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this, we shouldn't re-export MCP SDK types from here. It also looks like mcp_client.py already imports this directly from MCP SDK (which is ideal) so no need for this anyway


if use_task:
self._log_debug_with_thread("tool=<%s> | using task-augmented execution", name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be helpful to log a warning that progress callbacks are dropped for task-augmented execution

Something like:

if use_task:
   ...
   if effective_callback is not None:
      logger.warning("some message indicating the callout above")

@gautamsirdeshmukh
Copy link
Copy Markdown
Contributor

Thanks for taking this up! Just 2 small callouts, looks like you'll need to rebase as well, then this should be good to go!

@yonib05 yonib05 added the enhancement New feature or request label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-mcp MCP related enhancement New feature or request size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants