Publish HTML Artifacts from AI Agents

Your agent can create rich HTML. BinHTML gives that output a managed link so the same workflow can end with something you can actually send.

Short answer

Use REST API publishing for scripts and deterministic systems. Use MCP when the agent should discover BinHTML as a tool, publish generated HTML, and return the link to you.

Turn generated HTML into a managed BinHTML link with sandboxed rendering, source access, versions, and projects.

Why agents need a publish step

Agent-generated HTML often starts as a local file. That is fine until someone else needs to review it, compare options, or reopen the latest version later.

BinHTML acts as the publishing layer for generated HTML: the agent creates the document, calls BinHTML, and returns a share URL.

Claude Code, Codex, Cursor, and custom agents

Different tools configure MCP in different ways, but the workflow is the same: give the client a BinHTML API key, connect the remote MCP endpoint, and ask the agent to publish the generated HTML.

For environments where MCP is not the right fit, the REST API accepts the same core publish payload and returns share, management, and source-download URLs.

Publish one file or a whole project

Use publish_html when the agent has one generated HTML artifact. Use publish_project when the agent creates several related artifacts and you want one project link.

Project links are useful for design variants, research packs, implementation reports, or any agent run that produces more than one useful HTML output.

Keep secrets out of prompts

Store the BinHTML API key in an environment variable or your client's secret manager. Do not paste API keys into prompts, generated files, or committed configuration.

The agent should call BinHTML through the configured MCP/API connection and return the published link, not expose the key.

Comparison

AreaREST APIMCP
Best forScripts, CI, internal tools, and predictable automation.Agents that should discover and call publishing tools.
WorkflowSend title and sourceHtml to a stable endpoint.Configure BinHTML as a remote tool and let the agent call it.
Project publishingUse project fields and project share endpoints.Use publish_project for multiple related HTML files.

FAQ

Can Codex publish generated HTML through MCP?

Yes, when Codex is configured with BinHTML as a remote MCP server and a BinHTML API key.

What is the difference between BinHTML MCP and the REST API?

The API is direct HTTP publishing. MCP lets compatible agents discover BinHTML tools and call them as part of their workflow.

Where should I store my BinHTML API key?

Use an environment variable or secret store supported by your client. Do not paste the key into chat or commit it to source control.