Guide
Publish HTML from Codex
Add one MCP server to the Codex CLI, 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 Codex CLI 0.163.0 on 21 October 2026.
What you get
Artifact Publisher is a remote MCP server at https://app.artifactpublisher.com/mcp (streamable HTTP). Codex sends it one self-contained HTML document and gets back a stable link. Each call is authenticated with your publisher key, which Codex sends 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. Codex 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
- The Codex CLI (
codex), 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. For Codex, open "Need the publisher key only?" under it and use Copy 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. Codex reads it from an environment variable each time it starts, so 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 Codex
codex mcp add artifact-publisher --url https://app.artifactpublisher.com/mcp \
--bearer-token-env-var ARTIFACT_PUBLISHER_KEYCodex confirms it:
Added global MCP server 'artifact-publisher'.The command adds this block to ~/.codex/config.toml. It stores the name of the variable, not the key. If you prefer, paste the block into that file yourself; it is the same asconfigs/codex/config.toml in our public artifact-publisher-mcp repository.
[mcp_servers.artifact-publisher]
url = "https://app.artifactpublisher.com/mcp"
bearer_token_env_var = "ARTIFACT_PUBLISHER_KEY"3. Check the configuration
codex mcp listThe server should be listed as enabled, with a bearer token read from ARTIFACT_PUBLISHER_KEY:
Name Url Bearer Token Env Var Status Auth
artifact-publisher https://app.artifactpublisher.com/mcp ARTIFACT_PUBLISHER_KEY enabled Bearer tokenThis list shows the configuration; it does not call the server. If the key is wrong, the server answers with HTTP 401 when Codex starts, and Codex reports that the artifact-publisher tools are not available. IfARTIFACT_PUBLISHER_KEY is not set in the shell you run codex from, Codex reports the same, with no error message. In both cases, check the variable in that shell and try again.
4. Publish your first page
Run this prompt headless with codex exec from a project folder that is a Git repository (outside one, add --skip-git-repo-check):
codex exec '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 Codex", and reply with the share link and the artifact_id.'Codex writes the HTML and calls the publish_artifact tool with a title and thehtml. 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:
Published publicly: Hello from Codex
https://app.artifactpublisher.com/artifact/<slug>
artifact_id: <artifact_id>Now open your link in a private window: the page loads without sign-in. That is your first publish.
The tool result behind the reply also has version 1, a pinned viewer_url ending in?v=1 and visibility public.revoke_artifact takes the artifact_id, the slug or the viewer link. Codex asks for approval before it runs revoke_artifact, and codex exec cannot answer that question, so the call fails. To take the page down headless, allow that one tool for the run:
codex exec -c 'mcp_servers.artifact-publisher.tools.revoke_artifact.approval_mode="approve"' \
'Revoke the artifact with artifact_id <artifact_id> using the artifact-publisher MCP server.'update_artifact is marked as destructive too, so Codex may ask for approval before it publishes a new version as well.
Next
- MCP integration: every tool, scope and limit
- Publish HTML from Claude Code, step by step, if you use Claude Code instead
- Publish HTML over MCP from Claude Code, Cursor, VS Code and other clients
- Share a Claude artifact without a Claude account
- FAQ and privacy