slidev-mcp
Allows applying global CSS and per-slide style blocks to customize Slidev presentation appearance.
Allows importing full multi-slide Markdown documents from disk or inline content and managing Slidev’s Markdown-based slide source.
Allows inserting Mermaid diagrams into presentation slides.
Allows applying UnoCSS utility classes to style Slidev slides.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@slidev-mcp Create a 5-slide Slidev deck about renewable energy and export it to PDF"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
slidev-mcp
Create, edit, validate, and export Slidev presentations from your AI agent.
slidev-mcp is a local Model Context Protocol server for Slidev. It gives supported AI clients a focused toolkit for building real presentation projects: initialize decks, import a whole deck or add slides one at a time or in bulk, update slides, apply themes and styles, insert Mermaid diagrams, verify the deck, and export final assets.
Why It Exists
Slide decks are usually iterative: draft, restructure, style, verify, export, repeat. slidev-mcp turns that workflow into MCP tools your agent can call directly inside a trusted local workspace.
Related MCP server: Slidev MCP Server
Highlights
Built for Slidev: works with
slides.md, themes, transitions, Mermaid diagrams, and Slidev exports.Token-efficient bulk authoring: import a full deck from disk with
import_markdown(slide content never passes through the model's tokens) or add many slides in a singleadd_slidescall.Local-first: runs over STDIO and operates in the current workspace.
Agent-ready: installer support for OpenCode, Claude Code, Antigravity, and Codex.
Safe output behavior: keeps
stdoutreserved for MCP JSON-RPC and sends logs/errors tostderr.No required environment variables: install, configure, and start using it.
Requirements
Node.js
>=18pnpm (recommended; this repo is managed with pnpm and ships a
pnpm-lock.yaml)Python 3, used by the installer to patch JSON/TOML config files
Quick Start
Clone, install, build, and run the interactive installer:
git clone <repo-url> slidev-mcp
cd slidev-mcp
pnpm install
pnpm build
bash scripts/install.shThe installer detects whether it can use the local build:
node /path/to/slidev-mcp/dist/index.jsIf node is unavailable but deno is installed, the installer uses the local build through Deno:
deno run -A /path/to/slidev-mcp/dist/index.jsIf dist/index.js is missing, it falls back to:
pnpm dlx slidev-mcpInteractive Installer
Run:
bash scripts/install.shThe installer can configure:
OpenCode
Claude Code
Antigravity
Codex
For CI or scripted setup, use non-interactive mode:
bash scripts/install.sh --non-interactive --target codex --scope global
bash scripts/install.sh --non-interactive --target all --scope project --dry-runTargets are opencode, claude, antigravity, codex, or all. Scopes are global, project, or both.
It also includes an Update option. The menu shows whether the local package appears up to date, has an update available, or could not determine the status.
slidev-mcp interactive installer
Configure MCP once, then get back to making slides.
Runtime
mode: local build
command: node /path/to/slidev-mcp/dist/index.js
version: update available v0.1.0 -> v0.3.2
Choose what to configure
1) OpenCode
2) Claude Code
3) Antigravity
4) Codex
a) All four
u) Update slidev-mcp [update available v0.1.0 -> v0.3.2]
q) QuitWhen updating from a git checkout, the installer runs:
git pull --ff-only
pnpm install
pnpm buildIf the working tree has uncommitted changes, it asks before pulling.
Manual Configuration
Use manual configuration when you prefer to edit client config files yourself or cannot run the installer.
OpenCode
Config paths:
Global:
~/.config/opencode/opencode.jsonProject:
./opencode.json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"slidev-mcp": {
"type": "local",
"command": ["pnpm", "dlx", "slidev-mcp"],
"enabled": true
}
}
}For a Deno-powered local build, use:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"slidev-mcp": {
"type": "local",
"command": ["deno", "run", "-A", "/path/to/slidev-mcp/dist/index.js"],
"enabled": true
}
}
}Claude Code
Use the Claude CLI:
claude mcp add --scope user slidev-mcp -- pnpm dlx slidev-mcpFor a local build:
claude mcp add --scope user slidev-mcp -- node /path/to/slidev-mcp/dist/index.jsIf your environment does not have node available, Deno can run the built server:
claude mcp add --scope user slidev-mcp -- deno run -A /path/to/slidev-mcp/dist/index.jsSupported scopes are user, local, and project.
Antigravity
Config path:
~/.gemini/antigravity/mcp_config.json{
"mcpServers": {
"slidev-mcp": {
"command": "pnpm",
"args": ["dlx", "slidev-mcp"]
}
}
}Codex
Config paths:
Global:
~/.codex/config.tomlProject:
.codex/config.toml
[mcp_servers.slidev-mcp]
command = "pnpm"
args = ["dlx", "slidev-mcp"]
type = "stdio"For a local build:
[mcp_servers.slidev-mcp]
command = "node"
args = ["/path/to/slidev-mcp/dist/index.js"]
type = "stdio"With Deno:
[mcp_servers.slidev-mcp]
command = "deno"
args = ["run", "-A", "/path/to/slidev-mcp/dist/index.js"]
type = "stdio"MCP Tools
Tool | What it does |
| Create or attach to a Slidev project, with |
| Import a full multi-slide document in one call, from a file |
| Append or insert a single slide; supports |
| Append or insert many slides as one contiguous block in a single call (one parse + write, all-or-nothing); supports |
| Replace the content of an existing slide; supports |
| Delete a slide, while protecting the last slide; supports |
| Inspect slide order, previews, and frontmatter |
| Inspect active project paths, theme, package versions, slide count, and verification status |
| Change the Slidev theme and optionally install the theme package; supports |
| Apply global CSS, per-slide style blocks, or UnoCSS classes; supports |
| Configure transitions, |
| Insert Mermaid diagrams; supports |
| Export to PDF, PNG, or a static SPA build with custom output, timeout, dry-run, and syntax preflight |
| Validate |
| Safely normalize |
Building a deck efficiently
Building a large deck by calling add_slide once per slide is expensive: each call is a separate turn, and the model re-reads every prior tool call, so the accumulated context cost grows roughly with the square of the slide count. Pick the cheapest tool for the job:
import_markdown(path: "deck.md")— cheapest. The Markdown is read on the server, so the slide content never passes through the model's tokens. One call builds the whole deck regardless of slide count. Usemode: "replace"to swapslides.md(the previous file is backed up toslides.md.bak) ormode: "append"to add the imported slides after the existing ones, keeping the current global frontmatter. Runinit_presentationfirst so a project exists, then import.add_slides(slides: [...])— when the content must be authored inline (no file on disk yet). One parse and one write cover the whole batch.add_slide(content)— for single-slide edits only, not for assembling a deck.
A typical bulk flow:
init_presentation -> import_markdown(path: "deck.md") -> verify_presentation -> export_presentationThis guidance is also delivered to the client automatically through the MCP server instructions field, so a compatible agent receives the recommended workflow on connection — there is no separate "list tools" call, since the protocol's own tools/list already advertises every tool and its schema.
Tool response contract
Tools return a JSON envelope inside the MCP text content:
Result | Shape |
Success |
|
Error |
|
Dry-run previews
For write tools that edit project files, pass dry_run: true to preview without writing. The success data includes:
Field | Meaning |
| Always |
| Files that would be changed |
| Unified diff preview of the pending file change |
| Per-file unified diff previews for tools that can change multiple files, such as |
export_presentation also supports dry_run, but it previews the Slidev command/arguments instead of returning a file diff.
import_markdown previews include wouldBackup (the slides.md.bak path that a non-preview replace would create) and importedSlides (how many slides the source document contains), alongside the standard diff.
init_presentation supports dry_run as a safe scaffold preview. It validates and resolves the target path, builds the expected scaffold in memory, and never creates directories, writes files, deletes existing content, sets the active project path, or runs pnpm install. Its preview data includes mode (create, attach, or overwrite), wouldCreate, wouldReplace, wouldDelete, wouldKeep, per-file diffs for existing scaffold files, and install command metadata.
init_presentation presets
agent-dark(default): preserves the v1.0 behavior with the opinionated dark style, bundled Vue components, default theme, and starter slides. Its code styling stays clean and lets Slidev/Shiki own syntax-highlighted code blocks; it does not add borders tocode.minimal: creates a small standard Slidev project withslides.mdandpackage.jsononly.custom: currently uses the agent-ready scaffold while allowing callers to override theme and skip dependency installation.
init_presentation also supports install_dependencies: false, overwrite: true, and dry_run: true. Existing directories are never replaced unless overwrite is explicitly set; use dry_run: true with overwrite: true first to inspect exactly which scaffold files would be replaced and which non-scaffold entries would be deleted.
If behavior differs between documentation and code, treat src/tools/*.ts as the source of truth.
Runtime Behavior
Transport: STDIO via
@modelcontextprotocol/sdk/server/stdioWorking directory:
process.cwd()Project discovery: finds
slides.mdin the current directory or one immediate child directoryLogging: writes logs and errors to
stderrMCP protocol output: writes JSON-RPC traffic to
stdout
Local Development
pnpm install
pnpm build
pnpm typecheck
pnpm test
pnpm check
node dist/index.jsFor development without building:
pnpm devSecurity
Run this server only in trusted local workspaces. Some tools execute local commands such as pnpm and pnpm exec slidev inside the active project directory. Avoid elevated privileges, review generated files before publishing, and see SECURITY.md for reporting and operational guidance.
Contributing
Contributions are welcome. Read CONTRIBUTING.md for setup, validation, and pull request guidance.
License
MIT. See LICENSE.
Available Tools
15 toolsadd_diagramA
Add a Mermaid diagram to a Slidev presentation slide. Supports all Mermaid diagram types including flowcharts, sequence diagrams, class diagrams, ER diagrams, Gantt charts, pie charts, git graphs, mind maps, timelines, and more. The diagram is wrapped in a ```mermaid code block as required by Slidev. Can append a new slide, insert at a position, or replace an existing slide. Set dry_run=true to preview the slides.md diff without writing. Reference: https://mermaid.js.org/intro/syntax-reference.html
Inputs: definition (required), diagram_type (required), index, title, +4 more.
add_slideA
Add a new slide to the current presentation. Optionally specify a layout and an insertion index (1-based). If index is omitted, the slide is appended at the end. Set dry_run=true to preview the slides.md diff without writing.
Inputs: content (required), index, layout, dry_run.
add_slidesA
Add multiple slides to the current presentation in a single call, inserted as one contiguous block. Use this instead of repeated add_slide calls when adding several slides at once — it is dramatically cheaper in tokens (one parse + one write for the whole batch). Optionally specify a 1-based insertion index; if omitted, the block is appended. Set dry_run=true to preview the slides.md diff without writing.
Inputs: slides (required), index, dry_run.
delete_slideA
Delete a slide from the current presentation by its 1-based slide number. The global headmatter is not counted. Cannot delete the last remaining slide. Set dry_run=true to preview the slides.md diff without writing.
Inputs: slide_number (required), dry_run.
export_presentationC
Export the current presentation to PDF, PNG, or SPA. Supports custom output paths inside the project, dry-run, timeout, slide range, and syntax verification.
Inputs: format (required), output, slides, dry_run, +3 more.
get_project_infoA
Return information about the active Slidev project, including paths, slide count, theme, package versions, and syntax verification status.
Inputs: no named parameters.
import_markdownA
Import a full multi-slide Markdown document into the current presentation in a single call — the token-efficient way to build or replace a large deck. Pass path to read the Markdown from disk (content never touches the model's tokens) or content to import inline. mode=replace swaps the entire slides.md (backing up the old one to slides.md.bak); mode=append adds the slides after the existing ones. The document is validated before writing; structural errors abort the import. Set dry_run=true to preview the diff without writing.
Inputs: mode, path, content, dry_run.
init_presentationA
Initialize a new Slidev presentation project. Creates the project directory, installs dependencies, and generates a slides.md file. The agent-dark preset includes clean Slidev/Shiki-friendly code styling without code borders. Set dry_run=true to preview create/attach/overwrite plans without writing, deleting, setting project state, or running pnpm install.
Inputs: title (required), project_name (required), theme, preset, +3 more.
list_slidesA
List all slides in the current presentation. Returns each slide's number, a content preview, and whether it has per-slide frontmatter.
Inputs: no named parameters.
repair_presentationB
Safely repair slides.md structure: remove BOM/leading whitespace and serialize the parsed presentation into canonical Slidev form. Never drops slide content silently.
Inputs: dry_run.
set_slide_transitionA
Add transitions, click animations (v-click), and motion effects (v-motion) to Slidev slides. Supports: slide transitions (per-slide or global), v-click step-by-step reveals, v-mark highlights, and v-motion enter/leave animations. Set dry_run=true to preview the slides.md diff without writing. Reference: https://sli.dev/guide/animations
Inputs: mode (required), dry_run, auto_wrap, transition, +4 more.
set_styleA
Manage CSS styling for the Slidev presentation. Supports three modes: 'global' (writes to style.css, applied to all slides), 'slide' (injects a block into a specific slide), and 'unocss' (adds UnoCSS/TailwindCSS utility classes to a slide's frontmatter). Set dry_run=true to preview the file diff without writing. Reference: https://sli.dev/custom/directory-structure#style
Inputs: mode (required), css, append, scoped, +3 more.
set_themeA
Change the theme of the current Slidev presentation. Updates the global frontmatter and optionally installs the theme package. Supports all built-in Slidev themes (default, seriph, apple-basic, etc.) and community themes. Set dry_run=true to preview slides.md/package.json diffs without writing or running pnpm install.
Inputs: theme, dry_run, install.
update_slideA
Replace the content of an existing slide (1-based slide number). The global frontmatter is not counted. Replaces the entire slide content including any existing per-slide frontmatter. Set dry_run=true to preview the slides.md diff without writing.
Inputs: new_content (required), slide_number (required), dry_run.
verify_presentationB
Verifies the current Slidev presentation. Syntax mode parses slides.md; render/full also run a Slidev build check in a system temporary output directory and clean it afterward.
Inputs: level.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools target a distinct operation, and descriptions explicitly disambiguate the tricky cases (add_slides vs repeated add_slide, import_markdown vs add_slides). The boundaries blur slightly: import_markdown in append mode overlaps with add_slides, and add_diagram can append or replace slides, overlapping with add_slide/update_slide. Descriptions resolve these well enough that an agent can choose correctly.
All 15 tools use a consistent snake_case verb_noun pattern: add_slide, update_slide, delete_slide, set_theme, verify_presentation, get_project_info, etc. The only variation is the singular/plural pair add_slide/add_slides, which is intentional and predictable.
15 tools is well within a sensible range for a slide-authoring server. Each tool covers a distinct lifecycle stage (init, author, style, animate, verify, export, repair), so none feel redundant despite the size.
Slide CRUD is fully covered (add/add_slides/import/list/update/delete), plus project init, theme, styling, transitions, diagrams, repair, verify, and export—a thorough lifecycle surface. Minor gaps exist: no tool to reorder/move existing slides, no full get_slide to read a single slide's exact content (list_slides only gives a preview), and no duplicate_slide.
Maintenance
Related MCP Connectors
Generate, render, and host Slidev presentations from markdown
Create, read, update and publish hosted SlideWeave presentations written in SlideLang.
Create and edit presentations with your AI, preview slides, open them in the Decktype editor.
Generate AI slide decks and export native PowerPoint (.pptx) and PDF presentations from chat.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables creation and management of Marp presentation projects with academic themes and structured slide layouts. Supports project initialization, slide generation with 6 layout templates, and integration with AI-powered editors like Claude Code and Cursor.3106 npm17MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create professional Slidev presentations and export them to PDF directly through natural language commands. Supports multiple themes, code syntax highlighting, and various slide layouts for business, technical, and educational content.1MIT
- AlicenseNot gradedqualityDmaintenanceCreates professional Slidev presentations with automated Git-based backup and recovery protection. Features built-in themes, interactive charts, component library, and AI-powered content generation with automatic version control.2MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to create and update presentations via Slidev, with hosted slides that can be shared via a permanent URL.5-