Introducing Agent-to-Agent support for Mastra
Mastra agents and the Client SDK now support the Agent-to-Agent (A2A) protocol by default. Run A2A agents as Mastra subagents, or invoke them via the Client SDK.
A2A is an open standard for delegating work to other A2A-enabled agents, regardless of framework, deployment vendor, or programming language.
Every A2A-enabled agent has an agent card, served at a .well-known URL, that describes the agent’s capabilities and includes its execution endpoint.
There are two ways to interact with A2A-enabled agents using Mastra: consuming A2A-enabled agents as subagents, or sending requests to A2A-enabled agents using the Client SDK. Set up a remote agent with A2AAgent, passing in the .well-known card URL and any auth headers, then attach it following Mastra’s subagent pattern.