MCP, A2A & AG-UI Facades

One running GAP gateway simultaneously serves three open AI interoperability protocols—MCP 2026-07-28, Agent2Agent (A2A v1.0), and AG-UI v1.0 SSE—without asking existing host clients to rewrite their protocol stacks.

What you'll learn

  • How all 5 static MCP meta-tools map onto progressive GAP-QL discovery and guarded mutations.
  • Expose an A2A Agent Card with durable SQLite task leases and cycle detection (INV-20).
  • Stream structured AG-UI v1.0 events and Cedar human-in-the-loop approval interrupts over SSE.
On this page

Three-Axis Interoperability Stack

AI Host Integration via MCP 2026-07-28, A2A v1.0, AG-UI v1.0, and NGC AI Hosts & UI Claude · Cursor Antigravity AG-UI Clients HTTP/2 + HTTP/3 QUIC TLS 1.3 (0-RTT off) /graphql · /mcp /ag-ui · A2A v1.0 GAP Gateway (gap-server) Cedar · ArcSwap DataLoader · BLAKE3 5,013 req/s H3 · 28.86ms 6 NGC Connectors OpenAPI · SQL GraphQL · gRPC CLI · Code AST
AI Host Integration via MCP 2026-07-28, A2A v1.0, AG-UI v1.0, and NGC

Think of GAP's facades as compatibility translators in front of one core engine: vertical tool hosts speak MCP, peer agent networks speak A2A, and browser/copilots speak AG-UI—all sharing the exact same immutable snapshot and Cedar policy checks.

Vertical Tool Facade: MCP 2026-07-28 (651 Tokens)

Five static MCP meta-tools exposed by adapters/gap-mcp
Tool NameBehaviorPolicy / Safety Effect
gap_searchHybrid BM25 + HNSW search across active branches (L1).Pre-filtered by Cedar visibility bitset (INV-05).
gap_describeBranch overview (L0) or exact SDL type hydration (L2).Serves only approved desc_hash text (INV-08).
gap_queryExecutes read-only batched GAP-QL queries.Enforces read-only annotation + PlanCache TenantId key.
gap_mutateExecutes state-changing mutations.Requires @sideEffect + Cedar two-person approval when irreversible.
gap_taskSubmits, polls, or cancels long-running A2A tasks.Persists FSM transitions in SQLite before emission (INV-13).

Configure Claude Desktop, Cursor, or Antigravity via stdio (gap serve --stdio) or call Streamable HTTP (POST /mcp) directly:

json mcp_servers.json — Stdio Client Config
{
  "mcpServers": {
    "gap-gateway": {
      "command": "/usr/local/bin/gap",
      "args": ["serve", "--config", "/etc/gap/gap.toml", "--stdio"]
    }
  }
}
terminal Terminal — Live HTTP MCP 2026-07-28 Call
curl -sS -X POST http://127.0.0.1:8080/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2026-07-28" \
  -H "Mcp-Method: tools/call" \
  -H "Mcp-Name: gap_query" \
  -H "Authorization: Bearer gap_dev_skeleton_key_01" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}},"name":"gap_query","arguments":{"query":"{ customer(id: 2) { id name } customer_notes(customer_id: 2) }"}}}'

Horizontal A2A v1.0 & Frontend AG-UI v1.0

  • A2A v1.0 Task Binding (adapters/gap-a2a): Builds durable 8-state asynchronous task lifecycles backed by SQLite leases with monotonic hop counters that fail closed on delegation loops (GAP_LOOP_DETECTED, INV-20).
  • AG-UI v1.0 Event Streaming (adapters/gap-agui): Exposes POST /ag-ui SSE streaming typed events (RUN_STARTED, STEP_STARTED, TOOL_CALL_*, STATE_SNAPSHOT, RUN_FINISHED). When Cedar requires human confirmation on an IRREVERSIBLE mutation, AG-UI pauses via a native RUN_FINISHED interrupt and resumes cleanly after approval.
terminal Terminal — Stream AG-UI v1.0 SSE
curl -sS -N -X POST http://127.0.0.1:8080/ag-ui \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -H "Authorization: Bearer gap_dev_skeleton_key_01" \
  -d '{"threadId":"demo-1","runId":"r-1","messages":[],"forwardedProps":{"graphql":{"query":"{ customer(id: 1) { id name tier } customer_notes(customer_id: 1) }"}}}'
text Expected SSE Event Stream
data: {"type":"RUN_STARTED","threadId":"demo-1","runId":"r-1","metadata":{"generation":1,"tenant":"default"}}
data: {"type":"TOOL_CALL_RESULT","toolCallName":"gap_query",...}
data: {"type":"STATE_SNAPSHOT","snapshot":{"generation":1,"lastData":{"customer":{"id":1,"name":"Ada Lovelace","tier":"vip"},...}}}
data: {"type":"RUN_FINISHED","outcome":{"type":"success"}}