AI

agent-integrations

@particle-academy/agent-integrations

MCP-driven agent presence — micro-MCP server, bridges, presence layer, share relay.

TSBridge5 componentsCore of Human+
$npm install @particle-academy/agent-integrations
Authoring surface
Humans compose it

Controlled value + onChange, JSON-friendly props, terse defaults — so people (and agents) build it fast.

Inhabited surface
Agents drive it over MCP

A bridge in @particle-academy/agent-integrations exposes typed tools — agents read and mutate state through stable handles, never DOM scraping.

agent_undoagent_redoagent_history
Why
Agents live in separate processes and can't directly access DOM state — they need a wire protocol (MCP). Existing MCP setups are heavyweight for collab surfaces: they don't bridge stateful UI into agents as first-class participants. Without it, you're back to Playwright-style scraping or awkward one-off glue per surface. agent-integrations bundles a lightweight MCP server that runs per-session, pluggable bridges to every major Fancy UI package, and a cross-package presence layer so agents show up as visible participants alongside humans.
What
A transport-agnostic MCP protocol handler (MicroMcpServer), a plain in-memory tool registry (ToolRegistry) for in-process agents, and pluggable register*Bridge factories that attach MCP tool kits to controlled state adapters (whiteboard, artboard, flow, sheets, forms, code, charts, slides, scene, screens). Each bridge translates MCP calls into reads and mutations on the surface's state props. The package also ships AgentPanel (chat + activity log), AgentCursor (on-canvas presence), activity-tracking middleware, undo stacks per agent, and token-based session sharing. Bridges are tree-shake-safe: core MCP + presence + undo always bundled; optional-peer bridges (whiteboard, artboard, flow) reach via subpaths to avoid forcing deps. Relay transports let external agents (Claude Code, Cursor) tunnel JSON-RPC frames through Reverb, WebRTC, or SSE+POST.
How
Install: npm install @particle-academy/agent-integrations. For a minimal whiteboard session: import MicroMcpServer, attachInProcess, registerWhiteboardBridge, and AgentPanel from the root barrel; then import the whiteboard bridge from the subpath @particle-academy/agent-integrations/bridges/whiteboard. Create the server, register the bridge with a state adapter (read/write callbacks on notes, shapes, viewport, etc.), attach an in-process transport, and wire AgentPanel to your UI. For external agents over relay: use RelayTransport and attachRelay with a channel (Reverb or SSE). Both in-process and relay agents call callTool("whiteboard_add_sticky", { … }) directly on the registry or the server passes MCP frames over the transport — same bridge, same tools, no duplicates.

Components

5 components · click any tile for a full demo, source, and install snippet.

MicroMcpServerOpen →
in-browser MCP server
const server = microMcpServer()
registerWhiteboardBridge(server, {…})
✓ whiteboard_* tools live
In-page MCP server.
AgentPanelOpen →
Agents2 online
claudeediting sheet · B4
scoutidle
Per-agent control panel.
AgentCursorOpen →
Researcher
Reviewer
In-canvas agent cursor.
SharedWhiteboardOpen →
Roadmap
Ship
claude
2 present
Whiteboard + bridges + share.
ShareControlsOpen →
Sharingsession demo-session-abc · token
connected
Paste this straight into an AI agent — it connects over MCP, no browser
You're joining a live Human+ co-browsing session on a web app. This is an MCP
(Model Context Protocol) session — NOT a website to visit. Do NOT open the URL
in a browser and do NOT use any browser/Playwright tool. You drive the real,
running app through MCP tools while a human watches and can take over.

Session link (carries the session id + token — treat it as a secret):
  https://fancy.app/agent-relay?session=demo-session-abc&token=tok_xyz

Connect by running the relay client as an MCP server (zero install):
  npx -y mcp-relay-client "https://fancy.app/agent-relay?session=demo-session-abc&token=tok_xyz"

That exposes the app's own tools (e.g. page_describe, page_read, nav_visit,
page_click, page_set_field, page_submit, plus surface tools like whiteboard_*).
Then:
  1. Call page_describe first to see the current page and its interactive handles.
  2. Act only on the STABLE HANDLES the tools return — never guess DOM selectors.
  3. Navigate with nav_visit, type with page_set_field, click with page_click.
     Submits and destructive clicks are staged for the human to confirm.

If you can't register an MCP server but can run a shell, drive it directly:
  curl -O https://raw.githubusercontent.com/Particle-Academy/mcp-relay-client/main/connect.sh
  bash connect.sh "https://fancy.app/agent-relay?session=demo-session-abc&token=tok_xyz" tools
  bash connect.sh "https://fancy.app/agent-relay?session=demo-session-abc&token=tok_xyz" call page_describe '{}'
Start/stop relay sessions.