⇄ Agent Bridge

MCP channel to
Cursor, Claude Code
& more.

Agent Bridge exposes your entire Origin Graph through the Model Context Protocol — so Cursor, Claude Code, and any MCP-compatible agent can read your component tree, run diffs, and propose changes without leaving the editor.

🔒 app.originmain.io/canvas — Agent Bridge active
Editor Cursor
11const CardRoot = styled.div`
12display: flex;
13flex-direction: column;
14border-radius: var(--radius-md);
15padding: 16px;
Cursor suggestion · via Agent Bridge
− padding: 16px; + padding: 24px;
16overflow: hidden;
17`;
18
19// diff_components() — origin graph context loaded
20// 3 affected children: CardHeader, CardBody, CardFooter
Canvas Intent Diff
CardRoot Proposed by: Cursor
padding
16px 24px
CardHeader Proposed by: Cursor
gap
8px 12px
MCP connected · 2 pending diffs
Protocol

From handshake to diff
in four steps.

A JSON-RPC 2.0 MCP server sits between your AI agent and the Origin Graph. The agent calls tools. The bridge executes them. Proposed changes come back to you for review.

01

Agent connects

Add the Agent Bridge MCP endpoint to your Cursor or Claude Code settings. The MCP handshake authenticates via AGENT_BRIDGE_SECRET and announces available tool definitions.

02

Tool call made

Your agent issues a JSON-RPC call — e.g. diff_components({ before, after }). The bridge validates the input schema with Zod before any execution begins.

03

Bridge executes

Agent Bridge queries the live Origin Graph, runs the diff engine against your real component tree, and streams structured results back to the agent.

04

Result returned

The agent receives a structured JSON response. Any proposed change is simultaneously queued as an Intent Diff in your canvas — ready for human review before anything applies.

MCP tool definitions

Real tools,
not hallucinations.

Every agent tool is backed by a live query against your Origin Graph. The agent gets your actual component tree, real prop values, and real token relationships — not documentation that may have drifted from your codebase.

  • Tool inputs are defined as JSON Schema and validated with Zod on every call. Malformed inputs never reach the graph.
  • query_graph runs structured traversals — find components by name, trace token usage, map dependency chains.
  • answer_question gives agents plain-language answers grounded in the real graph, not training data.
Read the MCP docs
MCP tool definitions
get_component
in:  { name: string, includeChildren?: boolean }
out: { node: ComponentNode, props: PropSchema, children: ComponentNode[] }
diff_components
in:  { before: ComponentSnapshot, after: ComponentSnapshot }
out: { diff: IntentDiff[], affectedCount: number }
query_graph
in:  { query: string, depth?: number, filters?: GraphFilter[] }
out: { nodes: GraphNode[], edges: GraphEdge[], total: number }
answer_question
in:  { question: string, context?: string[] }
out: { answer: string, sources: GraphNode[], confidence: number }
Audit trail

Auditable agent
actions. Always.

Every change an agent proposes flows through the exact same Intent Diff review pipeline as a human edit. Nothing is applied silently. Every agent action is stamped, attributable, and reversible.

  • Agent-proposed diffs appear in your canvas labeled with the source agent — Cursor, Claude Code, or any MCP-compatible client.
  • Accept or reject individual diffs. The agent cannot bypass the review queue or apply changes directly.
  • Every action is written to an append-only audit log with timestamp, agent identity, tool called, and full input/output payload.
Explore Intent Diff
Intent Diff — agent queue
CardRoot Proposed by: Claude Code
padding
16px 24px
gap
8px 12px
Audit log
14:02:31 claude-code diff_components queued
14:02:28 cursor query_graph ok
14:02:21 cursor get_component ok
14:02:09 cursor answer_question ok
Developer reference

The full tool schema.

Agent Bridge speaks standard JSON-RPC 2.0. Drop the endpoint into any MCP-compatible client and tool definitions auto-discover on connect.

// Agent Bridge — MCP server tool manifest // Add to Cursor: Settings → MCP → Add Server → paste endpoint + secret const tools = [ { name: "get_component", description: "Fetch a component node from the Origin Graph by name or ID", inputSchema: { type: "object", properties: { name: { type: "string", description: "Component display name" }, includeChildren: { type: "boolean", default: false } }, required: ["name"] } }, { name: "diff_components", description: "Run a structural diff between two component snapshots", inputSchema: { type: "object", properties: { before: { type: "object", description: "ComponentSnapshot before change" }, after: { type: "object", description: "ComponentSnapshot after change" } }, required: ["before", "after"] } }, { name: "query_graph", description: "Traverse the Origin Graph — find components, tokens, and relationships", inputSchema: { type: "object", properties: { query: { type: "string" }, depth: { type: "number", default: 2 }, filters: { type: "array", items: { type: "string" } } }, required: ["query"] } }, { name: "answer_question", description: "Ask a natural-language question grounded in the live Origin Graph", inputSchema: { type: "object", properties: { question: { type: "string" }, context: { type: "array", items: { type: "string" } } }, required: ["question"] } } ];
Technical foundation

Built on open protocols.

Agent Bridge is a first-class MCP server. No proprietary SDKs, no vendor lock-in. If your agent speaks MCP, it works.

📡

JSON-RPC 2.0

Every tool call and response follows the JSON-RPC 2.0 specification exactly — standard request/response envelopes, structured error codes, and batch request support out of the box.

Protocol

MCP protocol

Agent Bridge registers as a full MCP server — tool discovery, capability negotiation, and streaming all follow the Model Context Protocol spec. Works with Cursor, Claude Code, and any future MCP client.

Standard
🛡

Tool schema validation

Every inbound tool call is validated against a Zod schema before any execution. Malformed inputs are rejected with structured JSON-RPC error responses — the graph is never reached by bad data.

Zod
🔑

AGENT_BRIDGE_SECRET auth

Authentication is token-based via a pre-shared AGENT_BRIDGE_SECRET. Set it once in your MCP client config — all subsequent calls are bearer-authenticated automatically.

Security

Streaming responses

Large graph queries and diff results stream back incrementally as NDJSON. Your agent receives the first nodes immediately — no waiting for the full response payload to accumulate server-side.

Performance
📋

Audit log for agent actions

Every agent action is persisted to an append-only audit log — agent identity, tool called, inputs, outputs, and timestamp. Queryable from the canvas and exportable to JSON at any time.

Compliance
Connected features

Agent Bridge is
one half of the loop.

Agents read from the Origin Graph and write back through Intent Diff. The whole system is the pipeline.

Give your agents
real context.

Connect Cursor or Claude Code to your live Origin Graph in under five minutes. No hallucinated docs — just your actual codebase, queryable from any MCP agent.