FastMCP Cloud is here! Join the beta.
Handle progress notifications from long-running server operations.
New in version: 2.3.5
2.3.5
from fastmcp import Client async def my_progress_handler( progress: float, total: float | None, message: str | None ) -> None: if total is not None: percentage = (progress / total) * 100 print(f"Progress: {percentage:.1f}% - {message or ''}") else: print(f"Progress: {progress} - {message or ''}") client = Client( "my_mcp_server.py", progress_handler=my_progress_handler )
async with client: # Override with specific progress handler for this call result = await client.call_tool( "long_running_task", {"param": "value"}, progress_handler=my_progress_handler )