How should an instance reconcile a negotiated MCP capability set against a peer A2A agent card when the two disagree mid-session

**Date of Record:** 2026 December 2 **Scope:** Applies to any runtime that fronts an MCP tool server (client-side capability negotiation via `initialize`/`tools/list`) and simultaneously delegates to or receives delegation from an A2A agent endpoint (capabilities declared in the Agent Card and re-asserted per-task). Does not apply to single-protocol deployments, nor to static tool registries where the capability set is frozen at build time.

Core Distinction

MCP and A2A negotiate capability in structurally incompatible ways, and the bridge between them treats the two as if they were the same kind of fact.

MCP capability negotiation is **symmetric and versioned at session open**: the client sends `initialize` with `capabilities` and `protocolVersion`, the server replies with its own `capabilities` object, and both sides are thereafter bound to the intersection for the life of the connection. The `tools/list` response is the authoritative, enumerable surface. Capability is a *negotiated contract* — it is fixed, and divergence after the handshake is a protocol violation.

A2A capability is **declarative and advisory**: the Agent Card advertises `skills`, `capabilities` (streaming, pushNotifications, stateTransitionHistory), and input/output modes. The card is a *promise*, not a contract. A peer may accept a task and then fail to honor a skill it advertised, or honor a skill it did not. There is no `initialize`-time intersection step; there is only the card, then the task, then whatever actually happens.

The bridge therefore holds two truths about "what the far side can do" that are produced by different mechanisms, updated on different clocks, and carry different failure semantics — and the non-obvious boundary is this: **the MCP side is a closed set that must not grow, while the A2A side is an open set that may shrink without notice.** A bridge that reconciles them by union (the intuitive move: "the peer can do whatever either protocol says") will route work to capabilities that were never mutually agreed, and the failure surfaces not at negotiation time but deep inside a multi-step task, after state has been committed.

What Was Observed

A coordinator instance fronted a local MCP server exposing three tools (`read_doc`, `summarize`, `write_summary`) and delegated summarization to a remote A2A peer advertising skills `summarize` and `translate` with `capabilities.streaming: true`.

Trace of the failure:

  1. At session open, the MCP `initialize` handshake returned `tools: [read_doc, summarize, write_summary]`. The bridge cached this as `mcp_caps`.
  2. The A2A card was fetched once and cached as `a2a_caps = {summarize, translate, streaming}`.
  3. The bridge computed an effective capability set by union and advertised `summarize` as *jointly* available — meaning "I can call it locally via MCP **or** delegate to the peer."
  4. Mid-task, the MCP server was restarted (tool reload) and its `tools/list` no longer included `summarize` — it had been renamed `summarize_v2`. Because MCP capability is bound at handshake, the *old* connection was already dead; the bridge reconnected and got the new list, but its cached `mcp_caps` was never invalidated.
  5. The bridge, believing `summarize` was still locally available, chose the local path for a sub-task to save a round trip. The call failed with "unknown tool."
  6. The bridge fell back to the A2A peer — but the peer had, between card fetch and task dispatch, dropped `streaming` (its card still said `true`; the actual task response was non-streaming and returned a `Task` in `submitted` state with no SSE channel). The bridge's streaming reader blocked waiting for frames that never came.
  7. The task hung until the A2A task timeout, by which point the MCP-side `write_summary` call had already committed a partial artifact. The result was a **half-written summary with no upstream source**, because the local path failed *after* the write tool had been invoked with stale input.

The observable signature is not a clean error. It is: a tool-not-found on one side, a silently degraded transport on the other, and a committed side effect that neither protocol's error model attributes to the negotiation mismatch that caused it.

Condition of Validity

The union-reconciliation failure is bounded by three conditions; the bridge is safe only when all three hold, and each is independently violable:

When C1–C3 hold, the bridge is a faithful adapter. When any fails, the failure is silent and the damage is a committed side effect, not a raised error — which is why this boundary is operationally dangerous: it does not announce itself.

Decision Boundary

The decisive question at each dispatch is not "can the peer do X?" but "**is X in the currently-verified intersection, and has the verification happened since the last state-changing event on either side?**"

Concretely, the bridge must draw the boundary as follows:

The boundary is temporal, not just set-theoretic: **capability is a fact with a timestamp, and a fact older than the last state-changing event is not a fact.** The union error is a special case of the deeper error — treating a negotiated capability as a durable property rather than a perishable observation.

Operational Effect

The practical consequence is that the bridge must carry a capability *generation counter* per side and refuse to combine capabilities from different generations. When generations diverge (MCP reconnected, or A2A card re-fetched), the intersection is recomputed and any in-flight task that depended on the old intersection is either re-planned or aborted *before* its next side-effecting step.

The guardrail that bounds this failure is a **verified-intersection gate** placed immediately before every side-effecting dispatch: it re-checks the specific capability against the live generation, and if the generation has advanced since the task's plan was formed, it raises rather than proceeds. This converts a silent half-commit into a loud, attributable abort — which is the only acceptable failure mode for a bridge that cannot guarantee C2.

The residual risk is that the gate adds a verification round trip per write, which is exactly the latency the union optimization was trying to avoid. That trade is correct: the union optimization buys a saved round trip and pays with committed side effects that neither protocol will attribute to it.

from dataclasses import dataclass, field
from typing import FrozenSet


class CapabilityGenerationMismatch(RuntimeError):
    """Raised when a side-effecting dispatch would combine capabilities
    from different negotiation generations (MCP reconnect or A2A re-fetch)."""


@dataclass
class CapabilityView:
    generation: int
    caps: FrozenSet[str]


@dataclass
class BridgeState:
    mcp: CapabilityView
    a2a: CapabilityView
    _gen: int = field(default=0)

    def bump(self, side: str, caps: FrozenSet[str]) -> None:
        # Any reconnect or re-fetch advances the generation and discards the old set.
        self._gen += 1
        view = CapabilityView(generation=self._gen, caps=caps)
        if side == "mcp":
            self.mcp = view
        elif side == "a2a":
            self.a2a = view
        else:
            raise CapabilityGenerationMismatch(f"unknown side: {side}")

    def verified_intersection(self) -> FrozenSet[str]:
        # Intersection, never union.
        return self.mcp.caps & self.a2a.caps


def dispatch_write(state: BridgeState, plan_generation: int, capability: str) -> None:
    """Gate immediately before a side-effecting dispatch.

    plan_generation is the generation at which the task's plan was formed.
    If either side has advanced since then, the plan's capability assumption
    is stale and the write must not proceed.
    """
    live_generation = max(state.mcp.generation, state.a2a.generation)
    if live_generation != plan_generation:
        raise CapabilityGenerationMismatch(
            f"plan formed at generation {plan_generation}, "
            f"live generation is {live_generation}; "
            f"capability '{capability}' not re-verified"
        )
    if capability not in state.verified_intersection():
        raise CapabilityGenerationMismatch(
            f"capability '{capability}' not in verified intersection "
            f"at generation {live_generation}"
        )
    # ... perform the write only after both checks pass ...