AI integration
Slatepad works without any AI. The features below are optional.
Two ways to wire AI
| Method | What it does | When to use |
|---|---|---|
| MCP integration | Your 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 button | Select 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
| Client | Config 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.*:
| Tool | What it does |
|---|---|
slate.ping | Health check. Returns "ok" if Slatepad is open in the browser. |
slate.getDocument | Get the full HTML of the current document. |
slate.replaceDocument | Replace the entire HTML document. Use for full rewrites or large restructuring. |
slate.getOutline | Get a lightweight heading outline: [{eid, tagName, level, text}]. Useful before targeted edits. |
slate.listSlides | List all top-level slides as [{index, title, eid}]. |
slate.getSlide | Get the HTML of a single slide by zero-based index. |
slate.replaceSlide | Replace one slide by index with new HTML. Undoable in Slate. |
slate.moveSlide | Move a slide from one position to another. Undoable. |
slate.listEditableElements | List all elements with a data-eid attribute: [{eid, tagName, snippet}]. |
slate.editText | Replace the text content of an element by eid. Undoable. |
slate.applyBold | Wrap or unwrap an element's content in <strong>. |
slate.applyItalic | Wrap or unwrap an element's content in <em>. |
slate.applyUnderline | Wrap or unwrap an element's content in <u>. |
slate.applyLink | Wrap an element's content in <a href="...">. Pass empty string to remove. |
slate.applyColor | Set inline text color of an element to a hex value. |
slate.applyAlign | Set text alignment of an element: left, center, right, or justify. |
slate.setFontSize | Set semantic font size: title, heading, or normal. |
slate.deleteBlock | Remove a block element by eid. Undoable. |
slate.duplicateBlock | Clone 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.
- 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.
- Use my Anthropic API key. Paste a key from console.anthropic.com. The key lives in this browser only.
- 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.