The EventMesh A2A (Agent-to-Agent) Protocol is a specialized, high-performance protocol plugin designed to enable asynchronous communication, collaboration, and task coordination between autonomous agents.
With the release of v2.0, A2A adopts the MCP (Model Context Protocol) architecture, transforming EventMesh into a robust Agent Collaboration Bus. It bridges the gap between synchronous LLM-based tool calls (JSON-RPC 2.0) and asynchronous Event-Driven Architectures (EDA), enabling scalable, distributed, and decoupled agent systems.
tools/call, resources/read.A2A Protocol features a unique Dual-Mode architecture that simultaneously supports:
Mechanism: The EnhancedA2AProtocolAdaptor intelligently detects the payload format. If jsonrpc: "2.0" is present, it engages the MCP translation engine; otherwise, it treats the payload as a standard CloudEvent (delegating to the underlying CloudEvents adaptor).
_agentId for P2P, _topic for Pub/Sub) from MCP parameters and injects them into CloudEvents attributes for zero-decoding routing.message/sendStream) using sequence IDs.┌─────────────────────────────────────────────────────────────┐ │ EventMesh A2A Protocol v2.0 │ │ (MCP over CloudEvents Architecture) │ ├─────────────────────────────────────────────────────────────┤ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ MCP/JSON-RPC│ │ Native │ │ Protocol │ │ │ │ Handler │ │ Pub/Sub │ │ Delegator │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ ├─────────────────────────────────────────────────────────────┤ │ ┌───────────────────────────────────────────────────────┐ │ │ │ Enhanced A2A Protocol Adaptor │ │ │ │ (Intelligent Parsing & CloudEvent Mapping) │ │ │ └───────────────────────────────────────────────────────┘ │ ├─────────────────────────────────────────────────────────────┤ │ EventMesh Protocol Infrastructure │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ CloudEvents │ │ HTTP │ │ gRPC │ │ │ │ Protocol │ │ Protocol │ │ Protocol │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ └─────────────────────────────────────────────────────────────┘
To support the MCP Request/Response model within an event-driven architecture, A2A defines the following mapping rules:
| MCP Concept | CloudEvent Mapping | Description |
|---|---|---|
Request (tools/call) | type: org.apache.eventmesh.a2a.tools.call.req mcptype: request | Request event. |
Response (result) | type: org.apache.eventmesh.a2a.common.response mcptype: response | Response event. |
Correlation (id) | extension: collaborationid / id | Links Response to Request. |
| P2P Target | extension: targetagent | Routing target Agent ID. |
| Pub/Sub Topic | subject: <topic_name> | Broadcast Topic. |
{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "get_weather", "_agentId": "weather-service" // P2P Routing }, "id": "req-123" }
{ "jsonrpc": "2.0", "method": "market/update", "params": { "price": 50000, "_topic": "market.btc" // Pub/Sub Routing } }
// 1. Construct MCP Request JSON String mcpRequest = "{" + "\"jsonrpc\": \"2.0\"," + "\"method\": \"tools/call\"," + "\"params\": { \"name\": \"weather\", \"_agentId\": \"weather-agent\" }," + "\"id\": \"req-001\"" + "}"; // 2. Send via EventMesh SDK eventMeshProducer.publish(new A2AProtocolTransportObject(mcpRequest));
Subscribe to the topic org.apache.eventmesh.a2a.tools.call.req, process logic, and send back response with matching id.
EnhancedA2AProtocolAdaptor supporting JSON-RPC 2.0._topic parameter._seq parameter.Welcome to contribute code and documentation!
Apache License 2.0