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.0events and Cedar human-in-the-loop approval interrupts over SSE.
On this page
Three-Axis Interoperability Stack
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)
| Tool Name | Behavior | Policy / Safety Effect |
|---|---|---|
gap_search | Hybrid BM25 + HNSW search across active branches (L1). | Pre-filtered by Cedar visibility bitset (INV-05). |
gap_describe | Branch overview (L0) or exact SDL type hydration (L2). | Serves only approved desc_hash text (INV-08). |
gap_query | Executes read-only batched GAP-QL queries. | Enforces read-only annotation + PlanCache TenantId key. |
gap_mutate | Executes state-changing mutations. | Requires @sideEffect + Cedar two-person approval when irreversible. |
gap_task | Submits, 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:
{
"mcpServers": {
"gap-gateway": {
"command": "/usr/local/bin/gap",
"args": ["serve", "--config", "/etc/gap/gap.toml", "--stdio"]
}
}
}
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): ExposesPOST /ag-uiSSE streaming typed events (RUN_STARTED,STEP_STARTED,TOOL_CALL_*,STATE_SNAPSHOT,RUN_FINISHED). When Cedar requires human confirmation on anIRREVERSIBLEmutation, AG-UI pauses via a nativeRUN_FINISHEDinterrupt and resumes cleanly after approval.
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) }"}}}'
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"}}