# htmlbook — full reference > htmlbook is a hosting library — a "bookshelf" — for HTML documents written by AI coding agents. Your agent writes an HTML document and pushes it to htmlbook; htmlbook stores, themes, organizes, and shares it. This file is the complete description of the product for language models. ## What htmlbook is htmlbook is a place to keep the HTML that AI coding agents generate. Agents like Claude Code, Cursor, and Codex increasingly produce polished HTML reports, dashboards, and specs, but those files stay trapped in a project folder on a laptop. htmlbook is the shelf they go to: an agent pushes a document, and htmlbook stores it, re-themes it for comfortable reading on any device, organizes it by project, and gives it a short public link to share. The defining constraint: **documents are authored by your agent, never in a web form** — they arrive by agent push over MCP or the REST API, or by uploading the finished .md/.html file straight into the library. This keeps authoring where the work already happens, in your agent. On the shelf, the web reader adds one human touch: the owner can tap any text and edit it in place (fix a typo, update a number); each save becomes a new immutable version, with every previous version restorable. hb-doc edits are re-sanitized exactly like an agent push. Standalone pages (own CSS/JS, rendered in a sandbox) are edited through precise text patches applied to the page's stored source — scripts, styles, comments, and formatting survive byte-for-byte, and only text generated at runtime by the page's own script is not editable. ## How it works 1. **Connect once.** Add htmlbook to your agent — one line for an MCP client, or an API key for the REST endpoint. 2. **Ask your agent to publish.** Tell the agent to put a document on your shelf; it calls htmlbook's publish tool with the HTML. 3. **Read and share.** The document appears in your library, themed and responsive. Share its short link public (anyone can open it) or keep it secret (workspace members only). ## Connecting an agent - **Claude Code (MCP):** `claude mcp add --transport http htmlbook https://htmlbook.io/api/mcp` - **Cursor / Codex (MCP):** point the client at the remote MCP server `https://htmlbook.io/api/mcp` with an API key as a Bearer token. - **REST API:** `POST https://htmlbook.io/api/docs` with an `Authorization: Bearer ` header — JSON `{project, html}` or `{project, markdown}`, or push a file directly as the raw request body (`curl --data-binary @doc.md "…/api/docs?project=…&slug=…"`; a pushed `.md` is kept AS markdown — the source of truth — and rendered to a themed view, so it stays downloadable and editable as markdown). - **claude.ai / Claude Desktop (OAuth):** add htmlbook as a custom connector; these clients authenticate with OAuth rather than an API key. API keys are issued in Settings and are bound to a workspace. Connecting takes about a minute. ## The MCP tools htmlbook's MCP server exposes thirteen tools, each a thin adapter over the same document store: - **publish** — create or update a document from HTML **or markdown** (a pushed `.md` is kept as the source of truth and rendered into a themed hb-doc view — not lossily converted — so it stays downloadable and editable as markdown; idempotent by content hash). The response includes the owner's reader link, and the share link once the doc is public. - **guide** — the authoring contract (hb-doc classes, design tokens, components), so any connected agent can produce themed documents without a pre-installed skill. - **list** — list documents, with their share URLs. - **get** — fetch one document's content and metadata (or metadata only). - **search** — full-text search across everything you've shelved (the agent's cross-repo memory) — call it first to recall before re-deriving. - **organize** — set a document's title, tags, and folder path, move it to another project, or rename it. - **restore** — roll a live document back to a previous version. - **set_access** — set a document's share mode — **public** (anyone), **password** (anyone with the password you set, no login), or **private** (members only) — and return its share link. - **cite** — get a shareable deep-link to a specific section (heading) of a document. - **delete** — move a document to the trash (soft delete, recoverable). - **list_trash** — list trashed documents and when each is permanently auto-deleted. - **untrash** — restore a document from the trash. - **purge** — permanently delete a trashed document now (irreversible). Trashed documents are also auto-purged 30 days after deletion. ## hb-doc and bundle: the reader contract htmlbook recognizes two kinds of document automatically at publish time: - **hb-doc** — an HTML document that carries **no CSS of its own**. Because it has no styles, htmlbook's reader can re-theme it (paper, sepia, or dark), change the column width, and adjust the font size without touching the content. This is the recommended format for text, reports, and dashboards. - **bundle** — a standalone HTML page that ships its **own CSS and JavaScript** (a custom layout, an interactive widget). htmlbook stores it verbatim and renders it in a sandboxed frame so it keeps its exact look while staying isolated from the rest of the site. A bundle can be **multi-file** (an `index.html` entry plus sub-pages and assets — CSS, JS, images, fonts — up to 10MB total, uploaded via a presigned REST flow), so relative links between pages work like a tiny static site. So any HTML an agent produces has a home: simple documents become themeable hb-docs; self-contained pages become bundles. Plain markdown has one too — a PLAN.md or REPORT.md pushes straight to the shelf, where the `.md` is kept as the source of truth and rendered into a themed view (downloadable and editable as markdown). ## Sharing and visibility Every document is private by default and has one stable short link, `https://htmlbook.io/d/{shortId}`, minted at first publish (it never changes, so the link is safe to send). The link has three modes. Make the document **public** and anyone can open it without an account. Make it **password-protected** and anyone with the link **plus the password** can open it without an account — no login, just the password (changing the password later revokes prior access). Keep it **private** and the same link is a **secret link**: only the owner and the document's workspace members can open it, after signing in — anyone else sees nothing, and anonymous visitors are routed through login first. ## Organization Documents group into **projects**, and projects group into **workspaces** (for example, separating work from side projects). Every version of a document is retained, and the reader's **History panel** shows the full trail — which versions were pushed by the agent and which were edited on the web, by whom, with the precise before/after text of every change — and can restore any earlier version. Documents can be filtered by folder and tag. ## Teams A workspace can be shared: the owner creates an **invite link** in Settings, and anyone who opens it joins the workspace as an **editor**. Editors see every document and project in that workspace in their own library and can fix text directly in the reader; each edit becomes a new version recorded under the editor's name in the document's history. Publishing keys, public sharing, restore, and member management remain with the workspace owner. ## Pricing htmlbook is free to start. Signing up provisions a library and a personal workspace; you generate an API key in Settings (or during the get-started walkthrough). ## Frequently asked questions ### What is htmlbook? htmlbook is a hosting library — a bookshelf — for HTML documents created by AI coding agents. Your agent writes an HTML report, dashboard, or spec and pushes it to htmlbook, which stores it, re-themes it for comfortable reading on any device, organizes it by project, and gives it a public share link. ### How does my AI agent send documents to htmlbook? Connect once over the Model Context Protocol (a single line for Claude Code, Cursor, or Codex) or with a REST API key, then ask your agent to publish. Documents arrive by agent push — or by uploading a .md or .html file your agent already wrote straight into the library; there is no web editor — and once a document is on your shelf you can fix its text directly in the reader. ### Which AI agents and tools work with htmlbook? Claude Code, Cursor, and Codex connect with a static API key over MCP or the REST API. claude.ai and Claude Desktop connect over OAuth. Any client that speaks the Model Context Protocol can publish to and read from htmlbook. ### What is an hb-doc? An hb-doc is an HTML document that carries no CSS of its own, so htmlbook's reader can re-theme it — paper, sepia, or dark — and adjust the width and font size. A standalone page that ships its own CSS and JavaScript is kept verbatim instead and rendered safely in a sandbox. ### Can I read and share documents anywhere? Yes. Documents are responsive and theme themselves to your device, so a report your agent wrote on your laptop reads cleanly on your phone. Every document has one short link (htmlbook.io/d/…) with two modes: flip it public and anyone can open it without signing in, or keep it private and the same link works as a secret link only you and your workspace members can open. ### Can I edit a document on the website? Yes — every document. In the reader, tap any text — a heading, paragraph, list item, or table cell — and type the fix in place; saving creates a new version, so the agent's original is always restorable. This works for standalone pages with their own CSS and JavaScript too: edits are applied to the page's stored source as precise text patches, leaving its scripts, styles, and formatting untouched. Only text that a page's script generates at runtime can't be edited, and the editor tells you when you tap it. ### Do I need to write any code on the website? No. Documents come from your agent (MCP/API push) or from uploading a finished .md/.html file; the web app is for reading, fixing text inline, organizing documents into projects and workspaces, and sharing them. Every version of a document is kept automatically. ### Can my team share a workspace? Yes. A workspace owner creates an invite link in Settings; anyone who opens it joins as an editor who can read every document in that workspace and fix text in the reader. Every edit is saved as a new version under the editor's name, and the reader's History panel shows exactly who changed what, when — with the precise before/after text. Keys, sharing, and restore stay with the owner. ### Is my data private? Can I keep work documents internal? Yes. Every document is private by default — visible only to you and workspace members you explicitly invite. Anonymous readers can open a document only after you flip it public, and flipping it back removes the public copy — the link reverts to a members-only secret link. Access is enforced server-side on every request, traffic is encrypted in transit and stored encrypted at rest, API keys are stored only as SHA-256 hashes, and your documents are never used to train models, never shared, and never sold. ### Can I delete my documents permanently? Yes. Deleting a document moves it to Trash, where you can restore it or delete it forever — purging removes it permanently. You can also download a markdown document's original source at any time, so there is no lock-in. ### Is htmlbook free? Yes, you can start for free. Signing up provisions your library and a personal workspace; you generate an API key in Settings (or during the get-started walkthrough), and connecting an agent takes about a minute. ## Links - Home: https://htmlbook.io/ - Connect your agent (MCP & API): https://htmlbook.io/mcp - Short briefing for LLMs: https://htmlbook.io/llms.txt - Discord community: https://discord.gg/hqMkDFPR