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.
- For a personal workspace, the link is
publicby default: anyone who has it can open the page without signing in. It is not listed or searchable. - Readers can leave comments on the page. Claude Code reads them with
get_feedbackand answers withreply_to_feedback. update_artifactadds a new version behind the same link. Earlier versions stay readable at their pinned URLs.revoke_artifactstops serving the page.- One document can be up to 10 MiB of UTF-8 (25 MiB on the Max plan).
Free plan available.
Before you start
- Claude Code, signed in. The steps below run in a terminal.
- An Artifact Publisher account and publisher key. Open your workspace, continue with GitHub or Google and create your workspace. The page shows a publisher key once, inside a ready-to-run Claude Code command, and offers to copy the key only. Only a hash of the key is stored, so a lost key is replaced, not recovered. The quickstart covers this step.
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 listThe line for the server should end in Connected:
artifact-publisher: https://app.artifactpublisher.com/mcp (HTTP) - ConnectedIf 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
- MCP integration: every tool, scope and limit
- Publish HTML from Codex, step by step, if you use the Codex CLI instead
- Publish HTML over MCP from Cursor, Codex CLI, VS Code and other clients
- Share a Claude artifact without a Claude account
- FAQ and privacy