@slidev/cli 52.15.2 → 52.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ import { n as getRoots } from "./resolver-BBT539iz.mjs";
2
+ import { i as createSlidevMcpServer, s as parser, u as version } from "./serve-CgOXLPUI.mjs";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ //#region node/mcp/stdio.ts
5
+ /**
6
+ * Start a Slidev MCP server over stdio, operating on the markdown files
7
+ * directly (no dev server required, so no live-navigation tool).
8
+ *
9
+ * Note: in stdio mode, stdout is reserved for the MCP protocol — nothing
10
+ * else may be printed to it.
11
+ */
12
+ async function startMcpStdioServer(entry) {
13
+ const { userRoot } = await getRoots(entry);
14
+ await createSlidevMcpServer({
15
+ version,
16
+ entry,
17
+ getData: () => parser.load({
18
+ userRoot,
19
+ roots: [userRoot]
20
+ }, entry)
21
+ }).connect(new StdioServerTransport());
22
+ }
23
+ //#endregion
24
+ export { startMcpStdioServer };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
3
  "type": "module",
4
- "version": "52.15.2",
4
+ "version": "52.17.0",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -43,21 +43,23 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@antfu/ni": "^30.1.0",
46
+ "@antfu/ni": "^30.2.0",
47
47
  "@antfu/utils": "^9.3.0",
48
48
  "@comark/markdown-it": "^0.3.4",
49
- "@iconify-json/carbon": "^1.2.20",
49
+ "@iconify-json/carbon": "^1.2.24",
50
50
  "@iconify-json/ph": "^1.2.2",
51
51
  "@iconify-json/svg-spinners": "^1.2.4",
52
52
  "@lillallol/outline-pdf": "^4.0.0",
53
- "@shikijs/markdown-it": "^4.0.2",
54
- "@shikijs/twoslash": "^4.0.2",
55
- "@shikijs/vitepress-twoslash": "^4.0.2",
56
- "@unocss/extractor-mdc": "^66.6.8",
57
- "@unocss/reset": "^66.6.8",
58
- "@vitejs/plugin-vue": "^6.0.6",
59
- "@vitejs/plugin-vue-jsx": "^5.1.5",
60
- "ansis": "^4.2.0",
53
+ "@modelcontextprotocol/sdk": "^1.29.0",
54
+ "@shikijs/magic-move": "^4.3.1",
55
+ "@shikijs/markdown-it": "^4.3.1",
56
+ "@shikijs/twoslash": "^4.3.1",
57
+ "@shikijs/vitepress-twoslash": "^4.3.1",
58
+ "@unocss/extractor-mdc": "^66.7.5",
59
+ "@unocss/reset": "^66.7.5",
60
+ "@vitejs/plugin-vue": "^6.0.7",
61
+ "@vitejs/plugin-vue-jsx": "^5.1.6",
62
+ "ansis": "^4.3.1",
61
63
  "chokidar": "^5.0.0",
62
64
  "cli-progress": "^3.12.0",
63
65
  "connect": "^3.7.0",
@@ -67,21 +69,21 @@
67
69
  "global-directory": "^5.0.0",
68
70
  "htmlparser2": "^12.0.0",
69
71
  "is-installed-globally": "^1.0.0",
70
- "jiti": "^2.6.1",
71
- "katex": "^0.16.45",
72
- "local-pkg": "^1.1.2",
72
+ "jiti": "^2.7.0",
73
+ "katex": "^0.17.0",
74
+ "local-pkg": "^1.2.1",
73
75
  "lz-string": "^1.5.0",
74
76
  "magic-string": "^0.30.21",
75
77
  "magic-string-stack": "^1.1.0",
76
- "markdown-exit": "^1.0.0-beta.9",
78
+ "markdown-exit": "^1.1.0-beta.2",
77
79
  "markdown-it-footnote": "^4.0.0",
78
80
  "markdown-it-github-alerts": "^1.0.1",
79
81
  "mlly": "^1.8.2",
80
82
  "monaco-editor": "^0.55.1",
81
- "obug": "^2.1.1",
83
+ "obug": "^2.1.3",
82
84
  "open": "^11.0.0",
83
85
  "pdf-lib": "^1.17.1",
84
- "picomatch": "^4.0.4",
86
+ "picomatch": "^4.0.5",
85
87
  "plantuml-encoder": "^1.4.0",
86
88
  "postcss-nested": "^7.0.2",
87
89
  "pptxgenjs": "^4.0.1",
