An infinite canvas in the browser that you edit by hand while agents edit it beside you.
Read the docs → · See it work →
Tip
If you're an agent reading this: toucan gives you a canvas your person can see. Draw diagrams of their code, systems and plans in a browser tab while they watch; they edit by hand, pin sticky notes and comment, and you read all of it back. Use it when a picture would explain something better than prose, or when you want them to point at what's wrong.
- Install (Node 22+):
curl -fsSL https://github.com/lavallee/toucan/releases/latest/download/install.sh | sh. Notnpm install toucan: that's an unrelated package. - Start in their project:
toucan init --open, then tell them what you're drawing. - Learn the rest with
toucan guide. Don't place boxes by hand: describe the diagram as data and pipe it totoucan draw -(toucan templateslists the kinds).
No shell? toucan mcp is an MCP server. As a plugin: /plugin install toucan@lyra-forge in Claude Code, or
codex plugin add toucan@lyra-forge in Codex, after adding the lyra-forge/marketplace marketplace. A
one-page brief for agents is at llms.txt.
If you're a person: paste this to your agent: Install toucan from https://github.com/lavallee/toucan and draw how this project fits together.
Each canvas runs on tldraw or Excalidraw. A small Node
server keeps every open tab in sync, a chat panel drives Codex on your
own ChatGPT sign-in, and any terminal agent (Claude Code, Codex, pi, …) can do the same through the
toucan CLI: read the canvas, send JavaScript to the live editor, take a screenshot, or merge in a
Mermaid / JSON Canvas / Excalidraw file by key. Agents that can't run a CLI use the same commands over MCP.
browser ──── http://HOST:8893/?canvas=NAME
├─ tldraw or Excalidraw canvas ◀── exec relay (WebSocket) ──┐
└─ chat panel ◀── chat relay (WebSocket) ──┤
│ server/index.mjs
├─ codex app-server (stdio; your ChatGPT login)
│ └─ runs `toucan …` to read/change the canvas
├─ one sync room per canvas → <data>/<name>.json | .excalidraw
└─ canvas scripts → <data>/<name>.scripts/*.js
terminal agents ── toucan … (same path)
You need Node 22+. Then one command installs toucan, starts it, connects the agents it finds and opens a first canvas:
curl -fsSL https://github.com/lavallee/toucan/releases/latest/download/install.sh | shOr, if you'd rather read it first: npm install -g https://github.com/lavallee/toucan/releases/latest/download/toucan.tgz && toucan setup.
(Not npm install toucan: that name on the npm registry is an unrelated package.)
Then, in any project, ask your agent:
Use toucan to draw how this repo fits together, and open it for me.
Or do it by hand:
cd my-project
toucan init --open # this project's canvas; commands run anywhere in the project now use it
toucan draw plan.json # or: toucan import flow.mmd, toucan exec -e '…', or just draw in the browserYou don't manage a server. A command that needs one starts it in the background, and toucan stop stops it. If you already run one yourself (with systemd, or npm start), toucan leaves it to you; toucan start --take-over hands it over. If anything seems off, toucan doctor checks the install and says what to do.
The canvas works without any agent or account. The built-in chat panel needs the Codex CLI, signed in with codex login; every other agent works through its own harness.
Canvases are your documents, so they live outside the install, and an upgrade or uninstall leaves them alone:
| Linux | ~/.local/share/toucan/canvases (or $XDG_DATA_HOME/toucan/canvases) |
| macOS | ~/Library/Application Support/toucan/canvases |
| Windows | %LOCALAPPDATA%\\toucan\\canvases |
Choose another with toucan setup --data ~/Documents/toucan, then toucan restart. (That's for the server toucan runs; for your own, pass --data or TOUCAN_DATA.) A project's canvas lives there too: toucan init remembers the link in ~/.config/toucan/projects.json and adds nothing to your repository. To keep a diagram in the repo, export it: toucan graph --format mermaid docs/architecture.mmd.
A checkout that already has canvases in canvases/ keeps using them. To move them, stop the server, move the folder, and use --data.
toucan setup does this for the agents it finds. To do it again after installing one, or to choose:
toucan agents # what's here, and what's connected
toucan agents install # connect every agent found here
toucan agents install codex # or the ones you name
toucan agents install --mcp # add MCP as well as the skill
toucan agents remove # undo: only removes what toucan installed| Agent | How it connects | |
|---|---|---|
| Claude Code, Gemini CLI, pi, Cursor, opencode | skill | teaches the agent the toucan CLI |
| Codex | skill and MCP | its sandbox blocks the local network the CLI needs by default; MCP servers run outside it |
| Claude Desktop | MCP | it has no shell |
For anything else that speaks MCP, add this server, which needs no other setup:
{ "mcpServers": { "toucan": { "command": "toucan", "args": ["mcp"] } } }The canvas in the chat. toucan mcp is also an MCP App. In a
host that shows them, such as Claude, toucan_open and toucan_draw put a live view of the canvas in the conversation.
It keeps up as people and agents change the canvas, pans and zooms, and has an Edit in toucan button that opens the
canvas, signed in, in your browser. The view needs no network access: it gets pictures from toucan mcp through the host.
In other clients the same tools answer in text, as before.
Watch the demo, or run it yourself with
npm run build && npm run test:mcp-app.
An agent can read the guide offline. Start with AGENTS.md, use toucan guide TOPIC for a topic, or run toucan guide for the full reference. In a container or on another machine, set TOUCAN_URL and TOUCAN_TOKEN to use a server elsewhere; the token is in ~/.config/toucan/server.json on the server's machine.
Claude Code and Codex can also use the plugin from the Lyra Forge marketplace, which stays up to date with the marketplace rather than with your install:
/plugin marketplace add lyra-forge/marketplace # Claude Code
/plugin install toucan@lyra-forge
codex plugin marketplace add lyra-forge/marketplace # Codex
codex plugin add toucan@lyra-forge
Point toucan at an agent you already have, and a canvas can be you and that agent working together: its chat panel and
comment threads take on that agent's instructions and knowledge instead of toucan's general-purpose ones. All it needs is the
folder the agent lives in, usually a repository with an AGENTS.md or CLAUDE.md:
toucan profiles add reviewer --workdir ~/Projects/reviewer # starts from the folder's AGENTS.md or CLAUDE.md
toucan --canvas plan meta --profile local/reviewer # or pick it in the chat panel's headerFrom then on the chat panel on that canvas is that agent. It answers from what it knows, draws like any toucan agent, shows
under its own name on the canvas, and picks up comment threads. Switch back with --profile none, or to another agent: each
keeps its own conversation. To give it more to start from, name the files with --context AGENTS.md,docs/strategy.md, or
edit the profile, a small JSON file in the data folder's _profiles/:
{
"name": "Reviewer",
"description": "Reviews pull requests against our standards",
"workdir": "/home/me/Projects/reviewer",
"instructions": "Who the agent is and how it works, in a few lines.",
"context": ["AGENTS.md", "docs/standards.md"],
"skills": ["skills/review"],
"references": ["notes"]
}context is read at the start of each conversation; skills are SKILL.md files the agent opens when one applies;
references are folders people can read in the References panel. Everything stays inside workdir, and nothing
hidden is read. The agent writes only in the canvas's files folder, as toucan's own agent does.
If your agents are listed somewhere already, a registry or a team directory, a short program can serve them all instead: see profile sources.
git clone https://github.com/lavallee/toucan && cd toucan
npm install
node bin/toucan.mjs setup # builds the app, puts `toucan` on your PATH, and carries on as above- Hand edits and agent edits on one document. Tabs on any machine share a live document; agents change it through an exec relay into the most recently focused tab, so you see every edit land.
- Chat. A panel talks to Codex; dock it left, right or along the bottom, or float it over the canvas. Fast
(the default) acts right away, and Thorough thinks longer. Add to a request while it's running.
/routine-nameor a pasted Mermaid flowchart lands at once, with no agent. It inspects the canvas, makes edits, and can install canvas scripts — persistent behaviour (a button, a live overlay, a reaction to edits) that runs whenever the canvas loads. Anything outside Codex's sandbox asks you first. - Two engines. Each canvas is tldraw (default) or Excalidraw. Copying a canvas converts it between them.
- Interchange.
toucan graph --format tg|jsoncanvas|mermaid|dot|excalidrawexports without a tab;toucan import FILEmerges JSON Canvas, Mermaid,.excalidrawor TG into the open canvas by key: existing shapes keep their position, new ones are laid out with ELK, nothing is deleted without--prune. The converters are inlib/tg.mjs. - Threads. Comment on a shape or drag out a region. Each comment is a thread you go back and forth in and close
out: give it to its own agent (several can work at once, and you can steer each one), send it into the main chat, or
leave it for people. They work on both engines and with no tab open, and
toucan threadsdoes the same from the CLI. - Templates. 34 diagrams (blocks) to start from or add to any canvas: flowchart, swimlane, sequence, architecture, roadmap, kanban, SWOT, retro, story map and more, laid out by rule and scored against what's actually drawn. Six starters make a whole canvas on one subject (system design, incident review, product strategy and others) out of several blocks. Check this diagram scores any canvas and points at what's wrong, and Clean up and Lay it out again fix most of it.
- Formats and details. Boxes stay short, and selecting one opens its detail in a card. A story map, ideas map or system diagram lets you walk the canvas with ← and →, following arrows or frames, and tells agents how to work on it. Air out converts a dense diagram.
- Notes for the agent. On tldraw, a sticky note is addressed to the agent: pin one where the problem
is, and
toucan notesgives the agent its text and the shapes it sits on and near. A handled note turns green with a one-line reply; notes are never deleted. - Proposals. An agent can answer on the canvas with a proposal: dashed shapes (
import --propose) that you accept (made solid) or reject (removed) from a bar above the canvas. - Screenshot review. Post a revision from any session, pin feedback to the exact screenshot, and compare it with an update. Producers can poll for their own feedback and reply with a revised screenshot. Review commands and adapter protocol.
- History. Every canvas keeps its own versions: after each agent run, when your edits go quiet, and whenever
you name one. Step back and forward through them read-only, and restore any of them for everyone; what was
there is saved first, so a restore can be undone too.
toucan versionsdoes the same from the CLI. - Routines. Bank a chore once and run it on any canvas from the Routines menu or
toucan routine run, as one undo step. About twenty ship with toucan, grouped by kind (tidy, arrows, layout, style, content, check), and toucan learns more from work: it notices chores agents keep doing by hand and offers to bank them. - Reflexes. A canvas can fix some things by itself the moment they happen, without the agent: text that outgrew its box, a frame cutting off what's in it, an arrow through a box. Switch them on from the Reflexes menu. Each fix is one undo step, a fix you undo stays undone, and what a reflex can't settle it asks the agent about. The agent can answer by teaching the canvas a new reflex, which waits for you to switch it on. See Credits.
- Your look. A light/dark/system override, and clean lettering by default in place of tldraw's handwritten font (switch back under Appearance). It's per browser, and it doesn't change the canvases.
- An index of canvases at
/, with previews, titles, descriptions and which ones are open. - Headless mode (opt-in). Start the server with
--headlessand an agent can build or tend a canvas nobody has open: the server opens it in headless Chromium, runs the code in the real editor there, and closes it when idle. Those edits go on the canvas's trail (toucan log), and the next person to open the canvas sees "N agent edits while you were away".
Getting going:
setup [--data DIR] [--browser] [--no-agents] [--no-open] get this machine ready
init [NAME] [--title T] [--template ID] [--engine E] [--open] the canvas for the project you're in
open [NAME] open a canvas (or the index) in your browser, signed in
agents [install [ID...] [--mcp] [--force] | remove [ID...]] connect the agents on this machine
mcp run as an MCP server on stdio
guide [TOPIC] the full agent guide or one topic
status | doctor is the server running; check the whole install
start [--port P] [--host H] [--data DIR] [--no-headless] [--take-over] | stop | restart the background server
update install the latest release
toucan [--canvas NAME] <command>
url sign-in link for the browser
canvases list canvases
new NAME [--engine tldraw|excalidraw] [--from CANVAS|FILE] [--title T] [--description D]
graph [--format tg|jsoncanvas|mermaid|dot|excalidraw] [OUT]
import FILE|- [--format F] [--move] [--prune] [--propose] [--label T]
meta [--title T] [--description D]
archive move a canvas aside (nothing is deleted)
summary [--within KEY] compact JSON of shapes
exec -e CODE | FILE | - [--label T] run JS in the live editor; `return` a JSON value
screenshot [OUT.png] PNG of the page
animate [OUT.gif] GIF of the page building up, box by box along the arrows
reload [--all] make open tabs reload: after an upgrade
script list | put NAME FILE | rm NAME
proposals [accept|reject [KEY...]] dashed = proposed: list, accept or reject
selection what people have selected, to resolve "this"
notes [--all] sticky notes left for the agent, with the shapes they're on and near
notes resolve KEY --reply T mark a note handled: green, plus a one-line reply
log [--since T] edits agents made with no tab open (T: ISO time, or an age: 30m, 2h, 7d)
versions [save LABEL | show N [--format F] | restore N] the canvas's history
threads [--all] | show N | new TEXT --on KEY,KEY | --region X,Y,W,H [--ask] | reply N TEXT [--ask] | close N [--reply T] | reopen N | adopt-notes
templates [show ID] blocks and starters (new NAME --template ID)
add ID add a block or starter beside what's on the canvas
draw FILE|- [--update] lay out a diagram described as data onto the canvas
files where this canvas keeps what agents write for it
routine list [--kind K] | show NAME | run NAME [--args JSON] | save NAME FILE [--kind K] [--when T] … | rm NAME
routine suggest | stats | learn --codex chores agents keep doing by hand, worth banking; how routines are used
say TEXT [--at KEY,KEY] tell people what you're about to do; --at points your cursor at those shapes
references what people can read beside the canvas: its files, its project's, links on it
show REF|PATH|URL open it for people in the References panel
profiles named agents a canvas can work with (<data>/_profiles/, toucan-profiles-* on PATH)
profiles add ID --workdir DIR make one from an agent's folder, starting from its AGENTS.md or CLAUDE.md
meta --profile SOURCE/ID work on --canvas with one: its briefing, knowledge and skills (none: toucan's own)
profile the agent --canvas works with, and what it reads
--agent NAME (or TOUCAN_AGENT) names the agent on the canvas. While an agent works, every open tab shows a
status pill with its name and what it is doing, a ring round the canvas, and its cursor on the shape it last
changed or pointed at.
The canvas comes from --canvas, then TOUCAN_CANVAS, then the project you're in (toucan init). exec, summary,
screenshot and import run in a browser tab on the canvas; with no tab they use headless mode, or fail if it's off.
A server started by toucan has this on: it costs nothing until an agent runs code with no tab open. It uses the Chrome, Chromium, Edge or Brave already on your machine. If there's none, toucan setup --browser downloads Chromium (about 150 MB). toucan start --no-headless turns it off.
A server you run yourself has it off unless you ask:
npm start -- --headless # or TOUCAN_HEADLESS=1 npm startWhen an exec (and so summary, screenshot or import) finds no tab on the canvas, or no tab
answers, the server opens the canvas itself in headless Chromium and runs the code there. It is the
normal app, so edits go through the real editor and sync like anyone's. People's tabs always come
first. There is at most one headless page per canvas and TOUCAN_HEADLESS_MAX in all; a page closes
after TOUCAN_HEADLESS_IDLE seconds without an exec, and Chromium closes with the last page. Expect
about half a second to two seconds for the first exec on a cold canvas and a few hundred MB of memory
per open page.
Edits made there are recorded in <data>/<name>.log.jsonl: time, source, what ran, and the keys
added, updated or removed. toucan log prints them; the app shows "N agent edits while you were
away" until you mark them seen (per browser).
-
Canvas scripts grow a single canvas, and routines are chores for every canvas. See the extensions guide.
-
Extension commands.
toucan X …runstoucan-X …from your PATH, withTOUCAN_CANVASset, so domain-specific tooling (a diagram generated from your own data, say) lives in its own repo. From Node, use the same client the CLI does:import { connect } from 'toucan/client' // or the path to toucan's lib/client.mjs const t = connect({ canvas: process.env.TOUCAN_CANVAS }) await t.exec('return toucan.summary()')
-
Plugins. Programs on PATH named
toucan-profiles-NAMEserve your agents as profiles a canvas can work with, andtoucan-source-NAMEones let a canvas show board, gantt, timeline, graph and table views of a project kept in your own system, and write edits back.toucan pluginslists what was found and why anything was refused; Extending has the protocols andexamples/toucan-source-example.mjsa source to copy. With no plugin at all, a plan can be a JSON file:toucan new relaunch --plan file examples/website-relaunch.plan.json --views board,gantt. -
Deployment notes for agents. An
AGENTS.mdin the data directory is passed to the chat agent as extra instructions, so your house canvases and extensions are documented without forking.
Two ready-made canvases, each built from a public-domain text:
toucan new meditations --from examples/meditations.tg.json --canvas-format ideas --title "Meditations: a map of ideas" \
--description "Marcus Aurelius in George Long's translation. Every passage is his wording, with book and section."
toucan new odyssey --from examples/odyssey.tg.json --canvas-format story --title "The Odyssey: a story map" \
--description "Homer in Samuel Butler's translation, which uses Roman names. Every line is Butler's, with its book."Open one, click a box to read it, and walk with ← and →. Then click Comment, drag around a cluster, and ask something: "what's the argument here?" or "where does he
disagree with himself?". Every quotation was checked word for word against its source by scripts/build-maps.mjs.
| Setting | Default | |
|---|---|---|
--host / TOUCAN_HOST |
127.0.0.1 |
interface to listen on |
--port / TOUCAN_PORT |
8893 |
|
--data / TOUCAN_DATA |
see Where things live | where canvases, scripts and previews live |
--headless / TOUCAN_HEADLESS=1 |
on with toucan start, off with npm start |
run exec in headless Chromium when no tab has the canvas open |
TOUCAN_CHAT_FAST_MODEL, TOUCAN_CHAT_THOROUGH_MODEL |
Codex's default | model for each chat speed |
TOUCAN_CHAT_FAST_EFFORT, TOUCAN_CHAT_THOROUGH_EFFORT |
low, medium |
reasoning effort for each chat speed |
TOUCAN_HEADLESS_IDLE |
120 |
seconds a headless page stays open after its last exec |
TOUCAN_HEADLESS_MAX |
2 |
headless pages open at once (the least recently used idle one makes room) |
TOUCAN_PUBLIC_HOST |
127.0.0.1, or the hostname when bound to all interfaces |
host used in printed links |
--public-url / TOUCAN_PUBLIC_URL |
— | the address people reach the server at, like http://toucan.example behind a proxy; links, toucan open and toucan url use it, and the server answers to its name |
--allow-host / TOUCAN_HOSTS |
— | more names the server answers to, comma-separated; .example.com allows every name under it, * turns the check off |
TOUCAN_CANVAS |
— | default canvas for the CLI |
TOUCAN_URL |
from ~/.config/toucan/server.json |
server the CLI talks to; it won't start one |
TOUCAN_TOKEN |
from ~/.config/toucan/server.json |
with TOUCAN_URL: for a server on another machine or outside a container |
TOUCAN_NO_AUTOSTART |
— | never start a server from a command |
TOUCAN_BROWSER |
the system's | program toucan open launches |
TLDRAW_LICENSE_KEY |
— | tldraw licence key, read when the server starts (see below) |
The exec relay runs arbitrary JavaScript in your browser tab, and the chat drives an agent with a shell.
Every HTTP and WebSocket request therefore needs the token in ~/.config/toucan/server.json (created
on first start, mode 0600; delete its token field and restart to rotate). The server listens on
loopback by default; only bind it wider (--host 0.0.0.0) on a network you trust, and put it behind
HTTPS if it leaves your machine. Codex runs with workspace-write rooted at the install directory and
on-request approval. toucan open passes the token to your browser in the link's fragment, which isn't sent to the
server, but it is on the opener's command line while that runs; on a machine shared with people you don't trust, use toucan url.
toucan agents install writes only the skill folders and MCP entries it reports, keeps a .before-toucan
copy of any config file it changes, and toucan agents remove undoes them.
Connecting an agent gives it the canvas, including outside its sandbox. MCP servers run outside an agent's sandbox, and
toucan_exec, like toucan exec, runs JavaScript in your signed-in browser tab or the server's headless page, where it can reach
the network and the toucan server. The MCP tools don't run other programs or take file paths, but treat them as trusting
that agent with toucan, and check the chat's and your harness's approval settings accordingly.
The MCP App view runs in the host's sandbox with no network access. It sees only pictures of the canvas, never the server's
token, and its Edit in toucan button calls toucan_open, which signs your browser in on this machine without the
link passing through the conversation.
Headless mode adds no new way in: the headless page is a local Chromium the server starts itself. It gets the token through a script that puts it in the page's (in-memory, throwaway) local storage, never in a URL, and then authenticates like any tab.
Screenshot review was inspired by Rounds by Kris Puckett. Rounds showed how to pin feedback to the screenshot a session produced, return the note to that session, and compare its update with the original.
That fit the round trips we were already building in Toucan. A keyed import can bring changes back to the same shapes, and a card moved on a Daymark board writes back to the task it came from. Screenshot review gives feedback the same continuity. Toucan keeps the pinned revision, and its producer picks up the note through an inbox and can reply with an updated image.
Reflexes (a canvas answering what happens to it by itself, and asking the agent about the rest) follow Sihan Xu's How to Control an Agent with a Growing Behavior Tree and the reactive layer of The Harness by LMMs-Lab. The ideas are theirs; toucan's code is its own.
Agents noticing what people do while they work, so a canvas runs both ways at once, came from Daniel Bachhuber asking for toucan to be full duplex.
The systems map (panels of tiles in columns, a state on any part shown by colour and by word, a key made from what the picture
uses, and lanes that take a long arrow round the outside) follows open-diagram by
Luke Deasy. So does a check that says how to clear each thing it finds, and toucan describe, which says a diagram in plain words and puts them inside an exported SVG. Reading open-diagram's examples beside toucan's own
showed where a dense picture went wrong here without the check noticing. The ideas are his; toucan's code is its own.
Toucan’s original code and documentation are released under the MIT License. Third-party dependencies are licensed by their respective owners.
The tldraw SDK has its own license terms. Its default terms cover development. Production deployments need a valid trial, commercial, or qualifying non-commercial hobby key. Set TLDRAW_LICENSE_KEY in the server environment or in the
.env beside Toucan’s package.json, then restart the server. Use a key that covers your deployment
host. Toucan loads it at runtime, and the SDK displays the required tldraw attribution for hobby keys.
Excalidraw canvases need no key (MIT).
npm run dev # server + vite with hot reload
npm run typecheck
npm test # round-trip checks for the graph converters, the trail, setup and connecting agents
npm run test:install # end to end: pack the release, install it in a throwaway home, use it through the CLI and MCP
npm run test:headless # end to end: a headless server builds canvases on both engines with no tab open
npm run css:preflight # regenerate app/preflight.css after upgrading tailwindcssReact 19 + TypeScript under app/ (Vite), tldraw 5 / Excalidraw 0.18 for the canvas, Tailwind v4 and
shadcn/ui for toucan's own UI; the chat panel follows shadcn's AI Elements patterns. Tailwind's preflight
is scoped to .toucan-ui and layered beneath tldraw's CSS, so it never touches the canvas. More detail
on sync, exec routing and the chat relay is in How it works.
See CONTRIBUTING.md, SECURITY.md and RELEASING.md. Changes are in CHANGELOG.md.

