| 1 | --- |
| 2 | name: mcp |
| 3 | description: Built-in MCP server for AI agents to inspect, edit, reorder, and navigate slides |
| 4 | --- |
| 5 | |
| 6 | # MCP Server |
| 7 | |
| 8 | Slidev ships a built-in MCP (Model Context Protocol) server exposing structured tools to read, edit, reorder, and navigate a deck. Prefer these tools over raw text edits for slide-level operations (update/insert/remove/move) — they handle Slidev's compound separators correctly and hot-reload the presentation. |
| 9 | |
| 10 | ## Usage |
| 11 | |
| 12 | With a running dev server (streamable HTTP): |
| 13 | |
| 14 | ``` |
| 15 | http://localhost:<port>/__mcp |
| 16 | ``` |
| 17 | |
| 18 | ```bash |
| 19 | # e.g. for Claude Code |
| 20 | claude mcp add --transport http slidev http://localhost:3030/__mcp |
| 21 | ``` |
| 22 | |
| 23 | Standalone over stdio (no dev server, operates on files directly): |
| 24 | |
| 25 | ```bash |
| 26 | slidev mcp [entry] |
| 27 | ``` |
| 28 | |
| 29 | ## Tools |
| 30 | |
| 31 | | Tool | Description | |
| 32 | | --- | --- | |
| 33 | | `slidev-get-info` | Deck overview: entry, title, slide count, markdown files, server URL, current position | |
| 34 | | `slidev-list-slides` | All slides with number, title, layout, source file | |
| 35 | | `slidev-get-slide` | Full source of one slide: frontmatter, content, note | |
| 36 | | `slidev-update-slide` | Update content, note, and/or frontmatter of a slide | |
| 37 | | `slidev-insert-slide` | Insert a new slide after an existing one | |
| 38 | | `slidev-remove-slide` | Remove a slide | |
| 39 | | `slidev-move-slide` | Move a slide before/after another to reorder the deck | |
| 40 | | `slidev-goto-slide` | Navigate the live presentation to a slide (dev server only) | |
| 41 | |
| 42 | ## Behavior |
| 43 | |
| 44 | - Slides are addressed by rendered 1-based numbers (as shown in the presentation) |
| 45 | - Edits are saved to the markdown files; a running dev server hot-reloads instantly |
| 46 | - The first slide of the entry file cannot be removed/moved (its frontmatter is the deck headmatter) |
| 47 | - Slides imported via `src:` are edited in their own file; moves cannot cross files |
| 48 | - Disable with `mcp: false` in the headmatter |
| 49 |