Guide

Publish HTML from Claude Code

Add one MCP server to Claude Code, ask it to publish a page, and get back a link that opens in any browser without sign-in.

Updated

By Angle Labs GmbH. Tested with Claude Code 2.1.304 on 21 October 2026.

What you get

Artifact Publisher is a remote MCP server at https://app.artifactpublisher.com/mcp (streamable HTTP). Claude Code sends it one self-contained HTML document and gets back a stable link. Each call is authenticated with your publisher key in an Authorization: Bearer header.

Free plan available.

Before you start

1. Put the key in your environment

Keep the key out of prompts, repositories and the pages you publish. Set it in your shell, or in your shell profile so new terminals have it:

export ARTIFACT_PUBLISHER_KEY='<your-key>'

2. Add the server to Claude Code

Run this in the project you want to publish from:

claude mcp add --transport http artifact-publisher https://app.artifactpublisher.com/mcp \
  --header "Authorization: Bearer ${ARTIFACT_PUBLISHER_KEY}"

Claude Code confirms it and hides the key in its output:

Added HTTP MCP server artifact-publisher with URL: https://app.artifactpublisher.com/mcp to local config
Headers: {
  "Authorization": "[REDACTED]"
}

The shell fills in the key when you run the command, and Claude Code stores the resulting header in its local configuration for this project. Add --scope user to use the server in every project. Your workspace page also offers a ready-to-run version of this command with the key already in it.

To share the setup with a project instead, commit this .mcp.json at the repository root. Claude Code reads ARTIFACT_PUBLISHER_KEY from each person's environment, and claude mcp list shows the server as pending approval until you start claude in the project and approve it.

{
  "mcpServers": {
    "artifact-publisher": {
      "type": "http",
      "url": "https://app.artifactpublisher.com/mcp",
      "headers": { "Authorization": "Bearer ${ARTIFACT_PUBLISHER_KEY}" }
    }
  }
}

3. Check the connection

claude mcp list

The line for the server should end in Connected:

artifact-publisher: https://app.artifactpublisher.com/mcp (HTTP) - Connected

If the key is wrong, the line says Failed to connect and names an HTTP 401 with the message "A valid publisher API key is required." Check the variable, then remove the server withclaude mcp remove artifact-publisher and add it again.

4. Publish your first page

Start claude in the same project and give it this prompt:

Make a one-page, self-contained HTML page that says hello and shows the current date (all CSS inline, no external files). Publish it with the artifact-publisher MCP server as a public artifact titled "Hello from Claude Code", and reply with the share link.

Claude Code writes the HTML and calls the publish_artifact tool with a title and thehtml. It asks for permission the first time it uses the tool; allow it. The page runs in a sandbox with no network access, so the prompt asks for everything inline. The wording of the reply varies; ours was:

I published the page as a public artifact titled "Hello from Claude Code".
Anyone with the link can open it without signing in.

https://app.artifactpublisher.com/artifact/<slug>

Open the link in a private window: the page loads without sign-in. The tool result behind the reply also has theartifact_id, version 1, a pinned viewer_url ending in ?v=1 andvisibility public. To take the page down, ask Claude Code to revoke it:revoke_artifact takes the artifact_id, the slug or the viewer link. To publish without an interactive session, run the prompt headless and allow the one tool it needs:

claude -p 'Make a one-page, self-contained HTML page that says hello and shows the current date (all CSS inline, no external files). Publish it with the artifact-publisher MCP server as a public artifact titled "Hello from Claude Code", and reply with the share link.' \
  --allowedTools "mcp__artifact-publisher__publish_artifact"

Next