An Agent Inside MCP: Is A2A Still Needed?

MCP now has tasks, events and skills, which sounds a lot like an agent protocol. I served one durable agent over MCP and over A2A, ran the same scenarios against both, and built a chat UI that shows every frame on the wire.

• 18 mins
An Agent Inside MCP: Is A2A Still Needed?

The year of MCP - 2027
  1. 1. Code Mode That Survives a Crash: Durable Scripts in Pi Durable
  2. 2. Skills over MCP: Two Competitors Meet
  3. 3. An Agent Inside MCP: Is A2A Still Needed?

2025 was supposed to be the year of MCP. Every product announced a server, every agent grew a client, and by the end of it a lot of us had moved on: back to plain CLIs, and on to skills, which arrived late that year.

There were good reasons. A connected server put all of its tool definitions in front of the model in every session, before you typed anything. Running and authenticating a server was more work than letting the agent call gh or aws from its shell. And the protocol was a stateful session built for tools that answer quickly. For most of the year it had nothing for a job that takes an hour, or for a server that needs to tell you something later; tasks only arrived, as an experiment, in the 2025-11-25 revision.

Neither side was ready. The protocol was young, and so were we. Most servers wrapped an API one tool per endpoint, and most of us were still working out which jobs needed a server at all.

The MCP of 2025 is not the MCP of today. In this series I have used it for code mode, where the model writes a script against MCP tools and loads only the definitions it needs, and for skills, where an MCP server hands the agent know-how instead of tools. The 2026-07-28 protocol revision and its extensions bring three more things: a redesigned tasks extension, events and a stateless core.

That is why I think 2027 is set up to be the actual year of MCP: the protocol has caught up with what agents need, and we have learned how to use it.

Put tasks and events next to each other and they sound a lot like an agent protocol. A tool call that turns into a task can run for an hour, report its status, stop to ask a human a question, and be cancelled. Events let a server tell a client when something happens. That is most of what A2A was made for.

When Google announced A2A in April 2025, it pitched it as a partner, not a rival: “an open protocol that complements Anthropic’s Model Context Protocol (MCP), which provides helpful tools and context to agents.” MCP was for tools, A2A was for agents talking to agents. Every MCP release since has moved that line. Elicitation, tasks, events and soon server cards each take over a piece of what A2A was for, and it looks more and more like MCP could replace it entirely.

So I wanted to know: can you just run an agent inside MCP, and do you still need A2A?

The quickest way to find out was to serve the same agent both ways.

The setup: one agent, two doors

The agent is built on Pi Durable 1.7.0. It researches a topic in a few steps, can stop to ask a human for approval, and survives a kill -9. It knows nothing about either protocol and sits behind a small runtime with five calls: start, state, follow, answer and cancel. The research itself is a stand-in: the tool sleeps through a few steps, and the model writes the findings from what it already knows. The point is the protocols, not the research.

On top of that sit two adapters in one process:

  • MCP, revision 2026-07-28, with the TypeScript SDK (@modelcontextprotocol/server 2.4.0) and four extensions: tasks, events, skills and MCP Apps. The agent is one tool, run_agent, and calling it returns a task.
  • A2A 1.0, with @a2a-js/sdk 1.3.0. The agent is a peer with an Agent Card, streaming, input-required and push notifications.

Both share the same Pi Durable storage, so it is the same agent underneath.

I ran nine scenarios against both: discovery, a long task with progress, a human in the loop, cancellation, a crash mid-run, a crash while waiting for the human, hearing about progress without holding the call open, showing the result as a widget, and a second agent calling the first. Those runs use a scripted model, so they cost nothing and make the same calls every time.

Reading frames in a terminal gets old fast, so I also built a small chat UI. You pick the MCP agent or the A2A agent, chat, and a panel on the right shows every frame that went over the wire.

The chat UI with the MCP agent selected. The user asked it to look into the pricing page and confirm before publishing. The task is in input_required, and an amber card asks whether to approve publishing the pricing page as-is, with an answer box and Yes and No buttons. The wire panel on the right lists the frames: tools/call run_agent returning a task, subscriptions/listen for that task, the acknowledgement, and notifications/tasks moving from working to input_required, interleaved with the server's own agent.task.updated events.

