About Pi
Pi is an MCP server published by earendil-works in the AI category: aI agent toolkit: unified LLM API, agent loop, TUI, coding agent CLI. Conduid read 34 tools from its source: artifact, artifact_delete, artifact_edit, artifact_html_errors, artifact_html_eval, artifact_html_logs and 28 more. It is published to npm as @earendil-works/pi-mcp, a package with no command-line entry point.
The earendil-works/pi monorepo this package is published from has 125K stars and 16K forks, is licensed MIT, and its last commit was on 2 Dec 2026. The latest release is v1.7.0 (27 Nov 2026): New Features Terminal session resume: Compatible terminals can reopen the current pi session after a restart with its original profile, tool restrictions, and instructio… It follows v1.6.1 (25 Nov 2026), and the 5 most recent releases go back to v1.5.1 (9 Nov 2026). It passes all 4 static checks Conduid ran on the repository. Its topics include client.
Install
npm install @earendil-works/pi-mcpgit clone https://github.com/earendil-works/piTools (34)
artifactArtifacts (html, md) of this session: write, edit, show inline or beside the chat.artifact_deleteDeletes an artifact with every version and its state.artifact_editEdits an artifact's newest content by exact replacements (each `old` occurring exactly once, none overlapping) into a new version. Returns the version.artifact_html_errorsThe errors the open pages of an html artifact reported (script errors, failed loads), oldest first.artifact_html_evalRuns JavaScript in an html artifact's page open on some device, as an async function body (`return` a JSON value). Fails when no page is open.artifact_html_logsWhat the open pages of an html artifact logged (console lines, errors, warnings) after `since` (the `next` of an earlier call), and the newest `next`.artifact_html_set_stateReplaces an html artifact's state (any JSON, at most ${MAX_ARTIFACT_STATE / 1024} KiB); its open pages get it at once.artifact_html_stateAn html artifact's whole state (null until something set it), as the page last saved it.artifact_listThe session's artifacts (id, kind, title, newest version, updated), the newest first.artifact_openOpens an artifact beside the chat (a view of its kind), or shows its view again. Returns the view's id.artifact_readAn artifact's content: its newest version, or `version`.artifact_showShows an artifact in the transcript, right after this call, for everyone in the session (a page runs there).artifact_writeWrites an artifact: a new one (kind html: a page; md: a Markdown document; its id made from the title unless given), or the next version of artifact `id`. Open pages of it reload. Returns its id and version.bashExecute a bash command in the current working directory. Returns combined stdout and stderr. Output is truncated to last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.editEdit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.location_dirsList the folders of a directory on an environment (default: your cwd), to find where to work. Shows at most 200.location_envsList the environments you can work on: this device, the configured SSH environments (host, last test) and sandboxes. Shows where you work now.location_moveportspowershellExecute a PowerShell command in the current working directory. Returns combined stdout and stderr. Output is truncated to last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.reload_pluginsBuilds p2's changed plugins (the user plugin root's and the built-in ones) and rolls them out to the server, every session's worker and the page; optional plugins names them. Reports per plugin: applied, removed, failed with the errors (file:line:column: message), or refused with the reason; and errors logged meanwhile. A failed build applies nothing: the old code keeps running. Runtime code needs npm run reload -- --restart instead.send_fileOffer a file for browser download. Path is relative to your cwd. Copies a private snapshot (maximum 25 MiB) and shows a Download link to all authorized viewers of this session. Downloads require a click; do not export secrets. Snapshots are retained.subagenttelemetryThe owner's traces and metrics: telemetry_find_traces, telemetry_get_trace, telemetry_find_metrics (describeNamespace("telemetry") gives their declarations).telemetry_find_metricsA metric's 10 s aggregates (count, sum, min, max per series and interval), e.g. chord.link.bytes, pi.ai.request.duration. Filters: startMin/startMax (ms), attributes (equalities). At most 1000 rows.telemetry_find_tracesTraces in the owner's telemetry store, newest first: traceId, the earliest span's name, start (ms since epoch), duration, span and error counts, hosts. Filters: name (the earliest span's), attributes (equalities one span matches, at most 8), errors, startMin/startMax (ms), limit (at most 50), cursor (the previous page's).telemetry_get_traceOne trace: as text (a tree of spans with their lengths, attributes, events and links) and its spans (at most 2000, by start; truncated says when there were more). found is false for an unknown or expired trace.terminalUse the session's terminals, the ones the user sees in p2's terminal panel, like tmux. Only when the user asks for a terminal, or to drive an interactive program in one; never instead of bash. Call tools.terminal({ command, args }), args being tmux's argv after the command name (no quoting). Windows are numbered per session (1, 2, ...); -t takes a number or a name. - new-window [-n name] [-c dir] [-w W] [-T s] [command ...]: a shell at your cwd (-c: relative to it); command is typed into it, then Enter. - list-windows - send-keys -t T [-l] [-w W] [-T s] key ...: tmux key names (Enter, C-c, Up, Escape, Tab, BSpace, M-x, F1) are keys, other args text; -l: all text. - read -t T [-w W] [-T s]: output since your last read. - capture-pane -t T [-S -N] [-e]: the screen, plus N scrollback lines; -e keeps colors. - kill-window -t T new-window, send-keys and read return the output since your last read of that window, after waiting: W is quiet (0.5 s without output; the default of new-window and send-keys), exit, /regex/ or none (read's default); -T is the timeout in seconds (default 10, send-keys 5, max 120). A timeout is no error. Result: { window, output, running, foreground?, exitCode?, screen?, skipped?, timedOut? }; output is plain text, or a full-screen program's screen (screen: true); list-windows: { windows }. const { window } = await tools.terminal({ command: "new-window", args: ["-n", "dev", "npm run dev"] }); await tools.terminal({ command: "send-keys", args: ["-t", String(window), "C-c"] });viewViews: panes beside the transcript every viewer of the session sees (markdown files, the changes, artifacts, plugins' panes): list, open, close, arrange, resolve annotations.view_arrangeLays out the person's panes: a node is a view ID ('transcript' is the chat), {tabs: [IDs], active: ID} or {row or column: [nodes], sizes: [shares]}; views left out are hidden.view_closeCloses a view (its annotations go with it).view_listThe session's views (id, kind, item, title), the layout you arranged last, the person's selections and the annotations nobody resolved.view_openOpens a view beside the transcript (or, with the id of one, shows it again with what you give): kind markdown (item: a file), changes (item: an optional path), or a plugin's kind (item: its item ID). Returns its id.view_resolveRemoves annotations you dealt with: these IDs, or every one on a view ('transcript' for the chat's).Security checks
From the earendil-works/pi monorepo, not this package alone.
Static checks derived from the repository 3 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 1.3K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by flake.lock and 3 more.
2 checks have not been run yet.
Releases
From the earendil-works/pi monorepo.
README
The repository's README runs to about 1.3K words, fetched 3 days ago. The original in the repository is authoritative.
Read full README