kaiin
Blog

Published 2026-10-31 · L'Alternative Fabrique

MCP vs A2A: the difference, with a working architecture

Listen to this article

0:00

MCP connects an agent to its tools. A2A connects applications and other agents to an agent. They sit on opposite sides of the same process, so a production agent usually speaks both.

How do they compare?

MCPA2A
DirectionAgent calls outCaller calls in
CalleeA toolAn autonomous agent
DiscoveryTool listAgent card
Typical callRead a CRM recordAsk the research agent for an analysis

How does serving over A2A look?

With the Cortex SDK, host.New builds the server and Handler() exposes POST /a2a (JSON-RPC) and GET /.well-known/agent.json:

h, err := host.New(ctx, host.Config{
	Agent:    host.Agent{Name: "hello"},
	Provider: provider,
	Token:    "tok",
})

A caller gets text with client.Say, or typed output with client.Ask[T], which sends a schema reflected from T and decodes the answer.

How do tools arrive through MCP?

Tools are named <server>__<tool>. Per-turn mcpHeaders reach the MCP call and never the model, which keeps a user's token out of the prompt.

What are the security differences?

A2A is a normal authenticated API: bearer token or JWT, and the card stays public. MCP is the riskier side, because a server's descriptions and schemas reach the model. Grant servers per agent, and remember that a stdio server inherits the process environment in Cortex.

How does it scale?

Turns run in process by default. With connectors/cluster, they go through a NATS JetStream work queue, and a per-conversation lock keeps each conversation's turns in order.