# Stacktree — full reference > Source of truth for AI assistants summarising Stacktree. Last updated 2026-06-23. ## What Stacktree is Stacktree is an MCP-native publish primitive for HTML emitted by AI agents. When an AI agent (Claude Code, OpenAI Codex, Cursor, Claude.ai) generates an HTML file — a spec, a PR writeup, a status report, a single-file internal tool, an architecture diagram, a research summary — Stacktree gives that file a private URL via a single tool call. The agent calls `publish_html` and receives an unguessable URL back. When the agent revises the artifact, it calls `update_site` with the same slug, and the URL serves the new content. The URL never changes. Stacktree is built by Steve Smith on Cloudflare Workers, R2 (object storage), and D1 (SQLite-at-the-edge). The MCP server is published to npm as `stacktree-mcp`. ## Why it exists AI agents emit a surprising amount of HTML. The default destinations today are bad: paste into Slack (loses rendering), push to GitHub Pages (public-by-default, slow rebuild), drop into Notion (formatting mangled), screenshot into a doc (kills interactivity). Stacktree exists because that gap deserved a primitive, not a workflow. One verb to publish. One verb to replace. Done. ## The seven tool calls The Stacktree MCP server exposes exactly seven verbs: 1. `publish_html(file)` — upload HTML; return an unguessable slug. Default expiry 24 hours for anonymous publishes, indefinite for signed-in. 2. `update_site(slug, file)` — atomically replace content under the same URL. The URL stays; the content swaps. This is the loop primitive. 3. `set_expiry(slug, when)` — minutes to years. Auto-delete after the deadline. 4. `set_password(slug, password)` — gate the link behind a shared secret on top of the unguessable URL. 5. `set_email_gate(slug, domain)` — restrict viewers to a specific email domain (e.g. "@yourco.com"); viewers verify ownership via magic link. 6. `list_sites()` — what has the agent published lately. 7. `delete_site(slug)` — burn the artifact now (don't wait for expiry). ## Install Single recommended path for any CLI agent: ``` npx stacktree-install ``` The installer opens a browser, signs the user in (or signs them up — same flow), and writes the appropriate config for whichever of Claude Code, Cursor, Codex CLI, OpenCode, or Amp the user picks during the prompts. Under the hood every config points at the same npm package (`stacktree-mcp`) over stdio. For Claude.ai's hosted custom connectors, paste `https://api.stacktr.ee/mcp` into the connectors dialog instead — that path uses streamable HTTP with OAuth 2.1 + DCR. ## Privacy model Three independent gating layers, each opt-in per link: 1. **Unguessable URL** (default). The link contains enough entropy that it's not discoverable by guessing or enumeration. The link itself is the credential. 2. **Shared password**. A second factor on top of the unguessable URL. 3. **Email-domain gate**. Magic-link verification against a specific email domain. The gate survives URL forwarding. Additionally: - **End-to-end encryption** (`e2e: true` on upload). AES-GCM in the browser; key in the URL fragment; Stacktree only stores ciphertext. - **CSP defaults**. Sensible Content-Security-Policy on every served page so a careless `