Protocol Comparison
| Aspect | MCP | A2A |
|---|---|---|
| Spec Status | AdCP specifies this | Native protocol feature |
| Configuration | pushNotificationConfig | pushNotificationConfig |
| Envelope | mcp-webhook-payload.json | Task or TaskStatusUpdateEvent |
| Data Location | result field | status.message.parts[].data |
| Data Schemas | Identical AdCP schemas | Identical AdCP schemas |
Configuring Webhooks
MCP Webhooks
MCP doesn’t define push notifications. AdCP fills this gap by specifying the webhook configuration (pushNotificationConfig) and payload format.
A2A Webhooks
A2A defines push notifications natively:When Webhooks Are Called
Webhooks are triggered when all of the following are true:- Task type supports async execution (e.g.,
get_products,create_media_buy,sync_creatives) pushNotificationConfigis provided in the request- Task requires async processing — initial response is
workingorsubmitted
completed, failed, rejected), no webhook is sent — the client already has the final result.
Status changes that trigger webhooks:
working→ Progress updateinput-required→ Human input neededcompleted→ Final result availablefailed→ Error detailscanceled→ Cancellation confirmed
Webhook Payload Formats
MCP Payload
A2A Payload
A2A sendsTask (for final states) or TaskStatusUpdateEvent (for progress updates):
Status-Specific Data Schemas
| Status | Data Schema | Contents |
|---|---|---|
completed | [task]-response.json | Full task response (success branch) |
failed | [task]-response.json | Full task response (error branch) |
working | [task]-async-response-working.json | Progress info (percentage, step) |
input-required | [task]-async-response-input-required.json | Requirements, approval data |
submitted | [task]-async-response-submitted.json | Acknowledgment (usually minimal) |
Webhook Authentication
AdCP adopts A2A’s PushNotificationConfig structure for webhook configuration:Supported Authentication Schemes
Bearer Token (Simple, Recommended for Development)Publisher Implementation (Bearer)
Publisher Implementation (HMAC-SHA256)
Buyer Implementation (Bearer)
Buyer Implementation (HMAC-SHA256)
Webhook Reliability
Delivery Semantics
AdCP webhooks use at-least-once delivery semantics:- Not guaranteed: Webhooks may fail due to network issues, server downtime, or configuration problems
- May be duplicated: The same event might be delivered multiple times
- May arrive out of order: Later events could arrive before earlier ones
- Timeout behavior: Webhook delivery has limited retry attempts and timeouts
Retry Strategy
Publishers should use exponential backoff with jitter:- Attempt 1: Immediate
- Attempt 2: After ~1 second (with jitter)
- Attempt 3: After ~2 seconds (with jitter)
- Attempt 4: After ~4 seconds (with jitter)
- Give up after 4 total attempts
Circuit Breaker Pattern
Publishers must implement circuit breakers to prevent webhook queues from growing unbounded:- CLOSED: Normal operation, webhooks delivered
- OPEN: Endpoint is down, webhooks are dropped (not queued)
- HALF_OPEN: Testing if endpoint recovered, limited webhooks sent
Queue Management
Publishers should implement bounded queues with overflow policies:- Set max queue size based on available memory and recovery time
- Monitor queue depth and dropped webhook counts
- Alert operations when queues are consistently full
- Use dead letter queues for manual investigation of persistent failures
- Implement queue per buyer endpoint (not global queue)
Idempotent Webhook Handlers
Always implement idempotent handlers that can safely process the same event multiple times:Sequence Handling
Use timestamps to ensure proper event ordering:Polling as Backup
Never rely solely on webhooks. Use polling as a reliable backup:Reporting Webhooks
In addition to task status webhooks, AdCP supports reporting webhooks for automated delivery performance notifications.Configuration
Payload Structure
Implementation Requirements
- Array Handling: Always process
media_buy_deliveriesas an array (may contain 1 to N media buys) - Idempotent Processing: Same as task webhooks - handle duplicates safely
- Sequence Tracking: Use
sequence_numberto detect gaps or out-of-order delivery - Fallback Strategy: Continue polling
get_media_buy_deliveryas backup - Delay Handling: Treat
"delayed"notifications as normal, not errors
Best Practices Summary
- Always implement polling backup - Don’t rely solely on webhooks
- Handle duplicates gracefully - Use idempotent processing with event IDs
- Check timestamps - Ignore out-of-order events based on timestamps
- Return 200 quickly - Acknowledge webhook receipt immediately
- Verify authenticity - Always validate webhook signatures
- Log webhook events - Keep audit trail for debugging
- Set reasonable timeouts - Don’t wait forever for webhook delivery
- Graceful degradation - Fall back to polling if webhooks consistently fail
Next Steps
- Task Lifecycle: See Task Lifecycle for status handling
- Error Handling: See Error Handling for webhook errors
- Security: See Security for webhook security patterns