Skip to content

Latest commit

 

History

History
217 lines (146 loc) · 27 KB

PANE_MCP.md

File metadata and controls

217 lines (146 loc) · 27 KB

Pane MCP Server

runpane mcp is an MCP server that gives coding agents Pane's runpane commands as tools. With it, an agent in any repository can list saved repositories, create Panes, open panels, read terminal screens, and send input. Pane installs a pane skill in the user's home skill folders so agents can find the CLI and how to connect.

Automatic registration

The Pane desktop app registers the server for you. On launch, Pane adds a pane MCP server to your user-level config:

  • Claude Code: via claude mcp add pane --scope user …, which writes ~/.claude.json (or $CLAUDE_CONFIG_DIR/.claude.json).
  • Codex: a [mcp_servers.pane] table in ~/.codex/config.toml (or $CODEX_HOME/config.toml).
  • Cursor: a mcpServers.pane entry in ~/.cursor/mcp.json. Pane detects Cursor from ~/.cursor, cursor, agent, or cursor-agent on PATH.

Packaged Pane also installs the on-demand pane-manage-and-message-agents user skill for detected Claude Code, Codex, and Cursor clients. Cursor uses ~/.cursor/skills/; Claude Code and Codex use their user skill folders (including $CLAUDE_CONFIG_DIR and $CODEX_HOME). Pane leaves hand-added skills alone and removes only its own copy when registration is off. The same applies inside detected WSL distros. Cursor documents ~/.cursor/skills/ as a user-level Agent Skills directory.

Pane registers only when it detects the corresponding client, and it manages only the entry it wrote:

  • It leaves other MCP servers and settings alone and never writes a second pane entry.
  • It rewrites its own entry when the app moves or updates.
  • A pane entry you added yourself (for example with npx runpane mcp) is left untouched, including when you turn the setting off. For Claude Code, Pane's entry is the one that runs <Pane data dir>/mcp/runpane/dist/cli.js. For Codex, it's the [mcp_servers.pane] table carrying the # Managed by Pane comment. For Cursor, it is the entry whose first argument is Pane's bundled runpane copy.
  • Pane edits config.toml as text, so your comments and formatting survive. It then parses the result and writes nothing unless the only change is Pane's own entry. Cursor JSON is parsed before editing; invalid JSON is left untouched. Writes are atomic and follow a symlinked config.

On Windows, Pane also registers inside each WSL distro that has a saved WSL repository. Agents there run the Windows Pane binary through WSL interop.

The registered command is the Pane executable in Node mode (ELECTRON_RUN_AS_NODE=1) running a copy of the runpane CLI at <Pane data dir>/mcp/runpane/dist/cli.js. No Node.js or npm install is needed. Only packaged builds register; a development build never touches your agent config.

To turn this off, open Settings → AI & Agents and switch off Register Pane tools with Claude Code, Codex, and Cursor. Pane then removes its entry from each config.

Restart a running claude or codex session to pick up a new registration. In Cursor, start a new chat or use Developer: Reload Window. Check with claude mcp list, codex mcp list, or agent mcp list. Cursor CLI may require agent mcp enable pane to add the server to its local approved list; Pane leaves that trust decision to you.

Claude tabs Pane starts: one HTTP server

