WebMCP
Tool ownership and composition for the live Canvas page.
HEAD a63778eWebMCP tools have two owners. These are capability groups, not protocol versions or separate servers.
WebMCP
├─ Canvas two-dimensional Cell space
└─ Materials shared authoring reference| Group | Tools | Contract |
|---|---|---|
| Canvas | canvas_manage, canvas_read, canvas_search, canvas_write, canvas_erase, canvas_fill, canvas_render, canvas_code | Manage and operate on Scenes in original Cell coordinates. Freeform Scenes are infinite surfaces; Slide Scenes contain named, finite pages addressed by pageId. write is a literal Projection stroke; erase clears a region; fill styles existing characters; render converts material input such as Markdown or ANSI into Projection Cells. canvas_code composes these capabilities in a bounded QuickJS runtime with ordinary-object APIs; it reports runtime_unavailable with primitive-tool fallbacks if WASM cannot load. preview is the default and does not mutate; apply commits one undoable operation with an operationId. list_pages and page mutation actions are exposed through canvas_manage; content tools accept pageId without changing the user's active page. list returns active Canvases and short persistent canvasId values by default; pass includeArchived: true for archived Canvases. canvasId is optional and defaults to the active Canvas. |
| Materials | chardesk_read_materials | Read-only Markdown shared by both workflows. |
New spatial operations belong to Canvas; source-file editing remains outside these tools. Groups reuse existing runtimes and never own separate copies of application state.
Local MCP bridge
The local bridge keeps one browser page connection and multiplexes independent Agent tenants through it:
browser page ── one WebSocket ── bridge broker
├─ tenant A
├─ tenant B
└─ tenant CEach tenant has its own session token and pending-request budget. Requests are
forwarded in FIFO order; a tenant disconnect does not close the page or affect
other tenants. A second @chardesk/mcp server process joins the existing broker
automatically instead of claiming a second browser connection.
Canvas reads keep machine metadata separate from visual content. canvas_read
returns structuredContent for coordinates, sampling, and optional appearance regions,
plus contentBlocks for text, image, or note blocks. The default is lightweight text
without style notes; style: "appearance", representation: "cells", and image blocks
are explicit so extra visual context is never silently added.
Page composition
The composition entry point builds the groups and flattens them for the host connector. Normal Canvas pages register all 8 Canvas tools. Local CLI reader pages register Canvas management, reading, searching, and Materials only. Workspace management pages register none. Grouping does not add a browser-visible category field or change registration order.
Authorities
- Definitions: Canvas, Materials.
- Host registration and diagnostics: state flows.
- Verification: group composition, headless browser discovery and calls.