Running an agent inside MCP

To an MCP client, the agent is just a tool. You call run_agent with a prompt, the same way you would call any other tool.

The catch is that an ordinary tool call waits for its answer. That’s fine for a tool that answers in a second. It doesn’t work for an agent that might research for an hour, and stop halfway to ask you something. Three pieces handle that.

The call returns a task instead of an answer. A client that supports the tasks extension says so when it makes the call. The server then doesn’t wait for the agent. It starts the run and replies at once with resultType: "task" and a taskId, a handle to the work in progress. From then on the client uses that id: tasks/get to see where the run is, tasks/update to answer a question, and tasks/cancel to stop it.

The human in the loop is elicitation. When the agent wants approval, the task goes to input_required, and tasks/get returns the question as an elicitation request: a message and a JSON Schema for the answer.

{
  "status": "input_required",
  "inputRequests": {
    "ask-7": {
      "method": "elicitation/create",
      "params": {
        "mode": "form",
        "message": "Should I publish the pricing page as-is?",
        "requestedSchema": { "type": "object", "properties": { "answer": { "type": "string" } } }
      }
    }
  }
}

The client sends the answer back with tasks/update, under the same key (ask-7), and the agent carries on.

Status is pushed with the task. The client sends subscriptions/listen with the task’s id, and the server sends notifications/tasks every time the task changes. Each one carries the whole task, exactly what tasks/get would return: the status message, the question, or the result. Push is optional in the spec, so the server’s acknowledgement says which task ids it will notify for. Mine says yes, so my client never polls. The tasks spec forbids notifications/progress on tasks, but it doesn’t need it.

tools/call run_agentstartresultType: task, taskIdsubscriptions/listen taskIdsnotifications/tasks (working: research step 2)parked on ask_humannotifications/tasks (input_required + elicitation form)tasks/update inputResponsessignal answernotifications/tasks (completed + result)ClientMCP serverDurable agentClientMCP serverDurable agent

The surprise was how little the task layer needed. The 2026 core is stateless: there is no session, and the SDK builds a server object per request. Nothing can live on the server object between calls, so every tasks/get and every notification reads the agent’s state from Pi Durable’s storage. The only thing I store is a table mapping each task id to its agent run. I kept no task status or results of my own, and that turned out to be the whole crash story.

A task is one turn, not the whole conversation. Every message the user sends is a new tools/call, and every call gets a new task. A chat needs those turns to land in the same conversation, so the agent remembers what was said before. MCP has nothing for that: with no session there is no id that ties one call to the next, and a task ends when its turn does. So I added a contextId argument to run_agent. The chat UI passes its thread id there on every message, and the agent maps that id to one Pi Durable conversation. Each task is then one turn inside that conversation. Leave contextId out and every call starts a fresh conversation. It works, but it’s my convention: a generic client would only send it because the tool’s input schema asks for it.

Note: The 2.4.0 SDK doesn’t ship a 2026-07-28 tasks receiver yet, so I wrote tasks/get, tasks/update and tasks/cancel myself in about 60 lines. The client side has its own catch: the SDK’s Client throws on resultType: "task", so my client goes through the ext-tasks package with a raw HTTP dispatcher. Task notifications took about 60 more lines, in front of the SDK: it answers subscriptions/listen itself, only knows the core notification types, and acknowledges a request for task ids with an empty filter ({}) and closes the stream. The events extension has no SDK support at all, which took another 70 lines.

The MCP server also ships a skill, run-agent, and this one isn’t for my agent. It’s for the agent on the other end: whatever coding agent or assistant connects to the server as a client. The skill tells that client’s model when to hand a job to run_agent instead of doing it itself, to pass the same contextId to stay in one conversation, and how to follow the task that comes back. It uses the skills extension from the previous post, and with the SDK it took two lines.

The same agent over A2A

This side needed less of my code, because its SDK does more of the work. It has an AgentExecutor interface, a task store and a push sender. I wrote an executor that starts the agent and turns its state changes into A2A events, plus a SQLite task store so tasks outlive the process.

