The MQTT Transport for A2A
This profile defines a broker-neutral A2A over MQTT topic model for discovery and messaging. It standardizes retained Agent Card discovery, request/reply mappings, request-scoped security metadata, and interoperable client behavior.
Profile Scope
- This profile specifies MQTT v5 topic conventions and message-property mappings for A2A traffic.
- This profile defines interoperable behavior for requester clients and responder clients.
- Broker-internal implementation details remain implementation-specific unless explicitly stated.
Terminology
The key words MUST, SHOULD, and MAY are to be interpreted as described in RFC 2119.
Additional terms used in this profile:
requester: client agent that publishes A2A requestsresponder: client agent that consumes requests and publishes repliesdiscovery subscriber: client that subscribes to discovery topicspool: optional unit-scoped shared request endpoint consumed via MQTT shared subscriptions
Topic Model
Discovery Topic
Agent Cards MUST be published as retained messages at:
$a2a/v1/discovery/{org_id}/{unit_id}/{agent_id}Direct Interaction Topics
Interaction topics SHOULD use:
$a2a/v1/{method}/{org_id}/{unit_id}/{agent_id}Where {method} is typically request, reply, or event.
Optional Pool Request Topic
Shared pool dispatch uses:
$a2a/v1/request/{org_id}/{unit_id}/pool/{pool_id}Identifier Format
- Identifiers used in this profile (
org_id,unit_id,agent_id,pool_id, andgroup_id) MUST match:^[A-Za-z0-9._]+$
- Identifiers MUST NOT contain
/,+,#, whitespace, or any character outside the set above.
Client Session Requirements
- Clients implementing this profile MUST use MQTT v5.
- Requesters MUST subscribe to the intended reply topic before publishing requests that use that topic as MQTT
Response Topic. - Request/reply/event publications defined by this profile MUST NOT be retained.
- Requesters SHOULD use a reply topic suffix with high collision resistance (
reply_suffix) so concurrent requesters do not overlap reply streams. - Clients SHOULD use reconnect behavior that preserves subscriptions/session state where broker policy allows.
- Connections carrying bearer tokens MUST use TLS.
Discovery Interoperability
- Agent Cards MAY be discovered via HTTP well-known endpoints defined by core A2A conventions.
- For MQTT-compliant agents, publishing retained Agent Cards to
$a2a/v1/discovery/{org_id}/{unit_id}/{agent_id}is RECOMMENDED. - A client MAY discover a card via HTTP and then choose MQTT by selecting an MQTT-capable entry from
supportedInterfaces.
Discovery Publisher Behavior
- Agents register by publishing retained Agent Cards to discovery topics and SHOULD use MQTT QoS 1.
- To unregister, agents SHOULD clear retained discovery state using the broker-supported retained-delete mechanism for the same topic.
- Agents updating cards SHOULD republish the full card payload for that topic.
Discovery Subscriber Behavior
- Discovery subscribers SHOULD subscribe using scoped filters such as:
$a2a/v1/discovery/{org_id}/{unit_id}/+
- Subscribers MUST process retained discovery messages as current registration state.
- Subscribers SHOULD treat subsequent retained updates on the same discovery topic as replacement state for that agent.
- Subscribers MAY combine HTTP-discovered cards and MQTT-discovered cards, but topic-scoped MQTT cards are authoritative for MQTT routing.
Request/Reply Mapping (MQTT v5)
- Requesters SHOULD publish requests to
$a2a/v1/request/{org_id}/{unit_id}/{agent_id}using MQTT QoS 1. - Requesters MUST set MQTT 5
Response TopicandCorrelation Data. - Responders MUST publish replies to the provided
Response Topicand MUST echoCorrelation Data. Replies SHOULD be published using MQTT QoS 1. - Recommended reply topic pattern:
$a2a/v1/reply/{org_id}/{unit_id}/{agent_id}/{reply_suffix}. - MQTT
Correlation Datais transport-level request/reply correlation and MUST NOT be used as an A2A task identifier. - For newly created tasks, responders MUST return a server-generated A2A
Task.idin the response payload. - Requesters MUST use that returned
Task.idfor subsequent task operations (for exampletasks/get,tasks/cancel, and subscriptions).
Requester Behavior (Interop)
- Requesters MUST keep an in-flight map keyed by MQTT
Correlation Datafor active requests. Correlation Datavalues MUST be unique across concurrently in-flight requests from that requester on the same reply topic.- Requesters SHOULD publish requests with QoS 1 and MUST NOT set retained.
- Requesters MUST include request-scoped auth properties (for example
a2a-authorization) when required by the target responder. - On reply, requesters MUST match
Correlation Data; replies with unknown or missing correlation MUST be treated as protocol errors and ignored. - For pooled requests, requesters MUST validate presence of
a2a-responder-agent-idon pooled responses; missing property MUST be treated as a protocol error. - If a response creates or references a task, requesters MUST persist
Task.id; for pooled requests they MUST persist (Task.id,a2a-responder-agent-id). - Follow-up task operations (
tasks/get,tasks/cancel, subsequent stream/task interactions) SHOULD be routed to direct responder topics once responder identity is known. - Requesters MUST implement the retry and timeout behavior defined in
Requester Retry and Timeout Profile.
Responder Behavior (Interop)
- Responders MUST subscribe to their direct request topic and MAY additionally subscribe to pool request topics when operating in shared dispatch mode.
- If a request omits
Response TopicorCorrelation Data, responders SHOULD reject it as invalid protocol input; if no reply path is available, responders MAY drop. - Responders MUST validate request payloads and return protocol/application errors on the provided reply path when possible.
- For new tasks, responders MUST generate
Task.idserver-side and return it in the response payload. - Responders MUST echo
Correlation Dataunchanged on all replies and stream items for a request. - Replies and stream items SHOULD be sent with QoS 1 and MUST NOT be retained.
- Responders processing pooled requests MUST include User Property
a2a-responder-agent-idon responses. - Responders MUST NOT echo bearer tokens in payloads or MQTT properties.
Requester Retry and Timeout Profile
- This section defines the baseline retry/timeout behavior for requester interoperability and is part of Core conformance.
- Requesters MUST implement these defaults (configurable by deployment policy):
reply_first_timeout_ms:15000stream_idle_timeout_ms:30000max_attempts:3total attempts (initial attempt plus up to two retries)retry_backoff_ms: exponential (1000,2000,4000) with jitter of+/-20%
- For a single logical operation retried multiple times, requesters MUST keep the same A2A/JSON-RPC request id and MUST generate new MQTT
Correlation Datafor each publish attempt. - Requesters MUST stop retrying after the first valid correlated reply is received (success or error).
- Requesters MUST treat these conditions as retry-eligible until
max_attemptsis reached:- publish not accepted by the MQTT client/broker path
- request timed out waiting for first correlated reply (
reply_first_timeout_ms)
- Once any correlated stream item is received, requesters MUST NOT retry the original request publish.
- If stream progress stalls longer than
stream_idle_timeout_msafter at least one stream item, requesters SHOULD recover using task follow-up (tasks/get) with the knownTask.idinstead of republishing the original request. - For pooled requests:
- retries before responder selection MUST target the pool topic
- after responder identity is known (
a2a-responder-agent-id), follow-up operations and retries MUST target that responder's direct request topic
- Requesters MAY set MQTT Message Expiry Interval on request publications; if set, it SHOULD be greater than
reply_first_timeout_ms.
Optional Shared Subscription Dispatch
- This profile supports an optional unit-scoped shared dispatch mode so compatible responders (same contract/intent) can share request load while keeping standard A2A request/reply behavior.
- Canonical shared pool request topic:
$a2a/v1/request/{org_id}/{unit_id}/pool/{pool_id}
- Requesters MUST publish pooled tasks to the canonical non-shared pool request topic and MUST NOT publish directly to
$share/.... - Pool members MAY consume pooled requests via:
$share/{group_id}/$a2a/v1/request/{org_id}/{unit_id}/pool/{pool_id}
- All members of the same
{org_id}/{unit_id}/{pool_id}pool MUST use the samegroup_id. group_idSHOULD be deterministic and stable. Recommended base value:a2a.{org_id}.{unit_id}.{pool_id}
- If an implementation derives
group_idfrom external labels, it SHOULD replace characters outside[A-Za-z0-9._]with_before use. - Implementations MUST NOT use random per-instance values (for example UUIDs) as
group_id. - Implementations SHOULD enforce broker length limits for
group_id(recommended max64); if needed, truncate and append a short hash suffix. - A responder handling a pooled request MUST include MQTT User Property:
- key:
a2a-responder-agent-id - value: concrete responder
agent_id
- key:
- For pooled requests that create tasks, requesters SHOULD persist (
Task.id,a2a-responder-agent-id) and SHOULD route follow-up operations to the concrete responder direct request topic:$a2a/v1/request/{org_id}/{unit_id}/{agent_id}
- A designated agent in the unit MAY act as pool registrar and publish/update metadata describing
pool_id, membership, and the pool request topic. - How pool members coordinate membership, liveness, leader election, and failover is implementation-specific and out of scope for this profile.
- Shared dispatch is intentionally limited to
{org_id}/{unit_id}scope in this version because unit boundaries map to common tenancy/policy boundaries; cross-unit or org-global shared pools are not defined.
Streaming Reply Mapping (message/stream)
- For streaming A2A operations, responders MUST publish each stream item as a discrete MQTT message to the request-provided
Response Topic. - Each stream message MUST echo the same MQTT 5
Correlation Dataas the originating request. - Stream payloads SHOULD use A2A stream update structures, including
TaskStatusUpdateEventandTaskArtifactUpdateEvent. - Stream updates SHOULD be published using MQTT QoS 1 so publishers can receive PUBACK reason codes (for example,
No matching subscribers). - For this MQTT binding, receipt of a
TaskStatusUpdateEvent.status.statevalue ofTASK_STATE_COMPLETED,TASK_STATE_FAILED, orTASK_STATE_CANCELEDMUST be treated as the end of that stream for the given correlation. - Requesters MUST treat that terminal status as stream completion for the correlated request.
- If a requester does not receive terminal status within its stream timeout policy, it MAY issue follow-up task retrieval (
tasks/get) usingTask.id. - This end-of-stream rule applies to reply-stream messages on the request/reply path, not to general-purpose
$a2a/v1/event/...publications.
Event Delivery
- Event messages published to
$a2a/v1/event/{org_id}/{unit_id}/{agent_id}MAY use MQTT QoS 0. - Event publications are outside request/reply correlation unless explicitly tied by application metadata.
QoS Guidance
- MQTT QoS 1 is the recommended default for discovery registration, request, and reply publications.
- Using QoS 1 allows publishers to receive MQTT v5 PUBACK responses that can carry broker reason codes, for example
No matching subscribers. - Brokers and clients MUST support QoS 1 on discovery, request, and reply paths for interoperability.
- Event publications MAY use QoS 0 when occasional loss is acceptable.
A2A User Property Naming
- MQTT User Properties defined by this binding MUST use the
a2a-prefix. - New binding-specific properties defined by implementations SHOULD also use the
a2a-prefix to avoid collisions.
Agent Card Requirements
- Card payloads SHOULD conform to the A2A Agent Card schema.
- Agent-provided transport metadata MAY be expressed via Agent extension fields.
- Extensions MUST NOT redefine core A2A semantics.
Security Metadata and Trust
- Agent Cards MAY include public key metadata (for example
jwksUri) via extension params. - Brokers MAY reject cards having an untrusted
jwksUri. - JWKS retrieval SHOULD use HTTPS with TLS certificate validation.
OAuth 2.0 and OIDC over MQTT User Properties
- OAuth 2.0/OIDC token acquisition is out-of-band for this binding and occurs between the requester and an authorization server.
- If the selected agent requires OAuth 2.0/OIDC, the requester MUST include an access token on each request message as an MQTT v5 User Property:
- key:
a2a-authorization - value:
Bearer <access_token>
- key:
- Broker connection authentication (for example username/password or mTLS) is independent of per-request OAuth authorization and MUST NOT be treated as a replacement for it.
- Responders MUST validate bearer token claims (including
exp,iss, andaud) and required scopes before processing the request. - Request messages carrying bearer tokens MUST be sent over TLS-secured MQTT transport.
- Implementations MUST NOT echo bearer tokens in reply/event payloads or MQTT properties.
- Requesters SHOULD refresh/replace expired tokens before retrying protected requests.
Optional Untrusted-Broker Security Profile
- This profile defines an optional end-to-end payload protection mode for environments where broker/topic ACLs are not sufficient to guarantee confidentiality.
- Profile identifier:
- MQTT User Property key:
a2a-security-profile - value:
ubsp-v1
- MQTT User Property key:
- When
a2a-security-profile=ubsp-v1is set on a request, requester and responder MUST use end-to-end encrypted payloads for all request, reply, and stream messages for that interaction. - Under
ubsp-v1, payloads MUST use JOSE JWE serialization:- MQTT
Content TypeMUST beapplication/jose+json(JSON serialization) orapplication/jose(compact serialization).
- MQTT
- Requesters MUST encrypt request payloads to the target responder public key resolved from trusted agent metadata (for example Agent Card extensions such as
jwksUri, or trusted OIDC/OAuth metadata links). - Responders MUST encrypt reply/stream payloads to the requester public key resolved from trusted metadata.
- Requesters using
ubsp-v1MUST provide discoverable public key metadata so responders can resolve a reply encryption key. - Under
ubsp-v1, request publications MUST include MQTT User Properties:- key:
a2a-security-profile, value:ubsp-v1 - key:
a2a-requester-agent-id, value: requesteragent_id - key:
a2a-recipient-agent-id, value: intended responderagent_id
- key:
- Under
ubsp-v1, response publications MUST include MQTT User Properties:- key:
a2a-security-profile, value:ubsp-v1 - key:
a2a-requester-agent-id, value: requesteragent_id - key:
a2a-responder-agent-id, value: responderagent_id
- key:
- Implementations MAY include
a2a-recipient-kidto indicate the JWKkidused for encryption. - Responders MUST verify that
a2a-recipient-agent-idmatches local responder identity before processing aubsp-v1request; mismatches MUST be rejected astransport_protocol_error. - Requesters and responders using
ubsp-v1SHOULD enforce replay protection for protected payloads (for examplejtiand short-livedexpclaims in protected content). - This profile reduces payload confidentiality/integrity dependency on broker ACL correctness, but does not replace transport TLS, authentication, or authorization requirements in this specification.
Optional MQTT Native Binary Artifact Mode
- Baseline interoperability remains JSON payloads, where binary
Part.rawcontent is represented using base64 in JSON serialization. - Implementations MAY support an optional native binary artifact mode for high-throughput scenarios.
- Mode selection for artifact encoding is controlled by request MQTT User Property
a2a-artifact-mode. - Requesters MAY set
a2a-artifact-modeto one of:json(default, JSON-compatible artifact payloads)binary(native MQTT binary artifact payloads)
- If
a2a-artifact-mode=binaryis requested and supported by the responder, the responder MAY publish artifact chunks as raw binary payloads on the reply stream topic. - If
a2a-artifact-modeis absent, unknown, or unsupported by the responder, implementations MUST usejsonmode. - Responders SHOULD indicate the chosen mode in reply messages using MQTT User Property:
- key:
a2a-artifact-mode - value:
jsonorbinary
- key:
- Each native binary artifact message MUST:
- echo the request
Correlation Data - set MQTT Payload Format Indicator to
0(unspecified bytes) - use MQTT Content Type when artifact media type is known
- include MQTT User Properties:
- key:
a2a-event-type, value:task-artifact-update - key:
a2a-task-id, value: task identifier - key:
a2a-artifact-id, value: artifact identifier - key:
a2a-chunk-seqno, value: chunk sequence number - key:
a2a-last-chunk, value:trueorfalse
- key:
- optionally include:
- key:
a2a-context-id, value: context identifier
- key:
- echo the request
- MQTT User Property values are UTF-8 strings; non-string metadata MUST be string-encoded.
- Native binary artifact messages SHOULD use MQTT QoS 1.
a2a-last-chunk=trueindicates artifact chunk completion only; stream completion semantics still follow terminal task status (TASK_STATE_COMPLETED,TASK_STATE_FAILED,TASK_STATE_CANCELED).
Optional Broker-Managed Status via MQTT User Properties
To improve discovery liveness, a broker MAY attach MQTT v5 User Properties when forwarding discovery messages to subscribers.
Recommended properties:
- key:
a2a-status, value:"online"when a registration is accepted or the agent is active - key:
a2a-status, value:"offline"when the agent is observed offline - key:
a2a-status-source, value:"broker"to indicate transport-level broker status
Subscribers MUST treat these status properties as advisory transport metadata and MUST NOT treat them as replacement for card payload semantics.
Error Handling and Deduplication
- Requesters and responders MUST tolerate duplicate delivery behavior possible with MQTT QoS 1.
- Requesters SHOULD de-duplicate stream/reply items using available keys, such as
Correlation Data,a2a-task-id,a2a-artifact-id, anda2a-chunk-seqno. - Unknown
a2a-User Properties SHOULD be ignored unless marked mandatory by this profile. - Implementations MAY use MQTT Message Expiry Interval for stale-request control.
- If message expiry indicates the request is stale before processing, responders SHOULD drop it and MAY publish an expiration-related error when a valid reply path exists.
Mandatory Binding-Specific Error Mapping (JSON-RPC over MQTT)
- Error replies on MQTT request/reply paths MUST use JSON-RPC
errorobjects. - Error replies MUST echo the request MQTT
Correlation Data. - For generic JSON-RPC and A2A method/application errors (for example parse, invalid request, method not found, invalid params, authn/authz failures), implementations MUST follow the core A2A/JSON-RPC definitions.
- This MQTT binding defines the following mandatory transport-specific mapping:
| Condition | JSON-RPC error.code | error.data.a2a_error |
|---|---|---|
| Request expired before processing | -32003 | request_expired |
| Temporary responder unavailable/overloaded | -32004 | responder_unavailable |
| MQTT binding protocol metadata invalid | -32005 | transport_protocol_error |
- For
-32003to-32005, responders MUST includeerror.data.a2a_errorexactly as shown above. transport_protocol_errorcovers invalid or missing MQTT binding metadata required by this profile (for example malformed or missing request/reply binding properties).- Requesters MUST treat
-32003and-32004as retry-eligible at application policy level; transport-layer retries still followRequester Retry and Timeout Profile. - Requesters MUST treat
-32005as non-retryable unless request metadata is corrected.
Conformance Levels
Core Conformance
An implementation is Core conformant if it supports:
- Discovery retained topic model
- Request/reply topic model
- MQTT 5 reply correlation mapping (Response Topic + Correlation Data)
- Requester and responder interop behavior defined in this profile
- QoS interoperability support: MQTT QoS 1 on discovery, request, and reply paths
- Mandatory error-code mapping defined in this profile
Extended Conformance
An implementation is Extended conformant if it additionally supports one or more of:
- Trusted JKU policy enforcement
- Broker-managed status via MQTT User Properties
- Extended observability over request/reply/event traffic
- Native binary artifact mode over MQTT
- Shared-subscription request dispatch
- Untrusted-broker security profile (
ubsp-v1)
Future Work
- HTTP JSON-RPC and A2A over MQTT interop
- SSE and WebSocket transport guidance for streaming and bidirectional flows
- Cross-broker conformance test suite and certification profile