# Deploy HTML from Claude Code: 4 ways, one command each · Stacktree

Source: https://stacktr.ee/deploy-html-from-claude-code

[Skip to content](#main) PFrom Product Hunt? Your first pages are free, no card. Code `PRODUCTHUNT` takes 50% off your first month of Studio.[Start free &rarr;](https://app.stacktr.ee/?join=1&from=producthunt)

&times;   A Stacktree customer sent you. Your first month is 50% off on any plan, taken off at checkout. [Start free &rarr;](https://app.stacktr.ee/?join=1&from=referral)

 &times;      [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 August 29, 2026          comparison

#  Deploy (or publish) HTML from Claude Code

   Claude Code can ship a static HTML file four ways: the Netlify CLI, the Vercel CLI, Cloudflare Wrangler, or Stacktree over MCP. The first three deploy a project. The last one publishes a single file. Here is how each works, and which fits the HTML an agent just wrote.

  [ Get started free ](https://app.stacktr.ee/?join=1&from=seo_deploy_html_from_claude_code)   install npx stacktree-install
Copy
      No card · 3 pages free · about a minute

##  How do you deploy or publish HTML from Claude Code?

Two different jobs. To deploy a project, Claude Code runs a CLI against a
      folder: Netlify, Vercel, or Cloudflare Wrangler ship the directory to a
      hosting platform, sometimes after a build. To publish one finished file,
      Claude Code calls publish_html over MCP and gets a private URL back. For an
      app, deploy. For a single agent-made file, publish.

## Deploy a project vs publish a file

The word people search for is "deploy," but the right verb depends on what
      Claude Code just handed you. A deploy ships a project: a directory
      of files, often with a build step, tracked as a site you maintain over time
      with previews, rollbacks, and a dashboard. A publish ships a finished
      file: the agent calls one tool, you get one URL, done. Deploy platforms
      are genuinely the better tool when Claude Code is building you an
      application. A publish primitive is the better tool when it is handing you a
      one-off report, spec, or dashboard you want to send to one or two people.
      There is also a third route: Claude Code can upload the file to claude.ai as
      an artifact, with its own sharing rules (see
[what its publish prompt means, clause by clause](/blog/claude-code-publish-artifact-private)).

The four options below split cleanly along that line. Netlify, Vercel, and
      Cloudflare Pages deploy a folder to a platform you own. Stacktree publishes a
      single file over MCP. Each section covers how an agent triggers it, whether
      a build runs, how auth works, whether you can go account-free, and what each
      is best for.

## Netlify CLI

  How an agent triggers it. Claude Code runs the Netlify CLI
      in a shell. A production deploy is `netlify deploy --prod` (short
      form `netlify deploy -p`). A bare folder of static files ships
      with `netlify deploy --dir=public --prod`.

  Build or not. No build is required. You can deploy a bare
      directory with `--dir` and no framework, or let Netlify run a
      build for a framework project.

  Auth. Interactive OAuth via `netlify login`
(browser authorization, token stored in config), or a Personal Access Token
      passed through the `NETLIFY_AUTH_TOKEN` environment variable for
      automation.

  Anonymous or not. Netlify is the one deploy platform here
      with a true no-account path: `netlify deploy --allow-anonymous`
creates a project, deploys it, and generates a live URL, giving you one hour
      to claim ownership by logging in or creating an account.

  MCP. Netlify ships an official MCP server, the Netlify MCP
      Server, as the npm package `@netlify/mcp` (run via
`npx -y @netlify/mcp`). It is a local stdio server, not a remote
      URL, and it lets code agents create, manage, build, and deploy projects. It
      requires Node.js 22+ and a Netlify account.

  Best for. Static or framework sites you want to maintain on
      Netlify, especially the rare case where you want a live URL with no account
      up front.

## Vercel CLI

  How an agent triggers it. Claude Code runs `vercel`
(equivalent to `vercel deploy`); a production deploy uses
`vercel --prod`. The deployment URL is always written to stdout,
      which is convenient for an agent to capture.

  Build or not. The CLI operates on a Vercel project. Running
`vercel` in a directory sets up or links a project (prompts can be
      skipped with `--yes`, and agent environments default to
      non-interactive). A directory of static files can be deployed, but it is
      associated with a Vercel project rather than a bare anonymous upload.

  Auth. Interactive `vercel login`, or token-based
      auth via the `--token` flag (short form `-t`) or the
`VERCEL_TOKEN` environment variable (recommended for CI).

  Anonymous or not. A Vercel account is required. The docs
      describe no anonymous, no-account deploy path.

  MCP. Vercel ships an official remote OAuth MCP server,
      Vercel MCP, at `https://mcp.vercel.com`. It can manage projects
      and deployments and analyze logs, and it is supported in Claude Code (added
      with `claude mcp add --transport http vercel https://mcp.vercel.com`).
      It only supports Vercel-approved AI clients.

  Best for. Framework apps and projects on Vercel that need
      builds, preview deploys, and serverless or edge functions.

## Cloudflare Wrangler (Pages)

  How an agent triggers it. Claude Code runs
`npx wrangler pages deploy [directory]`, where
`[directory]` is the folder of static files to upload. It can
      deploy a bare folder of static assets without a build or project.

  Build or not. No build is required for a bare folder of
      static assets. Wrangler uploads the directory directly.

  Auth. Interactive `wrangler login` (OAuth browser
      flow), or non-interactive via the `CLOUDFLARE_API_TOKEN`
environment variable (with `CLOUDFLARE_ACCOUNT_ID`) for CI/CD and
      automation.

  Anonymous or not. A Cloudflare account is required. No
      anonymous deploy is documented.

  MCP. Cloudflare ships official remote MCP servers over OAuth,
      including the Cloudflare API MCP server
      (`https://mcp.cloudflare.com/mcp`), Workers Bindings, Workers
      Builds, and Workers Observability. Their tool sets center on managing
      existing Cloudflare resources rather than a one-call static upload.

  Best for. Static sites and apps you run on Cloudflare's
      network, where you already manage other Cloudflare resources.

## Stacktree (over MCP)

  How an agent triggers it. Claude Code calls the
`publish_html` tool over MCP. Connect once with
`claude mcp add --transport http stacktree https://api.stacktr.ee/mcp`
and approve the OAuth sign-in; the same URL works as a
[Claude.ai custom connector](/claude-ai-connector). Then ask
      Claude Code to publish the file it wrote. The server exposes
forty-one tool calls, `publish_html` and
`update_site` among them. Prefer a local stdio
      server? `npx stacktree-install` (or
`claude mcp add stacktree -- npx -y stacktree-mcp`) wires the
      npm package instead.

  Build or not. No build, no repo, no project. Stacktree hosts
      static HTML directly. The unit is a single file, not a directory you deploy.

  Auth. Two ways in. OAuth in the browser: the hosted server
      registers Claude Code via Dynamic Client Registration and you sign in
      once, with nothing to mint, store, or rotate. Or send an API key, which
      is what an unattended agent wants:
`--header "Authorization: Bearer stk_live_..."`. The stdio
      installer signs you in via your browser too. You can also publish anonymously over the raw API:
`curl -X POST https://api.stacktr.ee/sites -F file=@index.html`
works with no account and no API key.

  Anonymous or not. Yes. The first publish is anonymous:
      Stacktree mints an unguessable URL that lives for 24 hours, with no account.
      Signed-in sites persist and can be replaced in place.

  Private by default. Every URL is unguessable
      (for example `stacktr.ee/p/RwJjpE3kA…`), so the link is the
      credential. You can layer an optional shared password and an optional
      email-domain gate verified by magic link. `update_site` replaces
      the contents at the same URL, so a bookmarked link always renders the latest
      revision.

  Best for. The single finished HTML file Claude Code emits:
      a report, a spec, a status writeup, a one-file dashboard, that you want to
      send privately without it becoming a repository or a tracked project.

## Side by side

    Criterion Stacktree Netlify Vercel Cloudflare Pages     Trigger from agent publish_html over MCP netlify deploy --prod (CLI) vercel --prod (CLI) npx wrangler pages deploy [dir] (CLI)   Build step None, hosts HTML directly Optional, bare folder OK with --dir Project build, static folder also OK None for a bare static folder   Private by default Yes, unguessable URL plus optional gates No, public site URL No, public unless protection added No, public site URL   Replace-in-place URL Yes, update_site keeps the same URL Re-deploy to the same project Re-deploy to the same project Re-deploy to the same project   Anonymous / no account Yes, 24h anonymous URL Yes, --allow-anonymous (claim within 1h) No, account required No, account required   Official MCP server Yes, remote at api.stacktr.ee/mcp — OAuth or an API key (+ stdio) Yes, @netlify/mcp (local stdio) Yes, remote at mcp.vercel.com Yes, remote API + Workers MCP servers   Best for One finished file an agent emits Sites/projects on Netlify Framework apps with builds + functions Sites/apps on Cloudflare's network

## When to use which

Be honest about the split. If Claude Code is building you an
application, a folder with a build, a framework, server
      logic, a site you will maintain, the deploy platforms win and it is not close.
      Use the Vercel CLI for framework apps that want fast builds,
      preview deploys, and functions. Use Cloudflare Pages via
      Wrangler when you live on Cloudflare's network. Use the
Netlify CLI for static or framework sites on Netlify, and
      for the unusual case where you want a live URL with no account at all.

If Claude Code is handing you a single finished HTML file,
      a report, a spec, a one-off dashboard, the deploy model is overkill. There is
      no project, nothing to build, and no reason to create one to share one page.
      That is where [Stacktree](/private-html-hosting) fits: an agent
      calls `publish_html`, you get a private unguessable URL, and
`update_site` replaces it in place as the agent iterates. It hosts
      static HTML only, so it is not an app platform like Vercel and not a
      maintained-site host like Pages. For the file an agent just wrote, that
      narrowness is the point. See
[how agents publish HTML over MCP](/mcp-publish-html) and the
[Claude Code publish primitive](/claude-code). If the pages must
      never leave infrastructure you run, look at
[self-hosting an artifact server](/open-artifacts-alternative) instead.

FAQ

## Frequent questions

     How do I deploy a static HTML site from Claude Code? +  Point a deploy CLI at a folder. Netlify uses "netlify deploy --dir=public --prod", Cloudflare uses "npx wrangler pages deploy [directory]", and Vercel uses "vercel --prod". Each ships a static folder to a hosting platform. For a single finished HTML file, publishing over MCP is lighter than spinning up a project.   How do I publish just one HTML file from Claude Code without a project? +  Use a publish primitive instead of a deploy CLI. Connect Stacktree with "claude mcp add --transport http stacktree https://api.stacktr.ee/mcp" (OAuth sign-in, no API key), then ask Claude Code to publish the file. It calls publish_html over MCP and returns a private, unguessable URL in one tool call. No repo, no build step, and no project dashboard to manage.   What is the difference between deploying and publishing HTML? +  Deploying ships a project: you point a CLI at a directory, the platform may run a build, and you get a maintained site with previews and rollbacks. Publishing ships one finished file to a URL. For an app, deploy with a CLI. For a one-off artifact an agent emits, publish it.   Can Claude Code deploy to Netlify, Vercel, or Cloudflare without a browser login? +  Yes, with a token in an environment variable. Netlify reads NETLIFY_AUTH_TOKEN, Vercel reads VERCEL_TOKEN (or a --token flag), and Wrangler reads CLOUDFLARE_API_TOKEN with CLOUDFLARE_ACCOUNT_ID. Each also supports an interactive browser login. All three require an account on the platform.   Can Claude Code deploy a static site with no account at all? +  Among the deploy platforms, only Netlify documents a true no-account path: "netlify deploy --allow-anonymous" creates a project and a live URL, with one hour to claim it. Vercel and Cloudflare both require an account. Stacktree publishes anonymously over MCP, returning a 24-hour unguessable URL with no account.   Do these platforms have official MCP servers for Claude Code? +  Yes. Netlify ships @netlify/mcp, a local stdio server that can create and deploy projects. Vercel ships a remote MCP at mcp.vercel.com, added with "claude mcp add". Cloudflare ships remote MCP servers for its API and Workers. Stacktree ships a remote OAuth server at api.stacktr.ee/mcp, with stacktree-mcp as the local stdio option, focused on publishing a single HTML file.
Keep reading

## Related guides

   -  [ Publish HTML over MCP The forty-one tools the server exposes, and how an agent ships a private link with one call. ](/mcp-publish-html)
-  [ Publish HTML from Claude Code The publish primitive wired into Claude Code, with replace-in-place across iterations. ](/claude-code)
-  [ Publish from OpenAI Codex The same MCP publish primitive, wired into the Codex CLI. ](/codex)
-  [ Agent loop hosting Why a stable, replace-in-place URL is the right contract for iterating agents. ](/agent-loop-hosting)
-  [ Private HTML hosting Unguessable URLs, password, email-domain gate, and end-to-end encryption. ](/private-html-hosting)
-  [ Private GitHub Pages alternative When the deploy needs to stay private without an Enterprise Cloud seat. ](/github-pages-private-alternative)
-  [ All hosting alternatives Compare Stacktree against the other places people deploy and publish HTML. ](/alternatives)

References

## Sources and further reading

   -  [ Netlify CLI: Get Started ↗ Official docs for netlify deploy --prod, the --dir flag, token auth, and --allow-anonymous. ](https://docs.netlify.com/cli/get-started/)
-  [ Netlify MCP Server documentation ↗ The @netlify/mcp local stdio server that lets code agents create and deploy projects. ](https://docs.netlify.com/build/build-with-ai/netlify-mcp-server/)
-  [ Vercel CLI: vercel deploy reference ↗ Official reference for vercel, vercel --prod, project linking, and the stdout deployment URL. ](https://vercel.com/docs/cli/deploy)
-  [ Vercel: Use Vercel's MCP server ↗ The remote OAuth MCP at mcp.vercel.com and how to add it in Claude Code. ](https://vercel.com/docs/agent-resources/vercel-mcp)
-  [ Cloudflare: Wrangler Pages commands ↗ Official docs for npx wrangler pages deploy [directory] to ship a static folder. ](https://developers.cloudflare.com/workers/wrangler/commands/pages/)
-  [ Cloudflare: MCP servers for Cloudflare ↗ The official remote MCP servers for the Cloudflare API and Workers. ](https://developers.cloudflare.com/agents/model-context-protocol/mcp-servers-for-cloudflare/)

##  Publishing a single file an agent made?

 Skip the project and the build. Claude Code calls publish_html, you get a private unguessable link, and update_site replaces it in place as the agent iterates.

 [ Sign up free → ](https://app.stacktr.ee/?join=1&from=cta_deploy_html_from_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)     [Send your first link free](https://app.stacktr.ee/?join=1&from=sticky_deploy_html_from_claude_code) No card · 3 pages free

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