AdCP server whose registered tools this adapter exposes over A2A.
OptionalauthenticateAuthenticate an inbound A2A request. Transport-level auth runs
before AdcpServer.invoke() so the framework pipeline sees a
verified authInfo. Return null (or throw) to reject.
Seller-supplied agent-card identity fields. Required.
OptionaltaskA2A task store. Tests and development default to the SDK's in-memory store. Production must supply a bounded, durable implementation.
OptionalloggerOptional logger. Falls back to console.
OptionallegacyControls the official A2A SDK's v0.3 compatibility handlers and agent-card
interface. Defaults to { enabled: true } for backwards compatibility.
Set enabled: false to expose only the native A2A 1.0 path.
OptionalpreRFC 9421 request-signature gate for the JSON-RPC endpoint. Defaults to the
verifier that createAdcpServer({ signedRequests }) attaches to server,
so a seller that configures signedRequests enforces required_for,
protocol_methods_required_for and the webhook-authentication rule over
A2A exactly as it does over MCP. Pass it explicitly when you wired the
verifier by hand (serve({ preTransport })).
The gate runs on every POST to the JSON-RPC endpoint, before
A2AAdapterOptions.authenticate. The adapter buffers the request
body itself so the gate sees the exact signed bytes, resolves the AdCP
operation from the Message's sole DataPart (skill), and rejects a body
that does not resolve to exactly one operation with request_body_malformed
before any handler runs. The dispatcher then runs only that operation.
Unlike authenticate, a gate rejection is an HTTP 401 carrying
WWW-Authenticate: Signature error="<code>".
A verified signature is surfaced to handlers as ctx.authInfo
(clientId: signing:<keyid>). When authenticate is also set, its result
stays authoritative and must carry the same clientId.
Body capture: do not mount a body parser ahead of the adapter unless it
records the raw bytes (express.json({ verify: adapter.rawBodyVerify }));
a request whose raw body is unavailable is rejected.
OptionalsignedCanonical URL a client signed for this request (the signature's
@target-uri). Defaults to the origin of agentCard.url plus the request's
original path and query. Override when a path-rewriting proxy changes the
path between the client and this process. Never derive it from a
client-controlled Host / X-Forwarded-* header.
OptionalallowAcknowledge that a seller advertising signed-requests / request_signing
is not verifying signatures on this adapter (for example, an authenticating
gateway in front of it does). Without this, createA2AAdapter refuses to
construct when server advertises request signing but no gate is wired,
because the advertisement would be false for A2A.
Options for createA2AAdapter.
Auth posture.
authenticate(req)runs BEFORE the tool handler sees the request. Return anAdcpAuthInfoto let the pipeline proceed with that principal; returnnull(or throw) to reject. A rejection currently surfaces as a generic JSON-RPC-32000server error — the@a2a-js/sdkdoesn't yet expose a typed authentication-failed code for theUserBuilderpath. Production deployments SHOULD wire upstream middleware (e.g.express-jwt) to reject with a proper HTTP 401 / WWW-Authenticate challenge before the request reachesjsonRpcHandler. Theauthenticateoption here is a last-line-of-defense guard, not the primary auth surface.Agent-card
securitySchemes. Legacy 0.3 OpenAPI-style schemes are converted to the A2A 1.0 union and unsupported shapes fail at startup. Only put non-secret discovery data there (token endpoint, scopes, OIDC issuer URL). Never paste client secrets, private JWKS, or internal URLs into the card.Omitting
authenticatemakes the adapter anonymous — handlers seectx.authInfo === undefined, matchingserve({ authenticate: undefined }).