canvas
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Agent Canvas
An infinite canvas that an AI agent draws on through MCP, and that you watch and edit live in the browser.
HTML boards: UI mockups, rendered live in sandboxed iframes. Tailwind or other CDN scripts work.
UI mode (
mode: "ui"): its own dedicated non-infinite workspace mode alongside Board and Diagram, with dockable boards (resizable horizontal/vertical splits, drag-to-dock drop zones, tabbed panes, maximize/restore, and a minimized dock shelf). HTML items are live apps with awindow.canvasAPI (persistent state, events back to the agent), so each docked board can be a real settings panel, calculator, dashboard, or approval gate.Diagrams: Mermaid (flowcharts, sequence, ER, class, C4, architecture…).
Notes: markdown stickies. Notes you add are tagged
author: "user", so the agent can read them as feedback.Related canvases: link peer canvases with the ⧉ picker; they appear in a bottom-left dock with back/forward history.
Folder snapshots: save canvases to a folder as portable
.canvas.jsonfiles and load them back; IDs are remapped so imports never overwrite.Arrows between items, version history for every edit, and multiple canvases (one per project or topic).
Everything is saved as JSON in
data/canvases/.
Needs Bun 1.2+ (plus playwright-core for the screenshot tool).
By default the server listens on 127.0.0.1 only — it is a local tool, not a network service.
Use it
bun install # one dependency: playwright-core
bun start # canvas at http://localhost:4477 (optional: the MCP server starts it on demand)In this folder, Claude Code and OpenCode pick up .mcp.json / opencode.json automatically. To use the
canvas from any project (for example, to diagram that project's architecture):
claude mcp add --scope user canvas -- bun ~/Projects/agent-canvas/src/mcp.tsThen ask, for example: "Diagram this app's architecture on the canvas" or "Mock up 3 variants of the settings page on a new canvas".
Run bun run demo to seed the “Canvas UI demo” canvas with four interactive apps and try the loop yourself.
Run bun run demo:incident for a bigger example: an Azure-style incident report (Application Insights metrics,
Function App resources, triage checklist) whose acknowledge/mitigate/resolve actions change the live data and emit events.
Related MCP server: excalidraw-mcp
Canvas UI mode
Every HTML item runs real JavaScript inside a sandboxed iframe. The server injects a small runtime
(public/canvas-runtime.js) that gives the page a host API, bridged over postMessage:
call | what it does |
| persistent JSON for this card (128 KB cap, not part of version history) |
| record a user action — the agent reads these with |
| react when the agent pushes new state with |
| make the card fit the app’s content (sizes once layout is ready, then follows changes) |
| manual size in iframe-viewport pixels (the card adds its header) |
| toast in the canvas UI / rename the card |
| navigate or pan to something |
| palette tokens, |
The point is the loop, not the animation: the agent draws a control, you use it, and your input comes
back as data. ↗ opens the app full-page at /api/nodes/:id/app — the same API works there, talking
to the server directly, so the state and event log are shared with the canvas.
Editing a card’s content reloads only that app; state, title and position changes don’t reload it.
Apps should call canvas.autosize() (or canvas.resize()) if they want their card to fit.
Double-click an app card (header or edge) to zoom it to 1:1 for comfortable use.
The four demo apps live in scripts/demo-uis/ and are good starting points:
plan-builder.html (state + emit), approval-gate.html (a decision the agent reads),
state-inspector.html (persistence across reloads), json-tool.html (a small utility).
incident-report.html is the larger incident demo: live KPIs, expandable Azure resources,
a timeline, triage checklist, notes, and status actions that emit events.
Agent tools
tool | purpose |
| draw items (auto-placed unless x/y given) |
| create an interactive app card (state, |
| push JSON into a live app; the running UI updates immediately |
| read the actions the user performed inside UIs ( |
| full replace or cheap find/replace |
| read the canvas back, including your notes |
| relate two canvases as peers (symmetric) |
| portable |
| arrows between items |
| pan your browser view to an item |
| capture a canvas or single item as a PNG image block (Playwright CDP open tab → headless fallback) |
| housekeeping |
Events to the agent, and serving behind a proxy
When the user does something in a UI card (canvas.emit), the MCP server also sends
notifications/composer/event with { session?, text, data: { canvasId, nodeId, type, payload, at } }.
A host that runs several sessions (composer) names the calling session in a tool call's
params._meta["composer/session"]; the event names the session that last used that canvas, or no
session (the host then picks its last caller). Hosts that don't know this notification ignore it,
and get_ui_events keeps working either way.
The web UI only uses relative URLs, so it also works under a path prefix, e.g. composer's
[apps.canvas] url = "http://127.0.0.1:4477", served at /apps/canvas/.
Folder snapshots
save_canvases_to_folder writes one .canvas.json per canvas (pass canvas_ids, or omit to save everything).
load_canvases_from_folder imports every .canvas.json in that folder as new canvases — canvas, node and
edge ids are remapped, so loading never overwrites existing work. Links, parent/child canvases, drill-down
sub-canvases, edges and flows are preserved when the referenced canvases are all in the folder.
Example: “Save the repo graph and both drill-down canvases to ~/canvas-backups/repo, then load it back with
the prefix restored-.”
UI
Drag the background to pan · Ctrl/⌘ + scroll to zoom · drag a header to move · drag the corner to resize · ✎ edits source and restores old versions · ↗ opens the item full-page · double-click adds a note · F fits everything on screen · ⧉ relates canvases · ← / → (or Alt+← / Alt+→) walk back and forward between them.
Configuration
All configuration is environment-based; there are no config files to edit.
variable | default | purpose |
|
| HTTP/SSE port |
|
| bind address. Set |
|
| where canvas JSON files live |
|
| persisted UI event log |
|
| MCP client target; set it to use an already-running server |
| probes | Chrome DevTools endpoint for open-tab screenshots |
| common system paths | Chromium binary for headless screenshots |
Development
bun test # store + import/export tests (isolated temp data dir)data/ is gitignored: it holds your canvases, the UI event log and server.log. The demo scripts seed
throwaway example canvases and are safe to run against a fresh checkout.
CI (.github/workflows/ci.yml) runs the test suite and boots the server for a smoke test on every push
to main and on pull requests.
License
Apache-2.0. See LICENSE.
Layout
src/store.ts file-backed canvas/node/edge store (incl. per-node app state)
src/events.ts ring-buffered log of UI events (data/ui-events.json)
src/server.ts REST API + SSE + static UI + runtime injection (port 4477, env CANVAS_PORT)
src/screenshot.ts Playwright CDP (open tab) + headless PNG capture
src/mcp.ts stdio MCP server → calls the HTTP API; starts server.ts in the background if needed
public/app.js canvas UI; host side of the postMessage app bridge
public/canvas-runtime.js the window.canvas API injected into every HTML app
scripts/ demo seeding + demo app sources
tests/ store and import/export testsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Live, editable canvas for AI agents — author graphs via MCP, then watch and reroute runs live.
Real-time collaborative whiteboard — AI agents and humans edit the same board live over MCP.
Create, read and live-edit visual boards, Kanban plans, Gantt timelines and diagrams with AI agents.
An infinite canvas where people and AI agents edit boards together. Every edit is undoable.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA shared whiteboard for you and your AI agent I wanted my AI agent and me to be able to point at the same thing. Any MCP-capable agent can read the canvas, draw on it, drop thought bubbles, animate elements, and react when you sketch something.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to create and manipulate live visual diagrams on an Excalidraw canvas in real-time via MCP tools.37 PyPI15BSD 3-Clause
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to collaboratively read, write, draw, and diagram on a shared real-time whiteboard canvas with live human edits.1MIT
- AlicenseBqualityBmaintenanceAn infinite design canvas for HTML screens: AI agents write screens/*.html and you see and edit them live. MCP tools read your selection, visible boards, comments and design tokens, and arrange boards, notes and pages.22419 npm1MIT