md2x 0.7.5 → 0.7.7
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.
- package/README.md +50 -18
- package/dist/chunks/{chunk-54X5GPSM.js → chunk-HHNNUKAW.js} +71 -71
- package/dist/chunks/{chunk-US45GBOT.js → chunk-UZ7TETMS.js} +1 -1
- package/dist/chunks/docx-exporter-GL6CNCQD.js +1 -0
- package/dist/chunks/mcp-server-V5MM5C5I.js +53 -0
- package/dist/index.js +1 -1
- package/dist/md2x.js +8 -5
- package/dist/renderer/live-runtime-md2x.js +1 -1
- package/package.json +4 -2
- package/dist/chunks/docx-exporter-7C6T4DFB.js +0 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Markdown → PDF/DOCX/HTML/Image converter.
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
9
|
- 📦 **Supported formats**: `pdf`, `docx`, `html`, `png`, `jpg/jpeg`, `webp`
|
|
10
|
-
- 🔌 **MCP (Model Context Protocol)**:
|
|
10
|
+
- 🔌 **MCP (Model Context Protocol)**: built-in MCP server
|
|
11
11
|
- 🧠 **Skills**: includes an agent skill at `skills/md2x/SKILL.md` for repeatable conversions/workflows
|
|
12
12
|
- 🧩 **Custom templates**: render `md2x` blocks with **Vue SFC** (`.vue`) and **Svelte 5** (`.svelte`) templates (plus plain HTML)
|
|
13
13
|
|
|
@@ -284,34 +284,66 @@ or
|
|
|
284
284
|
npx add-skill larchliu/md2x
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
-
## MCP
|
|
287
|
+
## MCP Server (Model Context Protocol)
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
The md2x CLI includes a built-in MCP server that exposes markdown conversion as MCP tools via stdio transport.
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
### Starting the MCP Server
|
|
292
292
|
|
|
293
293
|
```bash
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
npx md2x --mcp
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Or if installed globally:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
md2x --mcp
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Available Tools
|
|
304
|
+
|
|
305
|
+
- **`convert_markdown`**: Convert markdown files to PDF, DOCX, HTML, or Image formats
|
|
306
|
+
- Takes a `markdownFilePath` parameter
|
|
307
|
+
- Saves output to the same directory as the source file (or custom `outputPath`)
|
|
308
|
+
- Returns the file path to the converted document
|
|
309
|
+
|
|
310
|
+
- **`list_themes`**: List all available themes with their categories and featured status
|
|
311
|
+
|
|
312
|
+
### Integration with Claude Desktop
|
|
313
|
+
|
|
314
|
+
Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
315
|
+
|
|
316
|
+
```json
|
|
317
|
+
{
|
|
318
|
+
"mcpServers": {
|
|
319
|
+
"md2x": {
|
|
320
|
+
"command": "node",
|
|
321
|
+
"args": ["/path/to/markdown-viewer-extension/node/dist/md2x.js", "--mcp"]
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Testing
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
node --test test/mcp-server.test.mjs
|
|
296
331
|
```
|
|
297
332
|
|
|
298
|
-
|
|
333
|
+
See [MCP-SERVER.md](MCP-SERVER.md) for detailed documentation.
|
|
299
334
|
|
|
300
|
-
|
|
301
|
-
- Legacy HTTP+SSE: `GET /sse` and `POST /messages?sessionId=...`
|
|
302
|
-
- Resources (static files): `GET /resources/*`
|
|
335
|
+
---
|
|
303
336
|
|
|
304
|
-
|
|
337
|
+
## HTTP-based MCP Server (Separate Package)
|
|
305
338
|
|
|
306
|
-
-
|
|
307
|
-
- `markdown_to_image` - Convert Markdown to an image (`png`/`jpg`/`jpeg`/`webp`), may return multiple parts for very tall pages
|
|
308
|
-
- `markdown_convert` - Auto convert via `md2x.convert()` (front matter supported; includes image formats)
|
|
309
|
-
- `resources_upload` - Upload a file to `/resources` (e.g. images referenced by Markdown)
|
|
339
|
+
There's also a separate Express-based MCP server in the `mcp/` directory that exposes `md2x` as MCP tools over HTTP:
|
|
310
340
|
|
|
311
|
-
|
|
341
|
+
```bash
|
|
342
|
+
pnpm -C mcp install
|
|
343
|
+
pnpm -C mcp start
|
|
344
|
+
```
|
|
312
345
|
|
|
313
|
-
|
|
314
|
-
- Config: `PORT` (default `3000`) and `MD2X_BASE_URL` (used to build the public `/resources` URL). See `mcp/README.md`.
|
|
346
|
+
See `mcp/README.md` for details.
|
|
315
347
|
|
|
316
348
|
## Puppeteer / Chrome install
|
|
317
349
|
|