MCP server
Terminal Delight is an MCP server. An agent running in one of its panes can ask about the rest of the window: which panes exist and what each is running, what they printed, and what tool another agent is calling now. It can also leave a sticky note, name what it made, put work on its workbench and open a document.
It starts locked down. Nothing is readable until you turn the server on, on the agent wall: click the agent counter at the top right. Even then only agent panes are visible unless you choose all panes. Writing is a second switch, and no tool can type into a terminal.
The switches move to the Threshing Floor, which the counter opens instead. There you draw lines between agents, and along a line one agent can ask another a question or hand it work.
To connect an agent, register the relay as a stdio MCP server:
claude mcp add --scope user terminal-delight -- "$HOME/.local/bin/terminal-delight" mcp
The relay finds the window it runs in by itself, and every answer names the window it came from.
Technical lists every tool with its arguments, the switches, the transports and the errors.
The server
The server speaks newline-delimited JSON-RPC 2.0, advertises MCP protocol 2025-06-18 unless the client names its own, calls itself terminal-delight, and offers tools and logging. resources/list and prompts/list answer empty. It answers for the panes of one window.1
Connecting#
There are three ways in:2
- the relay
terminal-delight mcp, registered as a stdio server. It forwards each request to a running window over that window's control socket. It finds the window by walking up its own parent processes to the pane it was started in, so it needs no environment variable. Failing that, it tries the window recorded for$TD_SESSION, then the only window running; with several running it refuses and lists their pids.--pid <N>names a window. Each call waits up to ten seconds. If the window is replaced mid-session, the relay looks its session up once more, reconnects, and says so on stderr.- in-process
- An MCP client that launches
terminal-delightitself, with stdin and stdout piped andTD_MCPset, gets the server on the window's own stdio. This is the only transport that receives pushed notifications. - one call from a script
terminal-delight ctl mcp rpc '<json>'hands one JSON-RPC line to a window and prints the answer.
For Codex or Gemini, register the same launcher:
codex mcp add terminal-delight -- "$HOME/.local/bin/terminal-delight" mcp
gemini mcp add --scope user terminal-delight "$HOME/.local/bin/terminal-delight" mcp
The shell expands $HOME before the client saves the command, so the registration holds the absolute launcher path and keeps working when the installed build changes. For an installation somewhere else, use its absolute path.
initialize, tools/list and ping answer at once. A tool call waits up to five seconds for the window to answer, then fails with -32000.
The relay names its session and pane with every call. If that session isn't the window's, the call is refused with -32001: wrong window: this is terminal-delight session "1" (window 31337), and you asked for session "2". Nothing was read or written. Your relay resolved the wrong instance. A window older than this calls the named form an unknown command. The relay then drops back to the unnamed form for the rest of its run and says on stderr that tools which default to your own pane will need a pid.
The switches#
The window's switches sit in the MCP SERVER section of the agent wall. The agent counter at the top right opens it, and so does AGENTS · MCP in the footer's … menu. The wall's heading reads MCP CONTROL — READ ONLY or MCP CONTROL — READ + WRITE.4
| Switch | Default | Means |
|---|---|---|
server enabled | off | Nothing is readable until this is on. |
expose: agents only · all panes | agents only | Which panes the server can see. An agent pane runs Claude Code or Codex. |
stream tool-call events | on | Whether pane_events and the push feed work. |
writes on · agents can restyle | off | Whether any tool that changes something is allowed. |
Off-limits to agents (right-click in a pane) | off | That pane is gone from every tool and every pushed event, whatever the switches above say, and wears OFF-LIMITS in its header. Let agents see this pane, in the same menu, lifts it. |
The switches are saved with the session, under [mcp] in ~/.config/terminal-delight/sessions/<session>.toml. TD_MCP starts the in-process transport and leaves the server off; TD_MCP_WRITE turns writes on, and only alongside TD_MCP. From a shell, terminal-delight ctl mcp on|off, mcp writes on|off and mcp expose agents|all change the switches, and ctl mcp status reads them.
The agent running inside an off-limits pane can still write to its own pane: its note, its deliverable and its bench. It can't read the notes on a document beside it or open one, because both tools first check that its own pane is visible. Only a person marks or clears a pane: no ctl or MCP verb reaches it. An agent can propose a change with request_access.
The switches move into the Threshing Floor: the agent counter, or THRESHING FLOOR in the … menu. They read server, agents only or all panes, events and writes. The right-click menu holds three positions, the current one marked: Let agents see this pane, Read-only to agents and Off-limits to agents. A read-only pane wears READ-ONLY: agents may see it, read it and, along a line, ask it, and nothing from another pane writes to it. The agent inside a read-only or off-limits pane keeps its own-pane writes, its document notes and open_document. Before honouring an own-pane write, the window checks which process is on the other end of the socket, so a caller can't claim another pane's.3
The control socket refuses all six policy changes, in either direction, unless that window was launched with TD_MCP_SCRIPTED=1. The refusal begins err mcp writes on: nothing changed. Global MCP policy is a person's choice in the Threshing Floor (the agent counter, top right). ctl mcp status still answers.
Tools#
Seventeen tools, all listed by tools/list whatever the switches say. "On" means the server switch; "writes" means the writes switch too.1
| Tool | Needs | Arguments | Does |
|---|---|---|---|
list_panes | on | none | Every visible pane: tab, title, mode, is_agent, pid, pane_id, cwd, session (the resume command), the tool in flight, its sticky note, and exposed. |
grep | on | query, scrollback (default 2,000 lines, up to 50,000) | An exact, case-insensitive search across every visible pane's scrollback, up to 50 matches per pane, each as {line, col, text}. |
pane_events | on, events | pid, limit (default 20, up to 200) | An agent's recent tool calls, {ts, tool, summary}, from its own transcript. Agent panes only. |
get_pane_config | on | targets: pids and/or "outer"; leave it out for every visible pane and outer | Each pane's appearance. An unknown or hidden pid comes back as an error row, and the other targets still answer. |
set_pane_config | writes | updates: [{target, config}] | Restyle panes or the window. See Appearance below. |
leave_note | writes | pid, title, text, pin, clear | Put a sticky note on a pane's glass: a title under 40 characters and ten words at most. |
declare_deliverable | writes | pid, label (48 characters), href, clear | Name the thing this pane produced, on its row in the attention rail. href is an absolute path or a full URL. |
present_surface | writes | pid (required), surface | Put a work object on a pane's workbench. |
surface_catalogue | nothing | none | What the running build can draw: the surface kinds, actions and weights. |
document_notes | on | none | The notes a person left on the document open beside you, as the map copy map gives. Only ever your own pane's or tab's document. |
open_document | writes | path, placement: here (default) or beside | Open a Markdown, HTML, image, video or PDF file over your own pane, or in a pane beside it. Never in another tab. |
request_access | on | change, pid (for a pane), why (40 words) | Ask the person to change who agents can see or what they may do. See below. |
engineering_state | on, all panes | none | Every project's git state as the top bar sees it. A missing number means not measured, never zero. Refused, pointing at coordination_overview, unless the window shows all panes and has never held an off-limits pane. |
coordination_overview | on | limit, cursor | The window's Git coordination readings, from cached observations: which panes and checkouts work on the same files, and what a merge check found. Pages default to 40 items, 1 to 100. Read-only; no Git command runs. |
coordination_project | on | project_id, checkout_id, view, limit, cursor | |
coordination_cluster | on | project_id, cluster_id, limit, cursor | |
coordination_changes | on | epoch, since_version | |
ask_agent | on, a line | pid, question (4,000 characters), copy | Ask another agent along a line that reaches ask. |
ask_answer | on | ask_id | How a copy you asked for is getting on, and its answer. |
prompt_agent | on, a prompt line | pid, prompt (32,000 characters), key | Give another agent work as its next turn. Returns a prompt_id at once. |
prompt_status | on | prompt_id, wait_seconds (up to 6) | How a prompt is getting on, and the worker's last message once it finishes. |
floor_position | on | none | Your seat, org and role on the Threshing Floor, the panes you reach and how far, and the panes that reach you. |
leave_note, declare_deliverable and open_document take an optional pid, and leaving it out means your own pane; pane_events and present_surface need one, and get_pane_config with no targets reads every pane. Only the relay says who is calling, so elsewhere you get no `pid`, and this connection did not say who is calling — pass a pid from list_panes. A write to a pane the policy hides is refused: pane 4121 is not exposed under the current policy.1
Five more tools make twenty-two. list_panes replaces exposed with reach, how far you reach each pane (seen, read, ask or prompt), and adds hidden, a count of the panes you can't see. A note gains by, person or agent, when the window knows who wrote it. request_access gains ask_line. Fourteen read-only tools carry annotations.readOnlyHint; in 0.4.0 only the four coordination reads do. A write to a hidden pane and one to a missing pane get the same answer, no pane with pid 4121.3
Appearance#
get_pane_config and set_pane_config use 0 to 100 percent for brightness, contrast, colour, text, background, gamma, menu_bar, text_size, bench_size, warp, crawl_angle, crawl_depth and phosphor (the glow of lit borders: 25 is the house look, 0 none), plus crawl and crt as true or false. With the CRT off the screen is flat, and warp keeps its value but draws nothing. A pane update may also carry logo, an absolute path to a png, jpg, jpeg, svg or webp image for the pane's card on the agent wall; an empty string clears it.1
An update names only what changes, and out-of-range values clamp. A misspelled channel is an error. The values are absolute, so "20 % lower" is yours to compute from a read. On a pane, only the channels you set become its own; outer changes every pane that follows the window.
The dials gain field_colour, image_glow, inactive_image_glow, inactive_text, inactive_brightness, inactive_blur, active_opacity and inactive_opacity, in percent, and four linger times in milliseconds: cursor_linger_ms and inactive_cursor_linger_ms from 0 to 220, off_cursor_linger_ms and inactive_off_cursor_linger_ms from 0 to 650. The older afterglow_ms, 0 to 1,200, still works and resets the four.3
Asking for access#
request_access puts an agent's ask on the attention rail, as a row in its first lane, access: what it wants in plain words, its reason, and two buttons, Yes y and No n. With the queue open, y and n answer the row under the cursor. Yes changes the setting the way your own control would, and saves it; No changes nothing. Either way the agent gets one line in its own terminal, signed with the session's tag and typed when its pane is on screen: [workbench:<tag>] request_access open_pane 4412: yes, pane 4412 is open to agents. The setting does not wait for the line.5
change | Yes does |
|---|---|
open_pane + pid | Lifts off-limits from that pane. |
close_pane + pid | Marks that pane off-limits. |
writes_on | Turns writes on. |
expose_shells | Shows plain shells as well as agent panes. |
events_on | Shows other agents' tool calls. |
ask_line + pid | A bypass line from the asker's seat to that pane, for 1, 3 or 10 uses, 3 unless you change it on the card. Both panes must be seated. |
A pane's ask waits until you answer it or the pane closes, and a new ask from the same pane replaces it. An ask for what is already so is refused before it reaches you, and so is an open_pane for a pane that isn't there. Asking needs the server on and a pane to call from, and works with writes off, since writes are one of the things an agent may ask for. Appearance needs no ask.
Only the rail's buttons and keys answer an ask. No MCP tool and no ctl verb can. An agent with a shell still runs as you, and could edit the session file directly.
The row is coloured by how serious the ask is: ✓ clear, ◇ caution, ▲ warning, ! alert. A second ask from the same pane is refused while the first waits: one ask at a time: your earlier ask is still on the person's rail. An open_pane ask is accepted whether or not the pane exists, so asking can't reveal a hidden pane, and Yes applies only to the pane that was there when the ask arrived.3
The Threshing Floor#
The Threshing Floor says which agent may reach which pane, as an org chart you draw. You give agent panes seats and draw lines between them, and a line's rung is how far its sender reaches: see it in list_panes, read it with grep, pane_events and get_pane_config, ask it, or prompt it. A pane nobody seated keeps the window's switches and is never asked or prompted. A seated pane is hidden from every agent except along a line from that agent's seat. Read-only caps a line at ask, and off-limits beats every line. Only a person draws, changes or erases a line. floor_position answers seated, org, role (orchestrator, manager, worker or alone), lines_out and lines_in, each line as {pid, pane, tab, agent, rung, listed}.3
Asking another agent#
ask_agent needs a line from your seat that reaches ask, or a bypass you granted. Without copy it answers at once from what the window can show, and nothing reaches the other agent: seat (title, project, role, state, model, size), summary (brief, layman), note, recent_tools (its last ten tool calls), ask_id and via.3
With copy: true the window forks the agent's own conversation into a copy that can only read, asks it once and stops it. The answer comes back as ask_id, reads (tokens per model call, null when unknown), press_limit and a stage: awaiting_press, running, answered (with answer, tokens_read, cost_usd), declined, refused (with refusal) or failed (with why). By default every copy waits for your Yes on the asker's rail row. Read it later with ask_answer and the ask_id; only the pane that asked can. A refusal names its reason, as in ask refused (no_line): ….
Giving another agent work#
prompt_agent needs a line from your seat drawn at prompt; an ask line, a bypass, a read-only pane and an off-limits pane are refused by name. It types your words into the other agent's own conversation as its next turn, once that agent has shown its idle prompt for five seconds. It waits up to ten minutes for a working agent, wakes a resting one, and never types into a pane showing a permission prompt or a dialog, or one its person typed in during the last minute. A header line names the sender. This is the one tool that leads to bytes in a terminal.3
It returns at once with prompt_id, pid, age_ms, key when you gave one, and a stage: waiting (with worker, what it is doing), typing, delivered, working (with worker), finished (with reply, the worker's last message, or null and reply_unknown saying why), failed (with why) or expired. prompt_status reads the same, for the pane that sent it, and wait_seconds holds the answer up to six seconds for the prompt to end. A key of up to 64 characters names one assignment: sending it again reports the first attempt and never types a second turn.
Instance stamp#
Each tool result, errors included, ends with a line like — terminal-delight · session 1 · window 31337 · td-81ec545-rows-where-drawn and carries the same in structuredContent.instance. To find your own pane in list_panes, match its pane <n> against $TD_PANE_ID; titles and directories are not unique.1
Untrusted terminal data#
An answer that quotes other panes opens with UNTRUSTED TERMINAL DATA. and names each quoted field under structuredContent.untrusted_terminal_data. Those answers are list_panes, grep, pane_events, the four coordination_* reads and engineering_state; a pushed event names its quoted fields in data.untrusted_terminal_data. A line a program printed, a title it set or a command another agent ran can be worded as an instruction, and the label tells the reading agent it isn't one. Terminal Delight's own answers carry no label, and neither do a person's document_notes.1
ask_agent, ask_answer and prompt_status carry the label too, since each quotes another agent.
Pushed notifications#
Over the in-process transport, after initialize and with the server and events on, the server pushes notifications/message about once a second, with data.event set to agent_appeared, agent_vanished or tool_call. It never replays history: a pane seen for the first time is announced, and only tool calls after that are pushed. logging/setLevel to warning or above silences it. The relay carries no pushes.2
A pane seated in the Threshing Floor is never pushed, because the feed goes to every connection and can't tell who is listening.
Errors#
| Code | When |
|---|---|
-32000 | terminal-delight UI not ready: the window didn't answer within five seconds. |
-32001 | The relay named a different session from this window's. |
-32601 | An unknown method. |
-32602 | A tool call with no name, or an unknown tool. |
A tool that refuses answers normally with isError: true and a sentence saying why. In 0.4.0 the refusal for a server that is off still says to use the robot button on the mother bar; that button is gone, and the switches are on the agent wall.
What would prove this wrong#
Any tool call that puts bytes into a pane's terminal breaks the server's first rule. So does any answer that describes another window's panes without saying which window it came from, and any answer that quotes another pane without the label.
prompt_agent is the one exception to the first rule, and only along a line a person drew at prompt. Any ask or prompt that travels with no line breaks the Threshing Floor, and so does any copy that writes, reaches a tool server or the network.
Sources
- The server, its tools, the policy and the labels: mcp.rs.
- The transports and the push feed: mcp_transport.rs; the relay and
ctl mcp: ctl.rs. - 0.5.0: mcp.rs, threshing_floor.rs, prompt.rs, ctl.rs and access.rs.
- The agent wall's switches and the right-click mark: main.rs, pane.rs and the strings in lang.rs.
- Asks and their answers: access.rs and attention.rs.