Claude Code and Claude chat tabs that Pane starts reach the same tools over HTTP, served by the running Pane app, instead of each starting its own runpane mcp process:

  • Pane listens on 127.0.0.1 at a random port, path /mcp (streamable HTTP, stateless), on the same loopback listener as Claude's prompt hooks. It answers only loopback Host headers and loopback or absent Origin headers.
  • A tab whose agent uses this endpoint gets a random token, held in Pane's memory and in that tab's environment as PANE_MCP_TOKEN, with the URL in PANE_MCP_URL. Other tabs get neither. The token alone tells Pane which tab is calling; a tool call runs runpane with that tab's environment and folder, and Pane's own data folder (PANE_DIR), exactly as the tab's own stdio server would. A request without a live token gets 401. Closing the tab, or its shell exiting, revokes the token, and a tab restart gets a new one. Tokens are never logged, written to disk, or put on a command line.
  • A Claude terminal launch gets --mcp-config=<Pane data dir>/mcp/pane-http.json (the agent config's terminal.paneMcpConfigFlag). That file names the pane server with ${PANE_MCP_URL} and Bearer ${PANE_MCP_TOKEN}, which Claude reads from the tab's environment. Claude puts it in place of the user-level pane entry, so the agent sees one pane server. A command with --strict-mcp-config runs unchanged.
  • A Claude chat tab passes the same server, with the same two variables, in its ACP session/new request (chat.paneMcpHttp); the token is in the adapter's environment only.
  • Everything else keeps the user-level stdio server: Codex and Cursor tabs, WSL and SSH tabs, wrapped or preserved launch commands, and agents you start outside Pane. Codex merges a per-launch -c mcp_servers.pane into the user-level stdio table and then refuses to start, and its ACP adapter skips a session server whose name the config already defines. Cursor has no per-launch MCP option. Either would need a per-launch way to replace a same-named server.
  • Pane quits its tabs with itself, so after a restart each tab starts with a fresh token and URL.
  • Settings apply at once. With Register Pane tools off, new tabs get no token, and a running tab's calls get 403 until it restarts on stdio. A toolsets change applies to the next request.
  • Serving is stateless. A call ends, and its runpane process stops, when the agent drops the request; a separate notifications/cancelled message has no request to cancel. An agent that names itself only at initialize is named after the tab's agent, so notify keeps its long wait.

Claude plugin

Pane's Claude plugin (the claude-plugin/ folder) gives Claude Code and Cowork the pane and pane-manage-and-message-agents skills and this server, started as npx -y runpane@<pinned version> mcp --toolsets plugin. The pinned runpane hands each call to the installed Pane's own CLI when that one is newer, so the tools follow the installed Pane.

While the plugin is on in Claude Code's user settings (enabledPlugins has pane@<marketplace> set to true), Pane steps aside so Claude sees one Pane server and one copy of each skill:

  • On launch, Pane removes its own pane entry from Claude Code's user config and its own Claude copies of the two skills. If Pane is already running when you turn the plugin on, restart Pane so it removes them. After you turn the plugin off, restart Pane to bring them back. Codex and Cursor registration is unchanged.
  • Claude terminal tabs that Pane points at its HTTP server also deny the plugin's server (deniedMcpServers, plugin:pane:pane). Claude keeps only the last --settings, so the deny goes into the one settings file Pane already gives each Claude tab for its prompt hooks, merged with any settings the command passes (such as a Session's folder access). Chat tabs get the same deny in their session settings.

Toolsets

A server that offers dozens of tools makes models, especially smaller ones, worse at choosing the right one. So by default the server serves a lean core toolset, and everything else is opt-in:

