The A2A JSON-RPC middleware (message/send, tasks/get, tasks/cancel).
The agent-card discovery GET middleware.
Returns the merged, validated agent card.
Wire all A2A routes onto an Express-compatible app in one call.
Eliminates the "card mounted at only one location" footgun: the
A2A SDK derives ${agentCard.url}/.well-known/agent-card.json for
discovery, while many clients also probe origin root — this helper
satisfies both. See A2AMountOptions to override paths.
Optionaloptions: A2AMountOptions
Value returned by createA2AAdapter.
For almost every seller,
adapter.mount(app)is the right entry point — it wires all four routes (JSON-RPC at the agent-card's path, the agent card at both{basePath}/.well-known/agent-card.jsonfor A2A discovery and/.well-known/agent-card.jsonfor origin-root probes) with one call.The
jsonRpcHandlerandagentCardHandlerfields stay exposed for deployments that need finer control (mounting behind a custom auth layer, serving the card from a CDN, testing).