Getting started

Concepts, authentication overview, and a walkthrough for the browser, REST, and MCP paths.

Share HTML turns an HTML document into a public, edge-served URL. A page is the unit of work - every page has a slug, an HTML body, and an optional password and TTL.

There are three ways to publish:

browser

Paste & publish#

One-off publishing from the editor at share-html.com.

rest api

HTTP clients#

Any client that speaks HTTP - curl, fetch, requests.

mcp

AI agents#

Claude Code, Cursor, Codex over the Model Context Protocol.

All three produce the same artifact - a URL of the form https://pages.share-html.com/{slug} - and operate on the same pages. A page published in the browser can be updated through the API, and vice versa.

How a page is structured#

FieldDescription
slugThe URL segment. Auto-generated (8 characters, no ambiguous letters or digits) or supplied by the caller.
htmlThe HTML body, up to 5 MB. Served as-is on the edge.
ttlOne of "24h", "7d", "30d", or "never". Defaults to "never".
passwordOptional password gate; visitors are prompted before the HTML loads.
discoverableWhether the page may be indexed by search engines. Defaults to false.

Authentication at a glance#

The REST API and the MCP server share a single credential: an account-scoped API key (sh_live_…), created in the dashboard at share-html.com/app/keys. It is sent as a bearer token (Authorization: Bearer sh_live_…), scopes to every page owned by the calling account, and is the credential used by the MCP stdio bridge. Browser-capable MCP clients can authenticate over OAuth instead of pasting a key.

Publishing without an account is available only in the browser editor; the REST API and MCP both require a bearer.

The full credential table - header names, formats, and lifetimes - lives in the REST API › Authentication section.

Publish your first page#

From the browser#

Open share-html.com, paste an HTML document into the editor, and click Publish. The next screen displays the URL. Sign in from that screen to save the page to your account so you can update or delete it later from the dashboard, the API, or MCP.

From the REST API#

The minimal request is a POST /api/v1/pages with a single html field and an API-key bearer. The response includes the URL and slug.

curl -X POST https://share-html.com/api/v1/pages \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<!DOCTYPE html><h1>Launch notes</h1>"}'
{
  "url": "https://pages.share-html.com/launch-notes",
  "slug": "launch-notes"
}

The full reference - custom slugs, TTLs, password gates, and updates - is documented in REST API › Create a page.

From an MCP client#

Claude Code can add the hosted MCP server in one command:

claude mcp add --transport http share-html https://mcp.share-html.com/mcp

Clients that only speak stdio (Cursor, Claude Desktop, Codex) use the @share-html/mcp bridge. Setup snippets and credential injection are covered in MCP server › Connect through the stdio bridge.

Next steps#