Skip to content

MCP server

astro-slides ships a first-class Model Context Protocol server as a CLI subcommand. Any MCP-aware client — Claude Code, Cursor, Windsurf, Continue, or a custom agent — can connect to list, read, author, present, and export your decks. This is a real protocol server, not just a documentation bundle: the agent can actually drive the framework.

The decision to ship a server rather than only a skill bundle is recorded in ADR-0009. The server is bundled from the CLI, so there is nothing extra to install once you have astro-slides.

The MCP server is the mcp-server subcommand. By default it speaks stdio, which is what local agents (Claude Code, Cursor, Windsurf, Continue) expect — they spawn the process and talk to it over stdin/stdout.

Terminal window
astro-slides mcp-server

You can point it at a specific project directory with a positional argument (defaults to the current working directory):

Terminal window
astro-slides mcp-server ./my-deck-project

For remote clients, switch the transport to Streamable HTTP (the MCP spec’s modern HTTP transport, which replaces the deprecated SSE transport). WebSocket is not supported in v1.

Terminal window
astro-slides mcp-server --transport http --port 4444

The server listens on http://127.0.0.1:4444/mcp by default. Relevant flags:

FlagDefaultPurpose
--transport <stdio|http>stdioTransport to serve.
--host <host>127.0.0.1HTTP bind host.
--port <n>4444HTTP port.
--token <secret>Bearer token for HTTP auth (or ASTRO_SLIDES_MCP_TOKEN).
--read-onlyfalseDrop every file-mutating tool (write and export/capture).
--sync-gateway <url>Running dev-server sync gateway URL for the navigate tools.
--sync-token <token>Token for the sync gateway.
Terminal window
# Remote / networked: token is mandatory
astro-slides mcp-server --transport http --host 0.0.0.0 --port 4444 --token "$MY_SECRET"

The server exposes 20 tools across five categories. Schemas are authored in Zod and described inline, so clients get self-documenting tool listings.

CategoryTools
Readlist_decks, list_slides, get_slide, get_speaker_notes, list_layouts, list_themes
Writeadd_slide, update_slide, delete_slide, set_frontmatter, set_theme
Navigategoto_slide, next_slide, prev_slide, set_step
Exportexport_pdf, export_png, export_pptx, export_md
Capturescreenshot_slide

A few things worth knowing about how these behave:

  • Write tools are text-level. The parser has no AST-to-source serializer, so writes slice the deck file into verbatim per-slide blocks and reserialize only the edited block — untouched slides stay byte-for-byte identical. Every mutation is reparse-verified against the expected slide count before it returns, so a write that would corrupt structure is refused. Whole files are written back, so a running dev server picks up changes via HMR.
  • --read-only drops every tool that writes to disk — the write tools and export/capture (exports write files too) — leaving only read and navigate. Use it when you want an agent that can inspect and present but never touch the filesystem.
  • Navigate tools need a live sync gateway. goto_slide, next_slide, prev_slide, and set_step drive a presented deck over a WebSocket to the Phase 11 sync gateway, which only runs under astro-slides dev --remote. Point the server at it with --sync-gateway (and --sync-token if the gateway is protected). Without a running gateway the navigate tools are inert.
  • Export and capture spawn the CLI, reusing the same tested Playwright pipeline as astro-slides export.

For a stdio client such as Claude Code, register the server as a command that spawns astro-slides mcp-server in your project directory:

{
"mcpServers": {
"astro-slides": {
"command": "astro-slides",
"args": ["mcp-server", "."]
}
}
}

This is exactly the configuration shipped in the bundled Claude Code plugin (see below). Adjust the args path if your deck project lives elsewhere.

For clients without MCP support — or to give an MCP agent richer grounding — astro-slides ships a skill bundle at the repo root: skills/astro-slides/SKILL.md plus eight per-feature reference documents (syntax, layouts, animations, code, math-and-diagrams, presenter-and-remote, export, mcp).

The repo root also carries a Claude Code plugin (.claude-plugin/plugin.json + marketplace.json) that bundles both the skill and the MCP server, so installing the plugin gives an agent the reference docs and a ready-wired astro-slides mcp-server . connection in one step.

  • docs/decisions/0009-mcp-server-first-class.md — the decision to ship an MCP server.
  • docs/built/14-mcp-server.md — the distilled phase writeup.
  • packages/cli/src/main.ts — the mcp-server subcommand and its flags.
  • packages/mcp-server/src/index.tsrunMcpServer entry point.
  • packages/mcp-server/src/server.ts — tool registration and the read-only gate.
  • packages/mcp-server/src/tools/{read,write,navigate,media}.ts — the tool categories.
  • packages/mcp-server/src/transports.ts — stdio + Streamable HTTP + the auth gate.
  • packages/mcp-server/src/write-engine.ts — text-level write engine with reparse-verify.
  • skills/astro-slides/ — skill bundle (SKILL.md + eight references).
  • .claude-plugin/plugin.json + .claude-plugin/marketplace.json — the Claude Code plugin.