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 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)**: run `mcp/` server to expose Markdown conversion as MCP tools
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 server (Model Context Protocol)
287
+ ## MCP Server (Model Context Protocol)
288
288
 
289
- This repo includes an Express-based MCP server that exposes `md2x` as MCP tools over HTTP, so MCP clients can convert Markdown and download the generated HTML/PDF/DOCX from `/resources`.
289
+ The md2x CLI includes a built-in MCP server that exposes markdown conversion as MCP tools via stdio transport.
290
290
 
291
- Run:
291
+ ### Starting the MCP Server
292
292
 
293
293
  ```bash
294
- pnpm -C mcp install
295
- pnpm -C mcp start
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
- Endpoints:
333
+ See [MCP-SERVER.md](MCP-SERVER.md) for detailed documentation.
299
334
 
300
- - Streamable HTTP (recommended): `POST/GET/DELETE /mcp`
301
- - Legacy HTTP+SSE: `GET /sse` and `POST /messages?sessionId=...`
302
- - Resources (static files): `GET /resources/*`
335
+ ---
303
336
 
304
- Tools:
337
+ ## HTTP-based MCP Server (Separate Package)
305
338
 
306
- - `markdown_to_html` / `markdown_to_pdf` / `markdown_to_docx` - Convert Markdown to HTML/PDF/DOCX
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
- Notes:
341
+ ```bash
342
+ pnpm -C mcp install
343
+ pnpm -C mcp start
344
+ ```
312
345
 
313
- - The conversion tools return an MCP `resource_link` pointing to the generated file URL.
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