htmlbook
Setup · about 30 seconds

Connect htmlbook
to your agent.

htmlbook is built on MCP. Add it once, and Claude Code, Cursor, Codex, or any MCP client publishes the HTML it writes straight to your shelf — no copy-paste, no deploy step.

1

Get your API key

Sign in and copy your workspace key. Keep it secret — it grants publish access to your library.

hb_live_REPLACE_WITH_YOUR_KEYworkspace key
Get your key
2

Add the server

One command. Run it in any project — it works everywhere your agent writes HTML.

Terminal — recommended (browser login)
claude mcp add --transport http htmlbook https://htmlbook.io/api/mcp# then run `claude` and approve the htmlbook login
Terminal — with an API key
claude mcp add --transport http htmlbook https://htmlbook.io/api/mcp \  --header "Authorization: Bearer hb_live_REPLACE_WITH_YOUR_KEY"
.mcp.json — share with your repo (project scope)
{  "mcpServers": {    "htmlbook": {      "type": "http",      "url": "https://htmlbook.io/api/mcp",      "headers": { "Authorization": "Bearer ${HTMLBOOK_API_KEY}" }    }  }}

verify → claude mcp list should show htmlbook ✓ connected

3

Use it

Just ask. Your agent calls publish when it’s done — and hands you back a live URL.

claude — ~/acme
>turn our PRD into an HTML page and publish it
Write(prd.html)
312 lines · sections, ToC, dark mode
htmlbook → publish
shelved · htmlbook.io/d/prd
Cost tip

Big document? Push the file.

The publish tool takes the HTML inline — handy, but for a large doc your agent re-emits the whole file as tokens (and it lingers in context). Have it write the file, then push the file from the shell — the bytes skip the model entirely:

shell — token-free push (same pipeline as the tool)
curl -s -X POST "https://htmlbook.io/api/docs?project=PROJECT&slug=SLUG" \  -H "Authorization: Bearer $HTMLBOOK_API_KEY" \  --data-binary @doc.html   # or @doc.md — .md kept as source + rendered to a view

small docs → just use publish (it takes markdown too). set HTMLBOOK_API_KEY to the same key.

The tools your agent gets

Eight verbs. Capture is one call; the rest let your agent (and you) actually manage a library.

htmlbook.publishCreate or update a doc from HTML or markdown (new snapshot if it exists).
htmlbook.guideThe authoring contract — hb-doc classes, tokens, components — for any agent, no skill needed.
htmlbook.listBrowse your library, optionally filtered by project.
htmlbook.getFetch a doc — metadata + current HTML (meta_only to skip the body).
htmlbook.organizeSet title/tags/path, move to another project, or rename.
htmlbook.restoreRoll a doc back to a previous snapshot.
htmlbook.set_accessMake a doc public or private.
htmlbook.deleteMove a doc to the trash (soft delete).

Not connecting?

  • Restart the client. Cursor, Codex, and Claude Desktop only read the config on launch. Quit and reopen.
  • 401 / unauthorized. The key is wrong or missing. Re-add with the Authorization header, or run the browser login.
  • Check the status. In Claude Code: claude mcp list — and claude mcp get htmlbook for details.
  • Behind a proxy / headless. Use a static API key (Bearer) instead of OAuth — see the “Any MCP client” tab.

Give your agent a shelf.

Free to start. Every HTML file your AI writes — captured, organized, readable anywhere.