Mastra adds background tasks to MCP tool calls: slow computations no longer block the agent, and clients poll a task ID for results
Mastra has added tasks to its MCP server and client so that long-running tool calls run in the background. Previously MCP tool calls were synchronous: a single HTTP request stayed open until the call finished, blocking the agent loop, and although Mastra's existing background tasks primitive could free the loop, a call that outlasted a proxy timeout or a load balancer's idle limit would still fail. Now the server returns a task ID that ends the request, the client polls that ID for working, input_required, completed, failed or cancelled status, and a notification signal reaches the agent when the task completes.