Discovery is a static Agent Card at /.well-known/agent-card.json. A message goes out with SendStreamingMessage, and back comes a stream of status updates and answer chunks. When the agent wants approval, the task goes to TASK_STATE_INPUT_REQUIRED with a plain-text question, and the client answers by sending a new message on the same taskId.

Conversations are built into A2A. Every task belongs to a contextId, which the server assigns on the first message. The client sends that contextId with each later message, so every new task joins the same conversation. I mapped it straight to a Pi Durable conversation, with no argument of my own.

The chat UI with the A2A agent selected. The agent's task is in TASK_STATE_INPUT_REQUIRED, and an amber card says the agent is waiting, asking whether to publish the pricing page as-is or hold off, with an answer box and Yes and No buttons. The wire panel shows the agent card fetch, SendStreamingMessage, a stream of statusUpdate and artifactUpdate frames, and a final INPUT_REQUIRED status.

Where they differ

Most of the scenarios came out the same on both sides. These are the ones that didn’t.

Crash recovery. I killed the server with kill -9 mid-task and started it again on the same data. On MCP, the client called tasks/get with the old taskId and saw the task finish. There was nothing to restore, because the task’s state never lived in the server. The only thing that restarts at boot is the loop that feeds notifications, a few lines that follow unfinished runs again.

On A2A, the task stayed TASK_STATE_WORKING forever. The SDK keeps the task records in the store, but it runs the work on an in-process event bus, and that bus died with the process. Pi Durable had already resumed the agent underneath, but nothing told A2A. This is the JS SDK’s design, not the protocol’s: nothing in A2A stops a server from deriving GetTask from durable storage. I fixed it with about 25 lines that run at startup, find unfinished tasks and follow their agents again. You can turn that off with A2A_NO_RECONCILE=1 and watch the task hang.

Both protocols give you a handle on a task, and Pi Durable is what kept the work alive. Neither protocol makes the work durable; MCP’s stateless shape just makes durable state easier to expose.

Asking the human. MCP’s question is a standard elicitation form with a JSON Schema, so any client knows what shape of answer to collect. A2A’s is an ordinary message: plain text here, and it could carry structured data or an A2UI form, but only if both sides agree on the format. Both survived a crash while waiting: the question was still there after the restart, and the answer still reached the agent.

Streaming the answer. This is A2A’s clear win. A streamed answer arrives as artifactUpdate chunks with append: true, and the final text replaces them. Any A2A client gets it.

MCP can stream the task’s status, but not its answer. The result exists only once the task completes. So the server also publishes its own event type, agent.task.updated, with the partial text in it, and my UI reads it over events/stream. It works, but it is my own convention. Another MCP client gets every status change, but not the text as it is written.

Hearing back when you’re not connected. A2A has push notifications: a webhook per task that the server POSTs every update to. MCP’s task notifications only reach a client that is listening. The events extension does have webhooks, and a server could deliver its own task event that way, but the events docs point you back to tasks for “a long-running operation it started itself”, and the Tasks proposal left webhooks for task completion as future work. The Tasks and Events working group now owns that job, and hasn’t specified it yet.

MCP 2026-07-28 A2A 1.0
Discovery server/discover, tools/list, skills/list Agent Card
Starting work tools/call returns a task SendMessage / SendStreamingMessage
Conversation id None; I added a contextId argument Built in: contextId and taskId
Asking the human Standard elicitation form, answered with tasks/update A message (no standard form), answered with a new message
Streaming the answer Not standard; my own event payload Native artifact chunks
Status updates Optional push while you listen (notifications/tasks), or poll tasks/get Streamed (SendStreamingMessage, SubscribeToTask), or poll GetTask
Callback when disconnected None for tasks yet Push webhooks
After a crash State is derived, nothing to restore With the JS SDK, needs reconcile code at startup
Skills Ships know-how to the caller’s model Advertises what the agent can do
Showing the result as UI MCP Apps: the server’s HTML in a sandboxed iframe A2UI: a component tree drawn by the client
My code on top of the SDK Tasks receiver, task notifications, events (poll and push) Executor, task store, startup reconcile

