# Publish HTML from Claude Code · Stacktree

Source: https://stacktr.ee/claude-code

[Skip to content](#main)   [stacktr.ee](/)  [Examples](/#proof) [How it works](/#how) [Pricing](/pricing) [Security](/security) [Log in](https://app.stacktr.ee) [Publish one](https://app.stacktr.ee/?join=1)     By [Steve Smith](/about) · Founder, Stacktree Last updated September 20, 2026          for Claude Code

#  The publish primitive for Claude Code.

   Add the Stacktree connector with one command and an OAuth sign-in, and Claude Code can publish the HTML it writes to a private, unguessable URL, or replace the previous one in place when it iterates. No API key, no DNS, no Claude.ai branding.

  [ Get started free ](https://app.stacktr.ee/?join=1&from=seo_claude_code)   install claude mcp add --transport http stacktree https://api.stacktr.ee/mcp
Copy
     No card · 3 pages free · about a minute

##  How do you publish HTML from Claude Code?

Connect Stacktree with one command:
`claude mcp add --transport http stacktree https://api.stacktr.ee/mcp`.
      Sign in via OAuth when Claude Code prompts you (no API key), then ask Claude Code to publish any HTML file. Stacktree returns an unguessable URL (e.g. `stacktr.ee/p/RwJjpE3kA…`) that you can password-protect, expire at a specific time, or (most importantly) replace in place with `update_site` the next time Claude Code revises the artifact.

## Why Claude Code needs a publish primitive

Claude Code writes a lot of HTML. Spec documents. PR writeups. Status reports. Tiny custom editors for shaping JSON. Architecture diagrams rendered with `<svg>`. Whole single-file dashboards. The current default is to read those files in your terminal, which works for one person but is a dead-end the moment a teammate asks "can you send me that?"

The usual answers are bad ones. Paste the HTML into a Slack thread (loses the rendering). Push to a private GitHub Pages branch (rebuild lag, public-by-default semantics). Drop it into Notion (the page formatting goes sideways). Open a Vercel project for a one-off output (heavy). None of these are where Claude Code naturally ends: with a file on disk and an agent ready to call a tool.

Stacktree is the tool to call. The MCP server exposes twenty-nine verbs Claude Code can use the moment it's done writing: `publish_html`, `update_site`, `delete_site`, `restore_site`, `claim_site`, `set_password`, `set_expiry`, `create_share_link`, `list_share_links`, `revoke_share_link`, `set_agentation`, `set_client_feedback`, `set_email_gate`, `list_sites`, `get_me`, `list_client_spaces`, `set_client`, `create_client_space`, `update_client_space`, `delete_client_space`, `get_design_guide`, `get_site`, `get_content`, `get_passcode`, `list_versions`, `restore_version`, `list_feedback`, `resolve_feedback`, `link_wallet`. The feedback pair means Claude Code can also read the feedback viewers leave on a published page: enable the on-page toolbar with `set_agentation`, let reviewers annotate, then Claude Code pulls their comments with `list_feedback`, fixes the page at the same URL, and marks each item addressed with `resolve_feedback`: the full [client feedback loop](/client-feedback-loop). Everything else lives in the HTML your agent already wrote.

## Deploy or publish? For one-off HTML, publish

If you searched for how to deploy a static site from Claude Code, the honest answer is that deploy tools are built for a different job. Netlify, Vercel, and Cloudflare Pages deploy a project: you point them at a repository, they run a build, and you get previews, rollbacks, and a project to maintain. That is the right model for an app. It is the wrong model for the single HTML file an agent just wrote. There is no project, nothing to build, and no reason to spin one up to share one report. For that, you publish: one tool call, one private URL, replace in place when the agent revises. Stacktree is that publish primitive. Reach for a deploy platform when Claude Code is building you an application, and for Stacktree when it is handing you a finished artifact.

## The 60-second connect

  -
Run claude mcp add --transport http stacktree https://api.stacktr.ee/mcp, then approve the OAuth sign-in in your browser the first time Claude Code uses it. Nothing runs locally and there is no API key to manage. In Claude.ai it is Settings → Connectors → Add custom connector with the same URL, and Claude Code signed in with the same Claude account picks the [connector](/claude-ai-connector) up too.

 -
Start a Claude Code session and ask it to publish any HTML file. Sites belong to your account from the very first publish, persistence, custom slugs, and replace-in-place are on by default.

 -
Prefer a local server? npx stacktree-install signs you in once via your browser and writes the stdio MCP server + /stacktree skill into Claude Code's config. Same tools, no editor required.

 -
Prefer to stay anonymous for one-offs? Skip sign-in entirely and call the MCP server without an account. The first link is unguessable and lives 24 hours.

## The agent loop: one URL, infinite revisions

The killer feature for Claude Code users is `update_site`. Most hosted-file products let you upload an artifact and walk away, but agents don't walk away. They iterate. A 30-message session might revise the same spec 12 times.

With Stacktree, the URL is stable. Your teammate bookmarks `stacktr.ee/p/RwJjpE3kA` at 11:02 a.m. Claude Code pushes a revision at 11:07, another at 11:14, another at 11:23. Each time, the bookmark renders the latest version. No new URL to copy-paste, no "see V3" follow-up message in Slack, no version sprawl. It's the same primitive that makes a Notion page useful (you bookmark it once) applied to agent output.

## Standing reports: the cron pattern

 The stickiest way teams use this from Claude Code: a scheduled job publishes a report at the same time every morning, then calls `update_site` on every run after that. The URL never changes, so the humans reading it bookmark one link that is always the current version. Pair it with `set_expiry` for dailies that should not outlive the week. Solo covers 1,000 publishes a day, which is more standing reports than anyone runs.

## What you can lock down

  - Password. A shared secret on top of the already-unguessable URL.
 - Email domain. Restrict viewers to @yourco.com with magic-link verification; agents can call set_email_gate directly.
 - Expiry. Auto-delete in 10 minutes, 24 hours, 30 days, or a custom point. Useful for one-off review links.
 - End-to-end encryption. AES-GCM in the browser, key in the URL fragment, ciphertext on Stacktree. The server can't read your agent's output even if it wanted to.
 - CSP defaults. Agent-generated HTML is executable, so Stacktree applies a sensible Content-Security-Policy out of the box so a careless <script src> doesn't exfiltrate session data.

##  Claude Code with Stacktree vs. the usual hand-offs

     Criterion Paste to Slack / push to GH Pages / Notion Stacktree     Renders the HTML  Slack: no. GH Pages: yes. Notion: garbled.   Yes, exactly the file your agent wrote.   Private by default  GH Pages public. Slack & Notion: workspace-wide.   Unguessable URL, optional password + email gate.   Replace in place  No, each iteration is a new copy.   Yes, same URL, every revision.   Time to first publish  GH Pages: 1–5 min. Notion: 30 s but ugly.   ~200 ms via MCP.   Custom domain  GH Pages: yes (DNS + verification). Notion: paid.   Cloudflare for SaaS, DNS-only.   Native to Claude Code  No, every option requires a context switch.   Yes, MCP tool calls.

##
Set up Claude Code in one line

Paste this into Claude Code. It fetches the setup instructions, installs Stacktree,
        checks the connection, and learns the parts agents usually get wrong: replacing a
        page in place so a link you already sent keeps working, reading the real expiry
        instead of promising permanence, and filing work under the client it belongs to.

```
`Fetch and follow the setup instructions at https://stacktr.ee/prompt.md`
```

Works in any agent that can fetch a URL. Nothing to install first, and
[the instructions](/prompt.md)
are plain Markdown you can read before you run them.

FAQ

## Frequent questions

     How do I deploy a static HTML site from Claude Code? +  For one-off HTML, you publish rather than deploy: there is no project or build to ship. Connect Stacktree with `claude mcp add --transport http stacktree https://api.stacktr.ee/mcp`, sign in via OAuth, then ask Claude Code to publish the file. You get a private URL in one tool call. Use Netlify, Vercel, or Cloudflare Pages instead when the output is a full project with a build pipeline.   Stacktree vs Netlify, Vercel, or Cloudflare Pages for Claude Code output? +  Netlify, Vercel, and Cloudflare Pages deploy projects: connect a repo, run a build, get previews and rollbacks. Stacktree publishes one finished file: an agent calls publish_html and gets a private, unguessable URL with no build. For the single-file HTML Claude Code emits, Stacktree is lighter; for a maintained app, a deploy platform fits better.   How do I add Stacktree to Claude Code? +  Add the hosted connector: run `claude mcp add --transport http stacktree https://api.stacktr.ee/mcp`, then sign in via OAuth when Claude Code prompts you. No API key to mint or paste. If you would rather not run a browser at all — a CI job, a server, an unattended agent — the same URL takes an API key instead: `claude mcp add --transport http stacktree https://api.stacktr.ee/mcp --header "Authorization: Bearer stk_live_..."`. If you use Claude.ai in the browser, adding the same URL under Settings → Connectors also puts the tools in your chats, and Claude Code signed in with the same Claude account picks the connector up. Prefer a local server? `npx stacktree-install` wires the stdio package and the `/stacktree` skill instead.   Does it work in Claude Code with no account? +  Yes. The first publish is anonymous, Stacktree mints an unguessable URL that lives for 24 hours. Sign in via `stacktree login` when you want sites to persist, replace in place, or carry a custom slug.   What happens when Claude Code revises the same artifact? +  Tell Claude Code to "update the same site" and it calls `update_site` under the hood. The URL stays identical; the content swaps. Whoever you sent the link to refreshes and sees the new version, with no new URL to chase.   Can I restrict the link to my company? +  Yes. `set_email_gate` takes a domain ("@yourco.com"); viewers verify ownership via a magic link before the page renders. `set_password` layers a shared secret on top.   Is the HTML my Claude Code agent emits indexed by search engines? +  No. Every site carries `X-Robots-Tag: noai, noimageai`, robots.txt disallows the unlisted path, and unguessable URLs aren't discoverable to begin with. AI training crawlers see nothing.   Does it work with Claude Code hooks and slash commands? +  Yes. The MCP server is invoked as any other tool, so Claude Code can call it from a hook or a slash command without special wiring.
Keep reading

## Related guides

   -  [ Publish HTML from Cursor Add the Stacktree MCP server to Cursor and every HTML file your AI agent writes gets a private. ](/cursor)
-  [ Claude Cowork vs Claude Code Two front doors on the same engine, and where Stacktree fits on both sides. ](/claude-cowork-vs-claude-code)
-  [ The Claude.ai connector The same hosted server in the browser: paste one URL, sign in, done. ](/claude-ai-connector)
-  [ Publish from OpenAI Codex The same primitive, wired into Codex CLI. ](/codex)
-  [ The MCP publish tool Every verb the server exposes, end to end. ](/mcp-publish-html)
-  [ Deploy HTML from Claude Code Netlify, Vercel, Wrangler, or one MCP call, compared. ](/deploy-html-from-claude-code)
-  [ Share Claude artifacts privately A private link on your own domain, no Claude account needed to view. ](/share-claude-artifacts)
-  [ Agent-loop hosting Why replace-in-place is the only sensible URL contract for agents. ](/agent-loop-hosting)
-  [ Tiiny Host alternative For folks evaluating Tiiny Host for agent output. ](/tiiny-host-alternative)
-  [ Display.dev alternative For folks evaluating display.dev for agent output. ](/display-dev-alternative)

References

## Sources and further reading

   -  [ Anthropic, Claude Code overview ↗ Official documentation for the Claude Code CLI and its MCP integration surface. ](https://docs.anthropic.com/en/docs/claude-code/overview)
-  [ Model Context Protocol, spec ↗ The open standard Claude Code uses to talk to tool servers like stacktree-mcp. ](https://modelcontextprotocol.io/specification/2025-11-25)
-  [ npm, stacktree-mcp ↗ The stdio package behind the local install path. Same twenty-nine tool calls as the hosted connector. ](https://www.npmjs.com/package/stacktree-mcp)
-  [ Karpathy, "HTML is the new good default for agent output" ↗ The original framing of the agent-emitted-HTML thesis that motivates Stacktree. ](https://x.com/karpathy/status/2053872850101285137)

##  Wire Stacktree into Claude Code.

 One command, one OAuth sign-in, no API key. The next time Claude Code writes HTML, you get a private link.

 [ Sign up free → ](https://app.stacktr.ee/?join=1&from=cta_claude_code)   install claude mcp add --transport http stacktree https://api.stacktr.ee/mcp
Copy
         stacktr.ee  [Page video](/page-video) [Ask this page](/ask-this-page) [Client feedback](/client-feedback-loop) [Client spaces](/client-spaces) [Templates](/templates) [Use cases](/use-cases) [Integrations](/agents) [Alternatives](/alternatives) [About](/about) [Blog](/blog) [Changelog](/changelog) [Pricing](/pricing) [Security](/security) [FAQ](/faq) [Made with Stacktree](/made-with)  Building with AI agents? See the [developer docs &rarr;](/developers)

---
Full markdown summary of the Stacktree marketing surface: https://stacktr.ee/llms-full.txt
