Mastra Blog·· 3 d agoAI score58
Mastra adds MCP Tasks for background long-running tool calls
Introducing MCP Tasks in Mastra
AI summary
Mastra now supports tasks in MCPServer and MCPClient, letting long-running tool calls run in the background while the agent keeps responding to users. The server returns a task ID immediately, and the client polls for status values working, input_required, completed, failed or cancelled, with a notification sent to the agent when the task finishes. Tools can be set to always, auto (after a 2-second syncWindowMs default) or off, and tasks can still call suspend() for human input; the feature requires @mastra/mcp@2.7.0 and @mastra/core@1.81.0 or later and remains experimental.
Source:Mastra Blog · mastra.ai