@@ -89,31 +91,32 @@
89
91
  "public-ip": "^8.0.0",
90
92
  "resolve-from": "^5.0.0",
91
93
  "resolve-global": "^2.0.0",
92
- "semver": "^7.7.4",
93
- "shiki": "^4.0.2",
94
- "shiki-magic-move": "^1.3.0",
94
+ "semver": "^7.8.5",
95
+ "shiki": "^4.3.1",
95
96
  "sirv": "^3.0.2",
96
97
  "source-map-js": "^1.2.1",
97
- "typescript": "^5.9.3",
98
- "unhead": "^2.1.13",
99
- "unocss": "^66.6.8",
98
+ "typescript": "^6.0.3",
99
+ "unhead": "^3.1.7",
100
+ "unocss": "^66.7.5",
100
101
  "unplugin-icons": "^23.0.1",
101
- "unplugin-vue-components": "^32.0.0",
102
- "unplugin-vue-markdown": "^30.0.0",
102
+ "unplugin-vue-components": "^32.1.0",
103
+ "unplugin-vue-markdown": "^32.0.0",
103
104
  "untun": "^0.1.3",
104
105
  "uqr": "^0.1.3",
105
- "vite": "^8.0.10",
106
- "vite-plugin-inspect": "^11.3.3",
106
+ "vite": "^8.1.3",
107
+ "vite-plugin-inspect": "^11.4.1",
108
+ "vite-plugin-pwa": "^1.3.0",
107
109
  "vite-plugin-remote-assets": "^2.1.0",
108
- "vite-plugin-static-copy": "^4.1.0",
110
+ "vite-plugin-static-copy": "^4.1.1",
109
111
  "vite-plugin-vue-server-ref": "^1.0.0",
110
112
  "vitefu": "^1.1.3",
111
- "vue": "^3.5.33",
112
- "yaml": "^2.8.3",
113
+ "vue": "^3.5.39",
114
+ "yaml": "^2.9.0",
113
115
  "yargs": "^18.0.0",
114
- "@slidev/parser": "52.15.2",
115
- "@slidev/types": "52.15.2",
116
- "@slidev/client": "52.15.2"
116
+ "zod": "^3.25.76",
117
+ "@slidev/parser": "52.17.0",
118
+ "@slidev/client": "52.17.0",
119
+ "@slidev/types": "52.17.0"
117
120
  },
118
121
  "devDependencies": {
119
122
  "@hedgedoc/markdown-it-plugins": "^2.1.4",
@@ -158,6 +158,7 @@ Presenter notes go here
158
158
  | VS Code extension | Install `antfu.slidev` | [editor-vscode](references/editor-vscode.md) |
159
159
  | Prettier | `prettier-plugin-slidev` | [editor-prettier](references/editor-prettier.md) |
160
160
  | Eject theme | `slidev theme eject` | [tool-eject-theme](references/tool-eject-theme.md) |
161
+ | MCP server (AI agents) | `http://localhost:<port>/__mcp` or `slidev mcp` | [tool-mcp](references/tool-mcp.md) |
161
162
 
162
163
  ### Lifecycle & API
163
164
 
@@ -93,6 +93,14 @@ slidev format [entry]
93
93
 
94
94
  Formats the slides markdown file.
95
95
 
96
+ ## MCP Server
97
+
98
+ ```bash
99
+ slidev mcp [entry]
100
+ ```
101
+
102
+ Starts an MCP (Model Context Protocol) server over stdio for AI agents to inspect and edit the slides. When a dev server is running, an HTTP MCP endpoint is also available at `http://localhost:<port>/__mcp`. See [tool-mcp](tool-mcp.md).
103
+
96
104
  ## Theme Eject
97
105
 
98
106
  ```bash
@@ -0,0 +1,48 @@
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
@@ -1,13 +0,0 @@
1
- import { t as resolveViteConfigs } from "./shared-CmTSrQGO.mjs";
2
- import { join } from "node:path";
3
- import process from "node:process";
4
- import { createServer } from "vite";
5
-
6
- //#region node/commands/serve.ts
7
- async function createServer$1(options, viteConfig = {}, serverOptions) {
8
- process.env.EDITOR = process.env.EDITOR || "code";
9
- return await createServer(await resolveViteConfigs(options, { optimizeDeps: { entries: [join(options.clientRoot, "main.ts")] } }, viteConfig, "serve", serverOptions));
10
- }
11
-
12
- //#endregion
13
- export { createServer$1 as t };