Skip to main content
Glama

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 single add_slides call.

  • 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 stdout reserved for MCP JSON-RPC and sends logs/errors to stderr.

  • No required environment variables: install, configure, and start using it.

Requirements

  • Node.js >=18

  • pnpm (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.sh

The installer detects whether it can use the local build:

node /path/to/slidev-mcp/dist/index.js

If node is unavailable but deno is installed, the installer uses the local build through Deno:

deno run -A /path/to/slidev-mcp/dist/index.js

If dist/index.js is missing, it falls back to:

pnpm dlx slidev-mcp

Interactive Installer

Run:

bash scripts/install.sh

The 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-run

Targets 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) Quit

When updating from a git checkout, the installer runs:

git pull --ff-only
pnpm install
pnpm build

If 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.json

  • Project: ./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-mcp

For a local build:

claude mcp add --scope user slidev-mcp -- node /path/to/slidev-mcp/dist/index.js

If 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.js

Supported 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.toml

  • Project: .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

init_presentation

Create or attach to a Slidev project, with minimal, agent-dark, or custom presets; supports safe dry_run previews including overwrite plans

import_markdown

Import a full multi-slide document in one call, from a file path (content never passes through the model's tokens) or inline content; replace swaps slides.md (backing up the old file to slides.md.bak) or append adds after existing slides; validates before writing and supports dry_run diff preview

add_slide

Append or insert a single slide; supports dry_run diff preview

add_slides

Append or insert many slides as one contiguous block in a single call (one parse + write, all-or-nothing); supports dry_run diff preview

update_slide

Replace the content of an existing slide; supports dry_run diff preview

delete_slide

Delete a slide, while protecting the last slide; supports dry_run diff preview

list_slides

Inspect slide order, previews, and frontmatter

get_project_info

Inspect active project paths, theme, package versions, slide count, and verification status

set_theme

Change the Slidev theme and optionally install the theme package; supports dry_run multi-file diff preview

set_style

Apply global CSS, per-slide style blocks, or UnoCSS classes; supports dry_run diff preview

set_slide_transition

Configure transitions, v-click reveals, and v-motion animations; supports dry_run diff preview

add_diagram

Insert Mermaid diagrams; supports dry_run diff preview

export_presentation

Export to PDF, PNG, or a static SPA build with custom output, timeout, dry-run, and syntax preflight

verify_presentation

Validate slides.md; render and full levels also run a Slidev build check in a cleaned temporary output directory

repair_presentation

Safely normalize slides.md structure, removing BOM/leading whitespace and canonicalizing separators

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:

  1. 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. Use mode: "replace" to swap slides.md (the previous file is backed up to slides.md.bak) or mode: "append" to add the imported slides after the existing ones, keeping the current global frontmatter. Run init_presentation first so a project exists, then import.

  2. add_slides(slides: [...]) — when the content must be authored inline (no file on disk yet). One parse and one write cover the whole batch.

  3. 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_presentation

This 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

{ "success": true, "data": { ... }, "message"?: "...", "warnings"?: [], "issues"?: [] }

Error

{ "success": false, "code": "...", "message": "...", "error": "...", "details"?: { ... } } plus MCP isError: true

Dry-run previews

For write tools that edit project files, pass dry_run: true to preview without writing. The success data includes:

Field

Meaning

dryRun

Always true for preview responses

wouldWrite

Files that would be changed

diff

Unified diff preview of the pending file change

diffs

Per-file unified diff previews for tools that can change multiple files, such as set_theme updating both slides.md and package.json

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 to code.

  • minimal: creates a small standard Slidev project with slides.md and package.json only.

  • 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/stdio

  • Working directory: process.cwd()

  • Project discovery: finds slides.md in the current directory or one immediate child directory

  • Logging: writes logs and errors to stderr

  • MCP protocol output: writes JSON-RPC traffic to stdout

Local Development

pnpm install
pnpm build
pnpm typecheck
pnpm test
pnpm check
node dist/index.js

For development without building:

pnpm dev

Security

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 tools
add_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

    A3.7/5.0

    Scored across 15 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers