Skip to main content
Pick your path. Buyers call the public test agent in 5 minutes. Publishers and sellers stand up an agent buyers can call.

I'm calling an agent

Buyer side. The rest of this page walks through calling the public test agent — no signup, copy-pasteable curl.

I'm building an agent

Publisher or seller side. Stand up an agent buyers can call.

Setup

Use the public test token to get started immediately — no signup required:
The test agent is path-routed: /sales/mcp serves media-buy tools (this quickstart’s path), and sibling URLs serve the other specialisms — /signals/mcp, /governance/mcp, /creative/mcp, /creative-builder/mcp, /brand/mcp. Hit /.well-known/adagents.json for the full tenant + tool list. For your own API key (org-scoped, usage tracking), create one at the AAO dashboard. To test an OAuth connect flow, use /sales/mcp and follow its 401 WWW-Authenticate challenge to the protected-resource metadata at /.well-known/oauth-protected-resource/sales/mcp. The metadata links to current OAuth connection instructions, served by the training agent. Use the advertised authorization server, PKCE, and the exact resource indicator https://test-agent.adcontextprotocol.org/sales/mcp. Sign in with an AgenticAdvertising.org account and select an organization where you have an active owner, admin, or member role. The OAuth credential uses an organization-scoped sandbox; a paid subscription is not required. Other specialism endpoints continue to use bearer test tokens or API keys. Live GCS reporting under /sales/reporting is limited to owners and admins of the private training buyer canary organization with provisioned local grants. Those callers retain their private buyer identity on /sales/mcp; ordinary members of the canary organization use the separate sandbox. A denied OAuth call returns 403 with BUYER_ACCESS_DENIED, an error_description, and a WWW-Authenticate: Bearer error="insufficient_scope" header. Surface the description instead of retrying sign-in or treating it as an MCP discovery failure. If you have no organization access, use the shared bearer token above.

1. Discover products

AdCP over MCP uses JSON-RPC 2.0. The transport is Streamable HTTP — responses arrive as server-sent events.
Response (SSE envelope omitted for clarity):
Extract the result — the AdCP payload is JSON-encoded inside content[0].text:

2. Handle errors

Send an invalid tool name to see what errors look like:
Response:
Handle it — check isError, then parse the error payload:
Common error codes: INVALID_REQUEST (bad input), RATE_LIMITED (retry with backoff), UNAUTHORIZED (check credentials).

3. Create a media buy (idempotently)

Use the product IDs from step 1 to create a campaign. Every mutating request MUST carry an idempotency_key — a client-generated UUID v4 that makes retries safe. Send the same key with the same payload and the seller returns the original result instead of creating a duplicate buy:
Replay the same request (same key, same payload) and the seller returns the original response with replayed: true. Send the same key with a different payload and you get IDEMPOTENCY_CONFLICT. Check a seller’s window via get_adcp_capabilities:
See the Security guide for the full retry model, including IDEMPOTENCY_CONFLICT, IDEMPOTENCY_EXPIRED, and UUID v4 guidance for AdCP Verified agents. Response (IDs will differ on each call):
Extract the result:

4. Push notifications (signed webhooks)

Production agents send webhooks for long-running operations. AdCP 3.0 signs webhooks with the same RFC 9421 HTTP Message Signatures profile used for agent-to-agent requests — one verifier, one JWKS, one trust surface. No shared HMAC secrets. Point the agent at your webhook endpoint and advertise your JWKS. The agent signs each POST with a key it trusts; you fetch the agent’s JWKS and verify the signature before acting on the payload:
When the operation completes, the agent POSTs a signed request to your URL. The payload carries its own idempotency_key so your receiver can dedupe retries:
Verify the signature before trusting the payload — resolve the keyid with Agent resolution (the seller’s identity.brand_json_url leads to its brand.json agents[].jwks_uri), keep only keys that match any publisher adagents.json signing_keys[] pin that applies, run the AdCP webhook verifier checklist, and reject unknown keys, expired dates, or mismatched digests with a typed webhook_signature_* reason code:
See the Security guide and Webhooks guide for the full verification profile — required headers, covered components, nonce and date windows, and the negative-vector suite the compliance runner exercises.

Using the client library

The examples above use raw HTTP for clarity. In practice, use the AdCP client library which handles SSE parsing, retries, and authentication:

What’s next