ContentBuilder.js · ContentBox.js · Guide

How Live Editing with Claude Works

Claude edits the page that is open in the editor. The user sees every change as it happens.

How Live Editing Works

The user opens a page in the editor. The top bar shows that Claude is connected.

yoursite.com, in the editor

The ContentBox.js editor with a page open and Claude connected, shown in the top bar

Claude

Calls a tool, for example "replace section 2".

↓ MCP

Your connector

Finds the editor page this user has open.

↓ a live link

The editor page

A small script on the page (the bridge) makes the change with the editor's own methods.

The editor does the work

The change goes through the editor, so it behaves like a change the user made: it is on the page at once, and the editor's Undo and Redo work on it.

Saving stays yours

The page is saved through your own save code, when the user saves or asks Claude to. Nothing is written to your database behind the editor's back.

Only the open page

Claude can reach a page only while its owner has it open in the editor. With no editor open, the tools say so and do nothing.

Follow the Step-by-Step Guide

There is a step-by-step guide for each editor, with all the code to copy:

Each adds live editing to a Node.js site that already has the editor and a login, in eight steps:

  1. Install the packages
  2. Add the connector
  3. Add the tools
  4. Give Claude the framework guides
  5. Keep Claude's keys
  6. Connect it to your server
  7. Add the bridge to the editor page
  8. Connect Claude

Testing on your computer

Claude connects to websites on the internet, not to a computer. On your live site, use its own address. To test on your computer, give the site a temporary public address with a tunnel, for example Cloudflare's free tunnel:

cloudflared tunnel --url http://localhost:3000

Then add the connector in claude.ai with that address followed by /mcp (see Connecting Claude, and What to Ask), open a page in the editor through the same address, and ask Claude, for example:

Add a three-column features section below the header, then save.

Add It to Your Site

The connector does no logins itself. Your site tells it who is logged in, through four hooks:

attachMcp(app, httpServer, {
  getUser: (req) => currentUser(req),  // or null
  loginUrl: (back) => '/login?next=' + encodeURIComponent(back),
  session: sessionMiddleware,
  store: mcpStore,
});
  • getUser and loginUrl come from your own login.
  • session is your session middleware, so the editor page's live link sees the same login.
  • store saves and finds Claude's keys in your database.

On the editor page, connect the editor and pass your save code:

<script src="mcp/bridge.js"></script>
<script>
  connectClaudeBridge(() => builder, {
    url: '/mcp/bridge',
    onSave: () => { /* your save code */ },
  });
</script>

That is all the editor page needs. The step-by-step guide has every file, with the full code.

What Claude Can Do

In live editing, Claude gets a short list of tools that work on the open page. Each section (in ContentBuilder.js, each row) is changed on its own, so the rest of the page stays exactly as it was.

Undo and Redo are tools too: the user can say "undo that" in the chat, or press Undo in the editor.

The framework guides tell Claude which classes and attributes the editor understands, so the sections it writes look right and stay editable.

  • get_outline: One line per section of the open page
  • get_selection: What the user has selected in the editor
  • get_section: The full markup of one section (ContentBuilder.js: get_row, and the same for the next three)
  • replace_section: Replace one section
  • insert_section: Add a section at a position
  • delete_section: Remove one section
  • get_page_styles: The page's saved global CSS, for site-wide styling (ContentBox.js; ContentBuilder.js has get_html and load_html for the whole page instead)
  • get_framework_docs: The editor's markup guides
  • undo, redo: The editor's Undo and Redo
  • save: Runs your save code

© 2026 InnovaStudio

This site is built with Site Builder Kit