Note: The discovery row is about to get closer. MCP Server Cards, now carried on as SEP-2127, let a server describe itself in a static card that a client can fetch before it connects: its name, transports, capabilities and auth. That is the discovery half of what an A2A Agent Card does today; Agent Cards also list skills and can be signed. The two are still separate specs, and the card’s exact URL is still moving, but once it lands, finding an agent no longer needs A2A.

Showing the result: MCP Apps vs A2UI

A text answer is fine for a chat, but a research agent’s result wants to be a card: findings and a few buttons for what to do next. Both sides now have a standard way to do that, and they could hardly be more different.

I gave the agent one more tool, present_report, which takes a title, findings and two next steps. The tool itself does nothing. Each protocol adapter takes its arguments and turns them into UI: on MCP they become structuredContent in the task’s completed result, on A2A an A2UI artifact.

MCP Apps ships the server’s own UI. MCP Apps is the io.modelcontextprotocol/ui extension (spec 2026-01-26). The run_agent tool points at a ui://research/report.html resource in its _meta. When the task completes, the host reads that resource and runs it in a sandboxed iframe, then sends the tool’s input and structured result over postMessage. The page renders the card. Its next-step buttons send ui/message, which asks the host to post a chat message as the user. Its thumbs-up and thumbs-down buttons call rate_report, a tool marked as visible only to the app, so the model never sees it. The host decides whether to let that call through.

The chat UI with the MCP agent. Under the answer is a report card in a dashed green frame labelled MCP App, ui://research/report.html, sandboxed iframe. The card has the title Durable Execution for AI Agents, four detailed findings about checkpointing, Temporal, LangGraph and Restate/Inngest, two follow-up buttons and a Was this useful? row with thumbs up and down. The wire panel ends with resources/read of the ui:// resource and the frames between the host and the View: ui/initialize, ui/notifications/initialized, ui/notifications/tool-input, ui/notifications/tool-result and ui/notifications/size-changed.

A2UI ships a description, and the client draws it. A2UI is Google’s declarative UI format, now at 1.0. Over A2A it is an extension: the Agent Card lists which component catalogs the agent can generate, and on each message the client says it has a renderer. The agent then sends an artifact with a list of A2UI messages: create a surface, here are its components (Card, Column, Text, Button and so on), here is its data. The client draws the surface with its own components. When you click a button, the client sends the action back to the agent as an A2A message.

The chat UI with the A2A agent. Under the answer is a report card labelled A2UI 1.0, basic catalog, native components. It has the title Durable execution for AI agents, four detailed findings, and two purple and white buttons for follow-up steps, drawn in the chat UI's own fonts and colours. The wire panel shows the agent card fetch, SendStreamingMessage and a stream of statusUpdate and artifactUpdate frames.

They look alike in the screenshots. Underneath, they make opposite trade-offs.

With MCP Apps, the server owns the UI. It can be anything a web page can be: a chart, an editor, a map. The price is that you are running someone else’s code, so it lives in a sandbox. It matches your app only if the page bothers to read the host’s styles.

With A2UI, the client owns the UI. No code crosses the wire, only JSON that the renderer checks against the catalog. That check caught a bug of mine on the first run: component ids have to be identifiers, and I had used hyphens. The catch is that the agent can only use what the catalog has, and “looks native” is the client’s job. The renderer’s default theme follows the system’s dark mode, so on my phone it drew a black card inside my light page until I mapped its CSS variables to my palette.

Both can act without a new chat turn. An MCP App can call a server tool through the host, as with rate_report, and visibility: ["app"] keeps that tool out of the model’s tool list. A2UI 1.0 has typed function calls: a button can run a function in the client, or call one on the agent with callAgentFunction. My adapter only uses the simplest kind, an action that goes back to the agent as the next turn.

For a remote agent you don’t fully trust, A2UI is safer. For a product that wants its own interface inside every host, MCP Apps is stronger. A2UI is not tied to A2A, either, so nothing stops an MCP server from returning it. I expected A2A to come out ahead here, and MCP had an answer ready.

Two agents, talking

Everything so far had a person on the calling end. A2A’s whole pitch is agents calling agents, so I added a second agent and had it call the first one.

