SlatepadDocs

AI integration

Slatepad works without any AI. The features below are optional.

Two ways to wire AI

MethodWhat it doesWhen to use
MCP integrationYour AI chat (Claude Desktop, Claude Code, Gemini CLI, Codex CLI, Cursor) can read and edit your Slatepad document in real time.When you already chat with an AI and want it to make changes in your normal session.
Inline ✨ AI buttonSelect text in Slatepad, click ✨ AI, type a prompt. Slatepad sends just that selection to Anthropic and applies the response.When you want a quick one-off rewrite without leaving the editor.

You can have both on at once. The header pill tells you what is connected.

MCP setup

Add the Slatepad MCP server to your AI client's config file, then restart the client. Open Slatepad in your browser and the AI can start editing.

Config file locations

ClientConfig file
Claude Desktop (macOS)~/Library/Application Support/Claude/claude_desktop_config.json
Claude Desktop (Windows)%APPDATA%\Claude\claude_desktop_config.json
Claude Code~/.claude/settings.json
Cursor.cursor/mcp.json (per project) or Settings > Features > MCP
Gemini CLI~/.gemini/settings.json
Codex CLI~/.codex/config.toml

The general config shape (JSON clients):

{
  "mcpServers": {
    "slatepad": {
      "command": "npx",
      "args": ["-y", "slate-mcp"]
    }
  }
}

Click "AI off" in the editor header for the exact snippet for your client, with copy button.

Available MCP tools

After connecting, your AI can call the following tools on slate.*:

ToolWhat it does
slate.pingHealth check. Returns "ok" if Slatepad is open in the browser.
slate.getDocumentGet the full HTML of the current document.
slate.replaceDocumentReplace the entire HTML document. Use for full rewrites or large restructuring.
slate.getOutlineGet a lightweight heading outline: [{eid, tagName, level, text}]. Useful before targeted edits.
slate.listSlidesList all top-level slides as [{index, title, eid}].
slate.getSlideGet the HTML of a single slide by zero-based index.
slate.replaceSlideReplace one slide by index with new HTML. Undoable in Slate.
slate.moveSlideMove a slide from one position to another. Undoable.
slate.listEditableElementsList all elements with a data-eid attribute: [{eid, tagName, snippet}].
slate.editTextReplace the text content of an element by eid. Undoable.
slate.applyBoldWrap or unwrap an element's content in <strong>.
slate.applyItalicWrap or unwrap an element's content in <em>.
slate.applyUnderlineWrap or unwrap an element's content in <u>.
slate.applyLinkWrap an element's content in <a href="...">. Pass empty string to remove.
slate.applyColorSet inline text color of an element to a hex value.
slate.applyAlignSet text alignment of an element: left, center, right, or justify.
slate.setFontSizeSet semantic font size: title, heading, or normal.
slate.deleteBlockRemove a block element by eid. Undoable.
slate.duplicateBlockClone a block element and insert it after the original. The clone gets a new eid. Undoable.

Inline AI: two source modes

Open AI Settings (the gear icon in the editor header). You get three radio choices.

  1. Use my MCP session (recommended if your client supports it). The inline ✨ AI button asks your already-connected AI to do the rewrite via MCP sampling. No API key needed. Currently supported by Claude Desktop.
  2. Use my Anthropic API key. Paste a key from console.anthropic.com. The key lives in this browser only.
  3. Auto (default). Try MCP first, fall back to the API key if MCP is not available.

What gets sent

When you select a paragraph and click ✨ AI, only that paragraph's HTML and your prompt are sent. Nothing else from your document leaves your browser.

For MCP sampling the request goes to your AI client over local IPC. For the API key path it goes directly to api.anthropic.com.