10. Agent Communication Protocols
MCP vs A2A and Interoperability
MCP and A2A are complementary contracts: MCP plugs tools, resources, and prompts into an AI host; A2A lets autonomous peer agents discover each other and delegate tasks across products or orgs. Interoperability means stacking them — your planner uses MCP for local capabilities and A2A when another agent must plan — with shared policy for allowlists, budgets, HITL, and untrusted outputs. Choosing the wrong contract creates brittle glue or unnecessary distribution.
What you will learn
- Compare MCP and A2A on roles, primitives, and boundaries
- Design a stacked agent that uses both protocols
- Decide MCP vs A2A with a clear rule of thumb
- Apply shared safety controls across both contracts
- Answer interview questions with short, solid answers
Definition
MCP vs A2A is not a rivalry to pick a winner — it is a mapping problem: if the other party is a capability provider (tool/context), use MCP (or local tools); if the other party is an autonomous peer that should plan and return artifacts, use A2A. Interoperability is the architecture where one agent stack speaks both without confusing the two.
This lesson closes Module 10 by locking that distinction and showing a practical combined pattern.
Introduction
This lesson (#7 in Agent Communication Protocols) follows A2A Architecture, Discovery and Delegation. You know each protocol; now compare and combine them.
Next module: Security & Ethics — starting with AI Agent Security.
Side-by-side
- Relationship - MCP: host↔server; A2A: agent↔agent
- Unit of work - MCP: tool call / resource read; A2A: task
- Autonomy - MCP server executes a capability; A2A peer plans
- Discovery - MCP lists tools/resources; A2A uses agent cards
- Boundary - MCP often same product; A2A often cross-org
- Latency model - MCP usually request/response; A2A often long-running
Interoperability pattern
Stack protocols instead of forcing one to do the other’s job.
- Your agent plans under host policy
- MCP servers supply local/org tools and context
- A2A peers handle specialist goals you should not own
- Peer agents may call MCP on their side — opaque to you
- Unify tracing: correlate agent step, MCP call id, A2A task id
Decision rule
Start from what the other party is, not from hype.
- Need a deterministic API/action? → MCP tool (or OpenAPI)
- Need readable context? → MCP resource
- Need another planner across a boundary? → A2A task
- In-process multi-agent crew only? → framework graph; protocol optional
- Unsure? prototype as MCP first; promote to A2A when autonomy is required
Shared governance
- Allowlists for servers and for peer agents
- HITL before writes and before high-stakes delegation
- Budgets on tool calls and on remote task duration/cost
- Treat MCP results and A2A artifacts as untrusted
- Least-privilege credentials on every side
- One security review checklist covering both protocols
Anti-patterns
- Wrapping a simple HTTP GET as an A2A “agent”
- Expecting MCP to negotiate multi-day peer workflows
- Sharing prod credentials to remote agents via task parts
- No correlation ids across MCP and A2A hops
- Dual-running duplicate logic on both protocols for the same action
Migration and coexistence
- Keep existing OpenAPI tools; expose via MCP when multi-host reuse matters
- Add A2A only for true cross-team specialists
- Version both contracts; pin compatible clients
- Eval separately: tool success vs task success rates
Program / implementation notes
Draw your system: list capabilities as MCP tools/resources and specialists as A2A peers. Implement one of each path in a demo agent with shared logging fields (protocol, target, latency, success).
- Document the decision rule in your architecture README
- Next: AI Agent Security
Advantages and limitations
- Advantage: clear separation of tools vs peers
- Advantage: reuse MCP servers inside many agents including A2A peers
- Advantage: one mental model for interviews and design reviews
- Limitation: two stacks to secure and observe
- Limitation: protocol churn on both sides
- Limitation: teams may over-distribute with A2A too early
Key points
- MCP: host↔server tools/resources/prompts; A2A: agent↔agent tasks.
- Stack them: MCP for capabilities, A2A for peer planners.
- Decision: if the other party must plan, use A2A; else MCP.
- Share allowlists, HITL, budgets, and untrusted-output handling.
- Correlate traces across both protocols.
- Do not fake agents for simple tools.
FAQs
Can MCP replace A2A?
No. MCP does not standardize peer agent discovery and long-running task delegation across autonomous parties.
Can A2A replace MCP?
Poorly. Using peer agents for every button-click tool adds latency and trust complexity. Prefer MCP for ordinary capabilities.
Do A2A peers use MCP?
Often yes. A remote agent can expose A2A externally while calling MCP servers privately for its tools and data.
What about OpenAPI?
OpenAPI still describes HTTP APIs. MCP can wrap them for host discovery; A2A sits above when another agent owns the workflow.
Interview questions
- How do MCP and A2A differ?
Answer MCP connects an AI host to tool/context servers. A2A connects agents to peer agents for discovery and task delegation. Different primitives and trust boundaries.
- When use MCP vs A2A?
Answer Use MCP for deterministic tools and resources. Use A2A when another autonomous agent must plan and deliver artifacts across a product or org boundary.
- How do they interoperate?
Answer A planner agent calls MCP servers for local capabilities and delegates to A2A peers for specialist work; peers may use their own MCP tools internally.
- What shared controls apply to both?
Answer Allowlists, authentication, HITL for high-risk actions, budgets/timeouts, least-privilege credentials, and treating returned content as untrusted.
- Name an anti-pattern.
Answer Exposing a simple CRUD API as an A2A agent, or expecting MCP alone to manage multi-day cross-vendor agent collaboration.
- How do you observe a dual-protocol agent?
Answer Emit correlated traces with protocol type, target id, latency, and success for both MCP calls and A2A task state transitions.
Related topics
Practice task
Complete each numbered practice step in a notebook or doc before opening the next lesson.
- Classify eight integrations in your domain as MCP, A2A, or local-only.
- Draw one stacked diagram: agent → MCP servers + A2A peers.
- Write the one-sentence decision rule for your team wiki.
- List shared security controls that apply to both protocols.
- Answer interview questions 1, 2, and 3 in two sentences each.