The orchestrator is another Pi Durable agent with different tools. It doesn’t research anything itself. Its delegate tool hands the job to the research agent, over MCP or over A2A, and waits. The wait is durable: the tool parks with the remote task id, a small follower watches that task, and a signal wakes the tool when the task finishes or asks a question. When the research agent asks something, the orchestrator decides. It answers from what its user already said, or it asks its user and passes the answer down with answer_delegate.

The chat UI with the orchestrator agent over MCP selected. The user asked it to look into the pricing page and confirm before publishing. An amber card says the research agent asks whether to proceed with the current tier names, price points and billing-period wording as-is, and notes that the answer goes to the orchestrator, which passes it on with tasks/update. The wire panel shows the orchestrator's own calls to the research agent: tools/call run_agent returning a task, tasks/get, subscriptions/listen, and notifications/tasks moving from working to input_required.

Both protocols carried it. The question travels up two levels and the answer comes back down. Cancelling the orchestrator cancels the remote task. A kill -9 while it waits loses nothing: after the restart it follows the remote task again and finishes. The calling code was about the same size both ways, 65 lines over MCP and 85 over A2A.

The differences were small, but they show what each protocol was built for:

  • Questions. MCP’s question arrives under a key, with a schema, and the answer goes back under that key. A2A’s question is text in the status message, with no id. Right after I answered, the A2A task still said TASK_STATE_INPUT_REQUIRED with the same text, so the caller has to tell the old question from a new one itself. I compared the text.
  • Conversations. Over A2A the orchestrator sends back the contextId it was given. Over MCP it passes my contextId argument, which only works because it knows this tool takes one.
  • The answer. A2A’s subscription carries the answer as it is written. Over MCP the orchestrator sees only status until the task completes.
  • Direction. MCP goes one way. The research agent can ask its caller a question inside its own task, but it can’t start a conversation with it. Over A2A it could, if the orchestrator also served A2A.

Some things neither protocol did. The caller has to remember which remote task each parked call is waiting on, follow it again after a restart, and pass a cancel down the chain. To whoever holds it, a task id is just a string. That code was the same for both protocols, and it is the part I’d most like an SDK to own.

So, is A2A still needed?

For this kind of agent, one that a person or an app calls to do a job and that sometimes stops to ask a question, I’d put MCP first.

  • Crash recovery takes less glue, as long as the agent underneath is durable.
  • The approval is a standard form, with no payload convention to agree on.
  • Any MCP host can call it as a tool, without knowing about A2A. A host on the 2026-07-28 revision that doesn’t support tasks gets an ordinary blocking call, with progress notifications and the question asked inline through a multi-round-trip request. My demo server turns away the older 2025 handshake, but a real one could accept it. That is the practical win.
  • It can ship the instructions with the agent. A skill tells the caller’s model how to use it.

A2A earns its place when other agents talk to yours as equals. When one agent simply delegated to another, MCP did the job as well as A2A did. What A2A still adds is a streamed answer, a callback when the caller isn’t around, and conversations that can start from either side. The first two are MCP’s gaps today.

So the line Google drew in 2025 is no longer tools on one side and agents on the other. It is whatever MCP hasn’t standardised yet, and that list keeps getting shorter.

Those look like spec gaps, not design problems. Status updates on a task are already standard. What’s missing is a way to stream partial results on a task, and a webhook for when it finishes. An SDK alone won’t fix that, but a small extension would, and one is on the way: a working group is drafting a proposal for partial tool results in issue #2932.

Because the agent knows nothing about either protocol, serving both costs very little. That is probably the real answer: keep the agent protocol-neutral, give MCP clients a task, and give peer agents an Agent Card.

What’s still rough

The events extension is in beta, with no SDK support. Everything I built on it may change, and the event type is mine.

The SDK doesn’t serve task notifications. They are in the spec, but I had to answer subscriptions/listen myself, in front of the SDK’s own handler.

The MCP SDK is behind the spec. I wrote the tasks receiver by hand and worked around the client throwing on task results. That will go away, but today it is real work.

Try it

The code is on GitHub at manojlds/a2a-vs-mcp. The README has the setup, the nine scenarios, and how to run the chat UI.

Expanded media

Drag to pan · Scroll or pinch to zoom