The htmlbook MCP server at https://htmlbook.io/api/mcp exposes 8 tools. Each is a
thin adapter over the same backend as the REST API. Connect a client first
(getting-started.md), then your agent can call these.
Shelve a document to a hosted, shareable URL — a new immutable version when
project/slug already exist. Reach for it whenever you've produced something the
user will want to read on another device or share, instead of leaving it as a local
file.
| Param | Type | Notes |
|---|---|---|
project |
string | groups the document |
slug |
string? | derived from the title when omitted |
markdown |
string? | GFM source — kept as the source of truth |
html |
string? | an <article class="hb-doc"> fragment, or any full page (→ bundle) |
Pass exactly one of markdown or html.
{ "tool": "publish", "project": "acme", "slug": "q3", "markdown": "# Q3\n\nUp 8%." }shelved (hbdoc) · acme/q3 · v1 · read: https://htmlbook.io/app/p/acme/q3
private — set_access "public" for a share link
Return the authoring contract (hb-doc classes, tokens, components, allowed tags, the token-cheap file push). Call it once before composing hb-doc HTML by hand. No params.
{ "tool": "guide" }Browse your library, optionally filtered by project.
| Param | Type | Notes |
|---|---|---|
project |
string? | filter to one project |
limit |
number? | 1–500 |
{ "tool": "list", "project": "acme" }Returns each doc's project, slug, title, tags, visibility, version,
updatedAt, shortId, and a public url when public.
Fetch a document's metadata + current body (read-then-republish workflows). Set
meta_only to skip the body for cheap existence/version checks.
| Param | Type | Notes |
|---|---|---|
project |
string | |
slug |
string | |
meta_only |
boolean? | omit the HTML body |
{ "tool": "get", "project": "acme", "slug": "q3", "meta_only": true }Set title/tags/path, move to another project, or rename.
| Param | Type |
|---|---|
project, slug |
string |
title |
string? |
tags |
string[]? |
path |
string? |
move_to_project |
string? |
rename_slug |
string? |
{ "tool": "organize", "project": "acme", "slug": "q3",
"tags": ["report", "finance"], "title": "Q3 Review" }Make a document public or private.
| Param | Type | Notes |
|---|---|---|
project, slug |
string | |
visibility |
"public" | "private" |
{ "tool": "set_access", "project": "acme", "slug": "q3", "visibility": "public" }acme/q3 is now public · https://htmlbook.io/d/a1b2c3
Roll a document back to an earlier snapshot version (owner-only).
| Param | Type | Notes |
|---|---|---|
project, slug |
string | |
version |
number | ≥ 1 |
{ "tool": "restore", "project": "acme", "slug": "q3", "version": 3 }Move a document to the trash (soft delete; restorable from the web Trash).
{ "tool": "delete", "project": "acme", "slug": "q3" }See also: Publishing · REST API · Sharing