Use html.surf with pages and agents.
html.surf is a place to write real HTML pages, connect them with links, ask questions over their contents, and give MCP-aware agents access to the same knowledge.
Core Concepts#
Accounts and teams
Your account has a public ID, bio, and home page at /p/:account_id. A team is an account too, with members and roles.
Pages
Pages are authored as HTML and live under an account path, such as /p/:account_id/research-plan. Every save is a version.
Links
Internal anchors become graph links. The page view shows both outbound links and references from other pages.
Agents
The ⌘K palette, the MCP server and the hs CLI can search, read, follow links, validate HTML, and write pages when authenticated.
The sections below run from writing a page, through what a page can do (themes, design systems, includes, scripts, decks, data, schedules), to working with other people (teams, comments, sharing), and finally the ways in for agents and tools (MCP, the CLI, the GitHub Action, the REST API).
Account Home#
New accounts receive a random snake_case account ID. You can change it from the Account page if the new ID is available, and you can add a short bio that appears on your public home page.
- Your public home page is
/p/:account_id. - It shows your bio and a searchable list of your public pages.
- Changing your account ID changes the canonical URLs shown in the app.
- Sign in with a magic link sent to your email. The Account page also creates API keys for desktop MCP clients, the CLI in CI, and the REST API.
- Your dashboard lists your pages in a folder tree. Deleted pages go to the trash, where you can restore them or delete them for good.
Writing Pages#
Pages are authored as HTML, not Markdown. Use /new to create a page (or /new?kind=deck for a slide deck), then edit it at /p/:account_id/:slug/edit. A slug can contain slashes, so guide/setup sits under guide in the folder tree and the breadcrumb.
The AI editor
The editor is an interactive, AI-assisted surface: a live preview of your page next to a chat panel. Click any element to select it, then ask in plain language — "reword this paragraph", "make this section dark themed", "add a pricing table", "make THIS chart like THAT". Edits stream in and apply live to the preview; nothing is saved until you hit Save, and an Undo button reverts the last turn. Behind the scenes the assistant makes targeted changes — editing the selected element, restyling via page CSS, or rewriting the page — rather than forcing you to hand-write HTML. A Source view is still there when you want to edit the raw markup directly.
Internal links
Link to another page with a normal relative path or account-scoped URL. These links become graph edges and appear in the page sidebar.
<article> <h1>Project Notes</h1> <p>See <a href="research-plan">the research plan</a>.</p> <p>Or link directly to <a href="/p/alex_notes/research-plan">Alex's plan</a>.</p> </article>
Styling
- Choose Stored style to save the page with a reusable theme import and an article wrapper. See Themes.
- Choose Custom layout when the HTML provides its own full-page style and structure.
- MCP writes must provide
style_modeasthemeorcustom.
Viewing Pages#
Page content is displayed inside its own frame so page-level HTML and CSS can render without being flattened into the app shell. Use the width controls to inspect narrow, normal, wide, or full-width layouts.
- The breadcrumb starts at the account home and follows each slug segment.
- If a route has child pages but no page of its own, it shows the child pages you can read.
- Use the Download panel to export a readable page as HTML, Markdown, DOCX, or a styled print-to-PDF view.
- Links lists every internal link found in the page. References lists readable pages that link back to it, and Included in lists the pages that show a section of it.
- Every public or unlisted page also has a Share URL on
raw.html.surf/:account_id/:slug: the page on its own, with no html.surf controls. That is the link to give people. - Like a page, or bookmark it into a folder from the sidebar. Your bookmarks live at
/bookmarks. /graphdraws every page you can see and the links between them;?focus=slug&owner=accountcentres it on one page.- html.surf installs as an app, and pages you have read stay readable offline.
Themes#
Pages without a stored style render on Night, the default theme: dark, with a warm-paper light variant that follows the light/dark switch. Exports and print use the light variant. Night styles headings, lists, links, tables, code, blockquotes and figures, plus the classes .kicker, .lead, .byline, .tag and .callout. Colour with its variables rather than hex values, so a page follows the light variant too.
<p class="kicker">Field notes</p> <h1>Storm log</h1> <p class="lead">Twice-daily readings from the north station.</p> <div class="callout">Readings paused 3–5 May.</div>
- A full HTML document must import https://html.surf/styles/base?raw=1 itself to get Night on the Share URL and in exports; fragments get it automatically.
- Tactile Paper is still available as a stored style. Save your own CSS themes with the
save_themeMCP tool; they appear inlist_themesand are served at/styles/:name. - A page that imports another theme doesn't get Night underneath it.
- MCP tools:
list_themes,get_theme,save_theme,delete_theme.
Design Systems#
A design system is a versioned set of tokens and HTML/CSS component recipes, addressed as account/name (such as acme/brand). It is made of ordinary pages: the root design-systems/brand, its tokens page (CSS custom properties) and one page per component under design-systems/brand/components/. Each component page holds <template data-hs-variant="name"> recipes with <slot> placeholders. Create one at /design-systems/new or with create_design_system.
Using one in a page
Pin a release, then write the prefixed tags. Children fill the recipe's slots; attributes go onto its root element.
<hs-design-system use="acme/brand@2"></hs-design-system> <brand-card> <h2 slot="title">Launch plan</h2> <p>Ship on Thursday.</p> <brand-button variant="ghost" class="wide">Read more</brand-button> </brand-card>
- Releases are immutable:
@2always renders release 2.@draftfollows the live pages. Publish the next release from the design-system panel or withpublish_design_systemand a changelog. - Editors can preview a page against another release with
?ds=acme/brand@3before switching the pin. - Public and unlisted systems serve their stylesheet at
/ds/acme/brand@2.cssfor apps outside html.surf. - The AI editor offers the systems you and the page owner can both read.
Tokens in code and Figma
Export a system's tokens as CSS, a Tailwind v4 theme, a Tailwind v3 preset or Figma variables:
hs ds pull acme/brand -f tailwind -o src/styles hs ds pull acme/brand -f figma --version 2 -o figma/
The Figma format is DTCG JSON, one file per mode (Light and Dark when the tokens set dark values), ready for Figma's Variables import. The same export is the export_design_tokens MCP tool.
Limits
- A page carries at most 20 pins. Systems can't be renamed, and a released system's root page can't be purged.
- The page owner and the author of the current version must both be able to read the system, so a collaborator can't embed the owner's private system.
- Uploaded assets on a private system's pages don't load on other pages. The AI editor strips
hx-*attributes, including on design-system tags. - Import goes one way: there is no import of tokens from Figma into a system.
- MCP tools:
list_design_systems,get_design_system,find_component,design_system_changes,export_design_tokens,create_design_system,publish_design_system.
Includes#
Write a fact once and show it on other pages. <hs-include> shows a live section of another page: the element with that id, or, for an id on a heading, the heading and what follows up to the next heading of the same or a higher level. Leave out #id to include the whole page. The tag's children are the fallback.
<hs-include src="acme/pricing#plans"> <p>See <a href="/p/acme/pricing">pricing</a>.</p> </hs-include>
- The section renders from the source's current version on every view, so edit the source, never the copies.
- A reader sees it only when they, the page owner and the author of the include can all read the source; otherwise the fallback shows.
- Sections are static (scripts and handlers are removed) and render without the source's page styles.
- Limits: up to 4 levels deep and 50 distinct sources per page; a page including itself is skipped. raw.html.surf and scripted pages render includes for an anonymous reader, so only public and unlisted sources appear there. Anonymous views of public pages are cached, so a source edit can take a few minutes to show.
Scripts and Assets#
Pages may contain JavaScript. Scripted pages run only on raw.html.surf, in a sandbox with an opaque origin; html.surf shows them in a sandboxed frame. localStorage, sessionStorage, IndexedDB and cookies throw there, so keep state in memory, or in page data when it must outlast the visit.
<button id="go">Roll</button> <output id="out"></output>
<script>
document.getElementById('go').onclick = function () {
document.getElementById('out').textContent = 1 + Math.floor(Math.random() * 6);
};
</script>- Put scripts in
<body>: scripts in a full document's<head>and handlers on<body>are lost when the page is saved from the AI editor, as are entity-encodedjavascript:URLs andhx-on*attributes. - Private pages open on raw.html.surf through a link that lasts 15 minutes. On a private page,
/assets/URLs carry that token only insrc,hrefandposter; other runtime fetches must appendlocation.search.
Assets
Upload images, video, audio, and .js or .json files to a page from its sidebar, with hs assets upload, or with the upload_asset MCP tool, then reference them by their /assets/:id URL. An asset is readable by whoever can read its page.
- Limits: 10 MB per file, 50 files and 100 MB per account.
asset_quotashows what's left. .jsand.jsonassets are served only from raw.html.surf.- MCP tools:
upload_asset,list_assets,delete_asset,asset_quota.
Slide Decks#
A deck is a page whose data-hs-deck element holds one section.hs-slide per slide and which loads the deck player. Start one from /new?kind=deck. Slides are 1080px tall and the width follows data-aspect (1920 at 16:9, 1440 at 4:3, 1080 at 1:1, 608 at 9:16); lay each slide out in px and the player scales it to fit.
<div class="hs-deck" data-hs-deck data-aspect="16:9">
<section class="hs-slide" data-transition="fade">
<h1 data-enter="rise">Q3 in numbers</h1>
<p data-enter="count" data-to="1280" data-suffix=" users" data-step="1">0</p>
<p data-enter="fade" data-step="2">Up 40% on Q2</p>
</section>
<section class="hs-slide" data-transition="slide">
<svg viewBox="0 0 400 200" width="1200" height="600">
<polyline points="0,180 200,120 400,20" fill="none" stroke="var(--accent)" data-enter="draw" data-dur="1.2s" />
</svg>
</section>
</div>
<script src="/lib/deck.js?v=1"></script>Present and play
- Present (the default,
?mode=present): arrows, space, click or swipe step through. Elements withdata-stepappear one click at a time; shared numbers appear together.Ftoggles full screen. - Play (
?mode=play): timed autoplay with a scrubber. Elements start at theirdata-attime; a slide stays fordata-duration(default: last animation end + 1.5s).data-loop="true"on the deck loops it. #3opens slide 3. The reader shows Present, Play, full screen and open-full-window controls under the deck.
Animations
- Slide transitions,
data-transition:none,fade(default),slide,zoom,wipe. - Entrances,
data-enter:fade,rise,drop,slide-left,slide-right,scale,wipe,blur,type,count,draw. Exits,data-exit(withdata-exit-atin play mode): the same list withouttype,countanddraw. - Timing:
data-dur(default 0.6s) anddata-ease(ease,ease-out,spring,linear). An animated element nested in another enters with it. countreadsdata-to,data-from,data-prefix,data-suffixanddata-decimals, or counts to the number in its own text.typeandcountneed an element holding only text (otherwise they fade);drawneeds SVG shapes.- Scripts can listen for
hs:slide,hs:step,hs:playandhs:pause, and callwindow.hsDeck.go(i),next(),prev(),play()andpause()(0-based). - Limits: decks are scripted pages, so the script rules above apply, and share-link insights record no read depth for decks.
Pages That Store Data#
A scripted page can keep state that every viewer shares and that survives reloads: polls, sign-up sheets, trackers, checklists. Load the data library in <body> and use window.hsData.
<button id="yes">Yes</button> <span id="count">0</span>
<script src="/lib/data.js?v=1" data-write="viewers"></script>
<script>
var count = document.getElementById('count');
hsData.get('votes/yes').then(function (n) { count.textContent = n || 0; });
document.getElementById('yes').onclick = function () {
hsData.incr('votes/yes').then(function (n) { count.textContent = n; });
};
</script>- Without
data-write, only the page's editors can change the data, and only while viewing it on html.surf; everyone who can open the page can read it.data-write="viewers"lets anyone who can open the page write, share-link guests included. - Methods (all promises):
get,set,incr(atomic, for votes),add(time-ordered entries under a prefix),list,delete,infoandwatch, which polls a prefix and calls back on change. - Values come from other viewers: show them with
textContent, neverinnerHTML. - Limits per page: keys up to 200 characters, values up to 16 KB of JSON, 1000 keys and 1024 KB in all. Writes are rate-limited per viewer.
- Viewers are anonymous, so a page can't stop someone voting twice. A private page opened by its 15-minute raw link loses data access when the link expires. Custom domains don't serve data, so pages are read-only there.
- Data belongs to the page, not its versions: restoring a version doesn't change it, and purging the page deletes it. MCP tools:
read_page_data,write_page_data.
Pages That Keep Themselves Up to Date#
Give a page a prompt, sources and a frequency (hourly, daily or weekly) in the Schedule panel of the page sidebar. An agent rewrites the page on that schedule, as you.
Prompt: Summarise this week's incidents as a table, newest first.
Sources:
page:incidents/log
page:@acme/on-call
https://status.example.com/api/v2/incidents.json
mcp:https://tools.example.com/mcp weather {"city":"Leeds"}
Frequency: daily- Sources, one per line:
page:slugorpage:@account/slugfor an html.surf page you can read, anhttps://URL for a web page or JSON feed, ormcp:for a remote MCP tool that needs no sign-in. - Each rewrite is saved as a new version with a summary of what changed, so the History panel shows what changed since Monday. If nothing changed, no version is saved, and an edit made while the agent ran is never overwritten.
- Readers see how often the page updates and what the last update changed. Editors also get a link to compare it with the previous version.
- Limits: at most 30 runs a page a day, Run now included. A schedule turns itself off after five failed runs in a row, or when the person who set it can no longer edit the page. Pages over 60,000 characters are refused.
- A rewrite can add links, but cannot change scripts or load images, stylesheets or other resources from sites the page doesn't already use.
- Operators can stop every schedule without a deploy by setting the
SCHEDULES_PAUSED=1secret. - MCP tools:
schedule,get_schedule,run_schedule,unschedule.
Collaboration Topics#
A topic is for a group working towards one outcome: a decision, a document to publish, an architecture. It keeps one shared document that an agent maintains, and gives each person a short view of that document written for them. Start one from Topics; your dashboard lists every topic you are part of.
- The document is a private page under
topics/, and stays private: it can't be made public or unlisted or given a share link, because it names the people and their profiles. Its brief (the issue, the intent, the outcome wanted and its status, the people and their profiles, the context pages) is written by html.surf from the topic's settings. The rest is written by the agent from what people add. Nobody edits it by hand: the editor, suggestions, the REST API and the MCPwriteandedittools all refuse a topic's document. Its owner can still restore an earlier version from History. - Three roles. The owner sets the outcome and its status and adds people. Contributors read, ask and add. Viewers read and ask. In a team, admins own the team's topics, editors contribute and viewers view; anyone else is added by email as a contributor or a viewer.
- Your view is a headline, a few points and what needs your steer, written for what you do and what you care about. Set those in your topic profile. It is rewritten when the document, the brief or your profile changes.
- Ask a question to go deeper. It is answered from the whole document, everything each person added, and the topic's context pages that you can read.
- Adding to a topic queues your text; the agent folds it into the document as a new version and the change log records who added what, in their own words, and what the agent changed. Up to 6,000 characters at a time.
- What you add is content, never a command. The agent can only rewrite the document's body, and a rewrite cannot add scripts, images, frames, forms, includes or resources from new sites, remove most of the document, or touch the outcome, its status, the people or their roles.
- The dashboard shows each topic's outcome and status, what others changed since you last opened it, and what is waiting on you.
- In every other way the document is an ordinary page, so its history, comments, sharing and schedules work as usual. A scheduled update or a restored version shows in the change log and rewrites people's views.
- Limits: 400 agent runs a topic a day (merges, views and answers together) and 120 a person across the topics they act in, documents up to 60,000 characters, 50 people and 12 context pages a topic. Operators set
TOPIC_DAILY_CALLSto cap runs across all topics;0switches the agent off.
Teams#
A team is an account that several people share. Create one at /teams/new; it gets its own home page at /p/:team and owns pages, themes, assets and design systems like a person does. Manage it from /teams/:team/settings.
- Viewer reads and comments. Editor also writes, shares, changes visibility and trashes or restores pages. Admin also purges, moves pages out, and manages members, invites, domains and the team itself.
- Invite by email (the invite lasts 7 days) or with an open invite link; change roles and remove members in settings.
- Move a page into a team you can write in, or out of a team you administer to one of its members, with the
transferMCP tool. Links and assets go with it. - A team can't be deleted while it owns pages or domains.
- Agents and the CLI act in a team with its handle:
account_idin MCP tools,-ain hs.
hs write roadmap roadmap.html -a acme --visibility private hs ls -a acme
Live Updates#
Team spaces update without a refresh. While you are signed in, a team's home page shows pages as they are created, edited or removed, and a page you are reading re-renders when someone saves it or comments on it.
- The comments panel waits while you are typing a comment or reply, and keeps your draft when it refreshes.
- If a page moves to another account while you read it, you get a notice with the new location.
- Every update is re-checked against your access; lose access and the live connection closes.
- Limits: live updates are for signed-in readers only. The team feed is for members; anonymous readers and share-link guests see changes on reload.
Install a Page as an App#
Any page you can open at html.surf/p/ can be installed as its own app, with its own icon and window. The app opens the page's latest version every time it starts, so editing and republishing the page updates it.
- Chrome and Edge: use the Install button next to Raw and Edit. On iPhone and iPad: Share, then Add to Home Screen. In Safari on macOS Sonoma or later: File, then Add to Dock.
- The icon is the page's own square PNG asset (144px or larger) named with
<link rel="icon" href="/assets/<id>">; otherwise html.surf draws one from the title's first letter in the page's colours.<meta name="theme-color">sets the app's colour while it starts; once open, its title bar matches html.surf's top bar. - Private pages install for the people who can read them, and open signed in as you. Signed out, the app asks you to sign in. Nobody else can open the page through your app.
- Offline, the app shows the copy it saved on your last visit, with a note saying so. Scripted pages and pages you reach only by share link need a connection.
- Scripted pages install as their html.surf view, which frames the sandboxed page and gets a fresh access token on every open.
- On iPhone and iPad a home-screen app keeps its own sign-in, and the emailed link opens in Safari. To sign in inside the app, use the sign-in form the app shows on the page, then copy the link from the email and paste it under "Signing in from an installed app?".
- The app's window also opens pages whose address starts with the installed page's, such as
/p/you/notes-archiveor/p/you/notes/q3for an app installed from/p/you/notes. - Limits: the app has no notifications.
Comments and Suggestions#
Comments
- Select text on a page and comment on it, like a shared document. Comments thread into replies and can be resolved and reopened.
- Owners, editors and commenters can comment; readers and the public can't.
- REST:
GET/POST /api/pages/:slug/comments,PATCH/DELETE /api/comments/:id.
Suggested edits
- Anyone who can comment on a page but not edit it can suggest an edit from the Suggested edits section of the page sidebar. The page doesn't change until an editor accepts it.
- Editors see pending suggestions in the same section and review each one as a diff against the live page, then accept or reject it.
- An accepted suggestion becomes the active version, credited to its author, with a note naming who suggested and who accepted it.
- A suggestion is tied to the version it was written against. If the page changes before it is reviewed, it can't be accepted until its author updates it; the update form shows what changed on the page in the meantime. There is no automatic merge.
- MCP tools:
suggest,list_suggestions,review_suggestion.
Version History#
- Every save creates a new version. The latest is automatically the active version.
- The History panel in the page sidebar lists each version with timestamp and editor, and compares any two as a diff — visible only to the owner and editors.
- Restoring an older version makes it the active version and replaces the live page content with that version's snapshot.
- You can delete any non-active version to remove clutter. The active version can't be deleted — restore another one first. A version in a design-system release can't be deleted either.
- MCP tools:
list_versions,read_version,restore_version,delete_version. CLI:hs versions SLUG.
Sharing and Permissions#
Visibility
- Public listed — readable by anyone; appears in public search, Explore, and your public profile.
- Public unlisted — readable by anyone with the URL; hidden from public search, Explore, and your public profile. Useful for pages you want to share but not broadly advertise.
- Private — readable only by the owner, team members and explicit collaborators, or via a guest share link.
- Change visibility from the page sidebar, with
set_visibility, or withhs visibility SLUG unlisted.
Collaborators
- Owners can share a page with another signed-in user as a reader, commenter or editor. Commenters can comment and suggest edits.
- MCP tools:
grant_permission,revoke_permission.
Guest share links
- Create an expiring guest link for people without an account from the Sharing panel, with
share, or withhs share SLUG --expires 7. Revoke it at any time. - A link opens the page in the app at
/share/:token; its Raw view, the page on its own, israw.html.surf/share/:token. Both work exactly as long as the link. - MCP tools:
share,list_shares,revoke_share.
Share-Link Insights#
The Sharing panel shows, for each guest link, how many times it was opened, by how many visitors, from which country and how far each reader got. The link's creator is emailed the first time someone else opens it.
- Opening a link shows this notice: "Opening this link is recorded for the people who manage it: when, your country, how far you read, your html.surf handle if you are signed in, and a one-way hash of your IP address, browser and language setting used to count repeat visits." The privacy page says the same.
- Guests are numbered per link, not identified; signed-in viewers show their handle. Only people who can manage the link's sharing see insights.
- Link previews in chat apps, prefetches and HTTP clients aren't counted, so pasting a link doesn't use up the first-open email.
- Limits: read depth is advisory (a page's own scripts could report any value), decks report none, and the raw view carries no visible notice because it is the page alone. Email link scanners that look like browsers count as opens.
- MCP tools:
list_shares,share_insights.
Custom Domains#
A team admin can serve the team's pages from their own hostname, such as docs.example.com, from team settings. Add the two DNS records settings shows you, then press Check:
docs.example.com CNAME <target shown in settings> _html-surf.docs.example.com TXT html-surf-verify=<token shown in settings>
- Pages are served at
/slug;/is the team's publicindexpage, or a list of its public pages. - Only public and unlisted pages are served there, without share or view tokens, so private pages never are. Page data is read-only.
- A hostname goes live once Cloudflare has issued its certificate and the TXT record has been seen. A claim that was never verified can be taken by another team after 7 days.
- Status: custom domains ship switched off. They turn on when the server has
CF_API_TOKEN,CF_ZONE_IDandCUSTOM_DOMAIN_TARGETset, with Cloudflare for SaaS enabled on the zone; until then team settings says they are not set up on this server.
Search and Ask#
Press ⌘K (Ctrl K, or /) anywhere to open the palette. It searches every page you can find, by title, text and meaning, and shows a rendered preview of the selected result. When signed in, narrow it to your own account or one of your teams.
Switch the palette to Ask to put a question to the graph. The navigator reads pages you can discover, follows their links, and answers with numbered citations to the pages it drew on; with none, it says it found nothing rather than guessing.
- Private pages are only used when you are signed in and have access. Unlisted pages never appear in search.
- Limits: asking needs you to be signed in, and each person can ask 10 questions a minute.
- The same search and ask are
POST /api/searchandPOST /api/ask, and thesearchMCP tool.
MCP Server#
html.surf exposes the same graph over MCP at /mcp. Hosted Claude connects with OAuth. Desktop and local MCP clients can use an API key from the Account page. Authenticated agents can read private pages you can access and can write pages when asked.
Claude connector
Connect Claude to https://html.surf/mcp, complete the OAuth flow, and allow https://html.surf as the link URI. For review, use a test account with sample public and private pages so read, search, link traversal, validation, and private writes can be checked.
- Search and summarize: "Search html.surf for my product planning pages and summarize the release risks."
- Read and traverse links: "Read my architecture overview on html.surf, follow its linked pages, and explain the data flow."
- Validate and save privately: "Draft a private html.surf page for my launch checklist, validate the HTML, and save it as private."
Desktop client config
{
"mcpServers": {
"html-surf": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://html.surf/mcp", "--header", "Authorization: Bearer hs_your_key_here"]
}
}
}Pages
searchfinds accessible pages with fast D1 search first, then semantic fallback.readreturns a page title, text, HTML, visibility, and URL.linksreturns outbound links and backlinks, and the pages that include a section of it.listlists public pages or your own pages when authenticated, optionally under a slugprefix.validatechecks generated HTML before writing.writecreates or updates pages when authenticated.editmakes targeted find/replace edits to an existing page without resending the whole document — cheaper and safer thanwritefor small changes, and it preserves the page's current styling.moverelocates a page to a new slug (rename, or move between folders) without rewriting its HTML, and automatically repoints links that pointed at the old slug.transfermoves a page between your account and a team.deletemoves a page you own to the trash — recoverable, and no longer viewable, listed, or searchable while trashed.list_trash/restore/purgelist trashed pages, restore one to live, or permanently delete a trashed page.bookmark/list_bookmarks/remove_bookmarksave, list by folder and remove research bookmarks.whoamishows your account and the teams you belong to, with your role in each.
Everything else
Each feature section above lists its own tools:
The hs CLI#
hs is html.surf from the command line. It is a thin client over the MCP server, so it can do anything the tools can. Install it from npm and sign in; the login gives you a link to open in any browser, on any machine.
npm install -g html-surf hs auth login hs write notes/today today.html --visibility unlisted hs read notes/today --meta hs search "release risks"
- Accounts:
hs auth login(--browserto sign in on this machine),list,whoami,use,activate,deactivate,logout. Profiles are named after your handle;hs auth activate NAME DIRbinds one to a folder. - Pages:
hs ls,read,write,search,mv,rm(rm -r PREFIXfor a folder),restore,visibility,share,versions. - Folders:
hs push, below. - Design systems:
hs ds ls,get,publish,pull. - Assets:
hs assets ls,hs assets upload. - Anything else:
hs toolslists every MCP tool andhs tool NAME '{"json":"args"}'calls one. - Pass
-p NAMEfor another profile and-a HANDLEto act in a team. In CI,HTML_SURF_TOKEN(an API key) skips profiles.
Docs as Code#
Keep a folder of HTML in a repository and publish it with hs push. Every .html file becomes a page: docs/guide/setup.html becomes PREFIX/guide/setup, an index.html is its folder's page, and links between the files point at their pages. Unchanged pages are left alone.
hs push docs --to handbook --visibility public --dry-run hs push docs --to handbook --visibility public --prune
--prune trashes pages under the prefix that no longer have a file. The GitHub Action runs the same push: an unlisted preview and a comment on every pull request, and the real publish on merge.
# .github/workflows/docs.yml
on:
push: { branches: [main], paths: [docs/**] }
pull_request: { types: [opened, synchronize, reopened, closed] }
permissions: { contents: read, pull-requests: write }
jobs:
html-surf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: stukennedy/html-surf/actions/push@main
with:
token: ${{ secrets.HTML_SURF_TOKEN }}
dir: docs
to: docs
# account: acme # publish into a teamREST API#
The REST API lives under /api. Reads of public pages need no key; everything else takes Authorization: Bearer hs_... with an API key from the Account page.
POST /api/pages create GET /api/pages/:slug read PUT update DELETE delete GET /api/pages/tree your folder tree GET /api/pages/:slug/links | /backlinks GET /api/pages/:slug/versions[/:id] POST .../:id/activate DELETE .../:id GET /api/pages/:slug/comments POST PATCH/DELETE /api/comments/:id POST /api/validate POST /api/search POST /api/ask POST /api/navigate GET /api/graph
Troubleshooting#
- If Claude cannot connect, confirm the server URL is exactly
https://html.surf/mcp. - If OAuth does not start, disconnect the custom connector in Claude and add it again so Claude can rediscover the authorization metadata.
- If the magic link does not arrive, check spam and request a new link from the html.surf sign-in page. Magic links expire after 30 minutes.
- If private pages are missing, confirm you signed in with the same email that owns or has access to those pages.
- If a write fails, call
validatefirst and includestyle_modeasthemeorcustom. - For local desktop clients, create an API key from the Account page and restart the client after editing its MCP config.
- If a page's script can't save anything, it is running in the raw.html.surf sandbox: use page data instead of browser storage.
- If a team page doesn't resolve from MCP or the CLI, pass the team handle as
account_idor-a.