Toolset Tools
core (default) agents_start, agents_status, agents_send, panels_create (a new agent tab in an existing Pane), panels_input (exact keys, for menus and prompts), panels_open (show a page or file beside the agent), repos_list, repos_add, repos_rename, panes_list, workspace_state, panes_git_status, panes_adopt, panes_rename, panes_archive, panes_restore, sessions_create, sessions_associate, sessions_pin, links_create, docs_search, docs_read, doctor, notify (ask the person and wait for the answer), secrets_request (ask the person for a secret, saved as a Pane secret; the value never comes back), secrets_lease (ask the person to lease secrets from 1Password; returns the lease id, end time and machines), theme_read and theme_set (restyle Pane itself with a Custom theme, only when the person asks), the six device tools (device_list, device_open, device_screenshot, device_act, device_run, device_close; see Devices), the sixteen browser tools (browser_open, browser_snapshot, browser_click and the rest; see Browser tools), the four workspace tools, the seven loop tools (loops_list, loops_create, loops_update, loops_run, loops_pause, loops_resume, loops_delete), and the seventeen to-do tools (todos_create, todos_update, todos_attach, todos_detach, todos_show, todos_list, todos_assign, todos_ask, todos_comment, todos_review, todos_done, todos_drop, todos_archive, todos_start, todos_stop, todos_snooze, todos_wake)
agents the three agent tasks, workspace_state, watch
panes create, adopt, list, archive, restore, pin, unpin, rename, focus, pause, resume, cost, run and stop the run script, move to a folder, folders_list, folders_create
panels create, open, list, output, screen, input, submit, submit-composer, wait, pause, resume, last-message, close
workspace workspace_list, workspace_read, workspace_write, workspace_exec: find your other machines, move files to and from them, and run commands there (see Workspaces). Tools that look, such as agents_status and sessions_overview, take machine to ask another computer, a read-only one included
git status, commit, push, pull, fetch, rebase onto main, squash-rebase onto main, stash, stash-pop, soft reset (panes_*)
sessions the sessions_* tools (including sessions_pause and sessions_resume) and the three named-lock tools (lock_acquire, lock_release, lock_list)
loops loops_list, loops_create, loops_update, loops_run, loops_pause, loops_resume, loops_delete (see Loops)
todos todos_create, todos_update, todos_attach, todos_detach, todos_show, todos_list, todos_assign, todos_ask, todos_comment, todos_review, todos_done, todos_drop, todos_archive, todos_start, todos_stop, todos_snooze, todos_wake: the person's to-do list of agent work; none needs yes
autopilot autopilot_status, autopilot_waiting, autopilot_stack, autopilot_stack_push, autopilot_answer, autopilot_close, autopilot_rewrite: Autopilot's (experimental) reads, its stack, and its actions on waiting items. autopilot_stack_push takes one tab per call (the CLI's --tab repeats). Only Autopilot's panel may act (AUTOPILOT_ONLY), and a permission prompt, or an answer or rewrite of a secret card, is refused with AUTOPILOT_CANNOT_ANSWER
repos the repository tools, including repos_get and repos_update (a repo's Project Settings: build, run and archive scripts, worktree folder)
devices the six device tools plus device_usage and device_free, which report and free what simulators use on this machine (Devices)
browser the sixteen browser_* tools, which drive this Pane's browser tabs (Browser tools)
machine machine_health (disk and memory levels, the Panes using the most memory, leak warnings, and what Pane can free by tier) and machine_cleanup (lists one kind of tier 1 or 2 item, and deletes them with yes: true; tier 3 is refused with how to free it)
secrets secrets_list, secrets_delete, secrets_lease, secrets_lease_end. No tool sets or reads a value: agents use secrets through runpane secrets exec, and logins through browser_fill (Pane secrets)
docs, links, admin documentation, deep-link, and diagnostic tools
plugin core without the four workspace tools: what the Claude plugin serves
all / read every tool / every read-only tool

Choose with runpane mcp --toolsets core,git (comma-separated). --read-only keeps only read-only tools from whatever is selected. The Pane app registers core by default; Settings → AI & Agents → Pane tools to register switches it to all. Each command's toolsets live in the contract's toolsets field. A command's cliOnlyFlags stay out of its tool: over MCP, doctor diagnoses only, and --fix and --report run from the CLI.

The three agent jobs

The core set is built around the three jobs agents most often need, each finished in one call:

  • agents_start: starts the agent with the task, waits until it is ready, and returns the pane and panel ids and a pane:// link. Pass pane to open it as a new tab in an existing Pane (review, audit, fix, QA); pass repo and name only for new work, which creates a Pane. Each feature has one Pane, and its reviews, audits, fixes and QA are tabs in it (runpane doctor has Pane's working rules).
  • agents_status: whether the agent is working, ready, blocked (waiting on a person), idle, or exited, plus its current screen.
  • agents_send: submits a follow-up and reports whether the agent took it or queued it behind its current turn (delivery), read from the agent's transcript where Pane can find it.

Asking the person: notify

notify asks the person a question, or tells them something, in Pane, and returns their answer as the tool result. ui picks the look: options (1 to 9 choices; returns {answer, note?} with the chosen label), approve (returns {approved, note?}), ask (returns {answer}), or info (returns {delivered} at once). choices, suggestions and action are typed arrays and objects in the input schema. It needs no yes. When Pane is not running, Approvals is off, or the Pane is too old to have notify, it returns {unavailable, next} and the agent asks in its terminal instead.

For an API key, token or password, agents call secrets_request, never notify with ask. The person enters the value on a secret card, Pane saves it as a Pane secret, and the result is only {status: "saved", project, name} or {status: "declined"}. When it returns unavailable, the agent asks the person to save the secret in Pane under Settings > Secrets.

A question can wait for hours, and each client limits a tool call differently:

  • While any call runs, the server sends a notifications/progress about every minute when the request carried a progress token. That keeps Claude Code's 30-minute idle window open, over stdio and over Pane's HTTP endpoint alike.
  • Claude Code and Codex wait in one call. Pane's registration gives Codex a long per-server tool timeout.
  • Every other client, including Cursor's CLI (which ends each call after a fixed 60 seconds), gets {waiting: true, id, next} after about 50 seconds. The question stays on screen, and the agent calls notify again with resume: <id>. For a question asked from outside Pane, Pane ends this loop after 15 minutes without an answer and returns unavailable. A question asked from a Pane tab has no such limit and outlives the call: if the agent stops resuming, its answer is typed into its tab as an answer: line.

The server tells Pane which agent is asking (Claude, Codex, Cursor, or the client's own name) from the client's MCP name, and inside a Pane terminal the question names its Pane and panel. See Pane Notify.

Docs and links

docs_search searches Pane's docs, runpane help, per-command context, and the Pane Chat skills installed in the Pane data directory. It returns short excerpts with paths. docs_read returns one path in full. Both work offline, and the same docs are listed as runpane-docs: MCP resources.

links_create builds pane://open?pane=<id>[&panel=<id>], pane://open?repo=<id>, or pane://open?session=<id>. Pane registers the pane:// scheme on macOS, Windows, and Linux. Opening an open link (from a browser, a terminal, or links_open) raises Pane and selects what it names (a Session opens on its Overview tab). It never changes Pane state, and a link with any unexpected part is rejected. links_open also takes a start link, below, which only asks the person.

links_create with prompt builds a start link, such as pane://new?agent=<id>&repo=<repo>&prompt=<text>, for a button on a web page, in docs or in a chat bot's message. Without repo or session the agent starts in a new Session. repo is a saved repository's id, its name, or owner/repo, matched against each saved repository's origin remote, and starts the agent in a new Pane there. session sends the prompt to that Session's agent. web returns the https://runpane.com/open form, which opens Pane or offers its download; it must be at most 2,048 characters, the most Chrome and Edge pass from a web page. The result also carries webUrl and html, a one-line Open in Pane button. Opening a start link never runs anything on its own: Pane shows the prompt, the agent and where it runs, with Cancel as the default, and only Start starts the agent. A link Pane can't open shows why in Pane. Open in Pane links has the snippet, every limit and every error message.

Registering by hand

Without the desktop app, or for another MCP client, run the server from npm: npx --yes runpane@latest mcp. Add --toolsets <names> to choose tools.

claude mcp add --scope user pane -- npx --yes runpane@latest mcp
codex mcp add pane -- npx --yes runpane@latest mcp

Cursor (~/.cursor/mcp.json):

{ "mcpServers": { "pane": { "type": "stdio", "command": "npx", "args": ["--yes", "runpane@latest", "mcp"] } } }

VS Code (.vscode/mcp.json, or run MCP: Add Server):

{ "servers": { "pane": { "type": "stdio", "command": "npx", "args": ["--yes", "runpane@latest", "mcp"] } } }

Any other client that can launch a stdio server uses the same command and arguments.

agents_send uses the target agent's composer state. For Codex, it queues with Tab while the agent is working and submits with Enter when ready. A send is confirmed only after the text leaves the composer; if it remains, the result includes a command to retry the appropriate key. panels_submit_composer with strategy: auto uses the same keys.

runpane mcp is stdio only: it runs next to the Pane app on the same machine, with no OAuth. Pane's own HTTP endpoint serves only the tabs Pane starts on this machine. To drive a remote Pane, run the server on the remote host.

The Python package (pipx run runpane) does not include the MCP server, the docs search, or the agent tasks, because they need Node. From Python, those commands print the npm command and exit with status 2.

Manual test steps

Automated tests cover the registration and link logic on every OS. Check these by hand on a packaged build of each platform.

macOS, Windows, and Linux

  1. Install and launch Pane, with Claude Code, Codex, and Cursor installed.
  2. Run claude mcp list, codex mcp list, and agent mcp list. Each lists pane. If Cursor asks for approval, run agent mcp enable pane; it should report ready with 37 core tools.
  3. In a fresh claude session, ask "Use Pane to list my repos". It calls repos_list.
  4. Quit and relaunch Pane. The Claude, Codex, and Cursor configs are unchanged.
  5. Turn off Settings → AI & Agents → Register Pane tools with Claude Code, Codex, and Cursor. pane is gone from all three configs, and the other entries are unchanged.
  6. Open a Claude tab in a Pane and type /mcp. It lists one pane server under built-in MCPs, and no runpane mcp process runs under that claude. Ask it to list Panes; it calls panes_list over HTTP.

pane:// links

  1. Get a link: runpane links create --pane <pane-id>.
  2. With Pane running, open it from a browser or a terminal:
    • macOS: open "pane://open?pane=<pane-id>"
    • Windows: start "" "pane://open?pane=<pane-id>"
    • Linux: xdg-open "pane://open?pane=<pane-id>"
  3. Pane comes to the front on that Pane, and no second Pane window opens. On Windows and Linux, the extra process hands the link to the running Pane and exits.
  4. Quit Pane and open the link again. Pane starts and opens that Pane.
  5. Open pane://open?pane=<pane-id>&archive=1. Pane says Unknown pane link parameter: archive and changes nothing.
  6. Open the link from runpane links create --repo <owner/repo> --prompt "Say hello". Pane asks whether to start the default agent in that repository and shows the prompt. Cancel changes nothing; Start opens a new Pane whose agent receives the prompt. With a repository Pane doesn't have, Pane says no saved repository matches.
  7. On Linux, check the handler: xdg-mime query default x-scheme-handler/pane names Pane's desktop file (AppImage and .deb).

Windows with WSL

  1. Save a repository that lives in a WSL distro, with Claude Code, Codex, and Cursor installed inside that distro.
  2. Relaunch Pane. Inside the distro, claude mcp list, codex mcp list, and agent mcp list show pane, whose command is /mnt/c/.../Pane.exe.
  3. From a claude session inside the distro, ask "Use Pane to list my repos". The call reaches the Windows Pane.
  4. Turn the setting off. pane is gone from the distro's configs too.

Example prompts

  • "Use Pane to start Claude on fixing the login redirect in the web repo, and give me a link to watch it."
  • "How is the agent in my fix-login Pane doing? Does it need anything from me?"
  • "Tell the fix-login agent to also add a test for the redirect."
  • "Which of my Panes have uncommitted or unpushed work?"
  • "How do I archive a Pane and get it back later? Check Pane's docs."

Not supported

  • Streaming. watch --follow and watch --until-event aren't offered; use agents_status, or watch with timeoutMs.
  • App settings. Agents can't read or change Pane's settings.
  • Permanently deleting Panes or removing repositories. Those stay in the app, where the user sees what goes.
  • Pagination (the full list is small).
  • Code or scripts run inside the MCP server itself. Agents run code in Pane terminals through agents_start and agents_send.

Protocol

The server uses the MCP TypeScript SDK v2, over stdio or (in Pane) streamable HTTP. It speaks MCP revision 2026-07-28, which has no handshake: server/discover, with the version and client capabilities carried on each request. It also accepts the 2025 initialize handshake that current Claude Code and Codex releases send, negotiating down to 2025-11-25.

Over stdio, only JSON-RPC goes to stdout, the server exits when stdin closes, and cancelling a call (notifications/cancelled) stops the runpane process running it. Over Pane's HTTP endpoint, dropping the request does.

Tools

Tools are generated from contracts/runpane/contract.json when the server starts:

  • Every command that has result jsonSchemas becomes a tool. Spaces and hyphens in the name become underscores: repos list → repos_list, panels submit-composer → panels_submit_composer.
  • The tool's inputs are the flags from the command's usage lines and its agentContext arguments, in camelCase (--timeout-ms → timeoutMs). Flags that take a value are strings and flags without one are booleans, unless the agentContext argument declares a JSON schema (an enum, array, or object); array and object values reach the CLI as JSON (--choices=[...]). Daemon commands also accept paneDir. Commands marked otherMachines take a machine input, which runs them as runpane workspace <machine> <command>. Positional agentContext arguments become string inputs too: <machine> and <path> go where the first usage line puts them, and -- <command> becomes command, passed after --.
  • The description combines the command's summary, details, and notes from agentContext. The title is runpane <command>.
  • The output schema is the command's *Result JSON schema. Every call runs runpane <command> … --json and returns its JSON output, both as structuredContent and as a text block for older clients. Mentions of runpane <command> in that output are rewritten to name the tool, except in docs and workspace tools, whose file contents and command output come back unchanged.
  • A non-zero exit returns a tool error (isError: true). A CLI failure reads as its message, a Next: line that names tools instead of CLI commands, and a Code: line; a command's own ok: false result comes back as its JSON. Bad arguments are tool errors too, so the model can correct them. An unknown tool name is a JSON-RPC Invalid Params error (-32602).
  • Annotations come from the contract. readOnlyHint is the inverse of mutates. A mutating tool is destructiveHint: true unless the command is marked additive. idempotentHint and openWorldHint follow the idempotent and openWorld fields.
  • Values are passed as --flag=value, so a value may start with - (for example - [ ] item).

Adding or changing a command in the contract changes its tool. There is no per-tool code.

A few flags are left out. --json is always passed. --follow and --until-event are omitted because a streaming or open-ended watch cannot return a single result; call watch with timeoutMs instead. Tools have no stdin, so pass exact terminal bytes in text (for example \u0003 for Ctrl-C) rather than inputFile: "-".

Confirmation

Mutating tools keep the CLI's confirmation rule. Every command whose usage includes --yes gets a yes input; without yes: true, the call fails with the CLI's own refusal and changes nothing. workspace_exec and workspace_write have no --yes in the CLI, so the server asks for yes: true itself and refuses the call before anything runs. notify, secrets_request, theme_set, report, and the sessions_* and lock tools have no yes. machine_cleanup without yes is a dry run: it lists what it would delete and changes nothing. Tools are also annotated with readOnlyHint, so clients can auto-approve read-only tools and prompt for the rest.

Agent guidance

Pane installs a managed pane skill under ~/.claude/skills/pane (or $CLAUDE_CONFIG_DIR/skills/pane) and ~/.agents/skills/pane, including saved WSL distros on Windows. It leaves any existing skill without Pane's marker alone, rewrites a copy an older Pane marked, and leaves a copy a newer Pane marked. The skill also covers what to do when tools look missing: the bundled CLI ($PANE_RUNPANE_BIN, ~/.pane/bin/runpane) before npx, runpane notify when this server's tools are not loaded, and where Pane keeps its data. Install Pane skill for agents in Settings → AI & Agents controls the installation; turning it off removes Pane's copy.

Publish Pane instructions to AGENTS.md is off by default. If enabled, Pane writes a marked block into the active repository's AGENTS.md with CLI and MCP setup instructions. Turning it off removes only Pane's marked block from saved repositories. On upgrade, Pane turns off the old default once and removes those blocks; a later opt-in is remembered. The full command catalog lives in MCP tools and runpane agent-context.