プロトコル比較
| Aspect | MCP | A2A |
|---|---|---|
| Spec Status | AdCP が規定 | プロトコル標準機能 |
| Configuration | pushNotificationConfig | pushNotificationConfig |
| Envelope | mcp-webhook-payload.json | Task または TaskStatusUpdateEvent |
| Data Location | result フィールド | status.message.parts[].data |
| Data Schemas | 同一 の AdCP スキーマ | 同一 の AdCP スキーマ |
Webhook 設定
MCP Webhooks
MCP はプッシュ通知を定義していません。AdCP がpushNotificationConfig とペイロード形式を規定して補完します。
A2A Webhooks
A2A はプッシュ通知を標準で定義しています:Webhook が送信される条件
次の すべて を満たすと Webhook が送信されます:- 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)なら Webhook は送信されません(すでに結果が手元にあるため)。
Webhook を送るステータス変化:
working→ 進捗更新input-required→ 人の入力が必要completed→ 最終結果failed→ エラー詳細canceled→ キャンセル確定
Webhook ペイロード形式
MCP ペイロード
A2A ペイロード
A2A sendsTask (for final states) or TaskStatusUpdateEvent (for progress updates):
ステータス別データスキーマ
| Status | Data Schema | Contents |
|---|---|---|
completed | [task]-response.json | 成功ブランチの完全レスポンス |
failed | [task]-response.json | エラーブランチの完全レスポンス |
working | [task]-async-response-working.json | 進捗情報(percentage, step) |
input-required | [task]-async-response-input-required.json | 必要事項、承認データ |
submitted | [task]-async-response-submitted.json | 受領通知(通常最小限) |
Webhook 認証
AdCP は A2A の PushNotificationConfig を Webhook 設定に採用しています:対応する認証方式
Bearer Token(シンプル、開発に推奨)パブリッシャー側実装例(Bearer)
パブリッシャー側実装例(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