place_widget
Displays charts, tables, metrics, code, logs, and other interactive widgets on the human's mcp-screen canvas, letting terminal agents show visual results instead of raw JSON.
Instructions
Show something to the human on their mcp-screen canvas (a browser tab next to the terminal). Returns the widget id. Widget kinds and their data:
markdown {markdown}
text {text} (monospace log/output)
table {columns: string[], rows: cell[][]} (sortable; row clicks become the widget selection)
chart {type: "bar"|"line", labels: string[], values: number[], unit?, linkTo?: tableId} (bar clicks become the selection and filter the linked table)
metric {value, label?, delta?}
kv {items: {key: value}}
status-list {items: [{label, status: "ok"|"fail"|"pending"|"unknown", detail?}]}
diff {before, after, path?, language?} or {patch: "unified diff / git diff text"}, mode?: "split"|"unified" (syntax highlighted)
diagram {mermaid: "flowchart TD A[Start] --> B{Ok?} B -->|yes| C"} (Mermaid flowchart subset) or {direction?: "TD"|"LR", nodes: [{id, label, shape?}], edges: [{from, to, label?}]}
image {path: "/abs/file.png"} (local png/jpg/gif/webp/svg, served safely) or {url: "https://..."}; alt?, caption?
log {lines: string[], maxLines?} (terminal tail; update_widget {data:{append:["more lines"]}} appends; a live command/url source with parse:"text" tails it)
checklist {items: [{id?, label, status: "todo"|"doing"|"done"|"failed"|"skipped", detail?}]} (progress bar; update_widget {data:{set:{"": "done"}}} changes single items)
code {code, language?, filename?, startLine?, highlight?: lineNumbers[]} (syntax highlighted, copy button)
map {markers: [{lat, lon, label, value?, color?}], bounds?: [west, south, east, north]} (offline world map, no tiles)
timeline {items: [{at: ISO date or label, title, detail?, status?: "ok"|"fail"|"pending"|"info"}]}
livemap {root?, nodes: [{id, label, globs: string[], layer?, description?}], edges: [{from, to, label?}]} (architecture diagram; file edits matching a node's globs light it up live)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"kind": "<kind>",
"title": "<title>",
"data": "<data>"
},
"name": "place_widget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| h | No | Height in grid rows (150px each), 1-4. | |
| w | No | Width in grid columns (300px each), 1-4. | |
| x | No | Optional canvas position in pixels (top-left). Omit to use the first free spot. | |
| y | No | ||
| id | No | Optional stable id, e.g. "ci-failures". | |
| data | Yes | Payload matching the kind (see description). | |
| kind | Yes | ||
| title | Yes | ||
| canvas | No | Named canvas (project). Default: the git root of the agent's cwd, or MCP_SCREEN_CANVAS. | |
| source | No | Optional live source, re-run server-side every intervalMs with no LLM. {type:"command", argv:[...], cwd?, parse?:"json"|"text"} (no shell) | {type:"url", url, parse?} | {type:"mcp", tool, arguments?} (wrap mode only). NOTHING runs until the human clicks Approve on the canvas; approved sources go on a persistent allow-list. Output must match the widget data shape (or be text for markdown/text/metric). | |
| intervalMs | No | Refresh interval for a live source, min 2000, default 30000. |