{"_id":"@jinzcdev/markmap-mcp-server","_rev":"3-96bb407a1dffee71c4e07afa16e53842","name":"@jinzcdev/markmap-mcp-server","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@jinzcdev/markmap-mcp-server","version":"0.1.0","keywords":["markmap","mindmap","mindnode","xmind","mcp"],"author":{"name":"jinzcdev"},"license":"MIT","_id":"@jinzcdev/markmap-mcp-server@0.1.0","maintainers":[{"name":"jinzcdev","email":"jinzcdev@gmail.com"}],"homepage":"https://github.com/jinzcdev/markmap-mcp-server#readme","bugs":{"url":"https://github.com/jinzcdev/markmap-mcp-server/issues"},"bin":{"markmap-mcp-server":"build/index.js"},"dist":{"shasum":"c58a7de6d99d37a59f91488184ac8ac163b80d55","tarball":"https://registry.npmjs.org/@jinzcdev/markmap-mcp-server/-/markmap-mcp-server-0.1.0.tgz","fileCount":24,"integrity":"sha512-qlYtg8sehgLJRNF4TWKb21k7REddiq5y8/JcJMwqHMt1TgX5kNytObZSA2DLRAlw0tkPGvcbNaCkXts1JbGOsg==","signatures":[{"sig":"MEUCID36Z/9Ew/yiGZkkGzLvwRSQuNT130hjwjQ40jXXiVoUAiEA0hmxQOBZObnb07Ons7iYp5LGjxaoa6wH4/jIKaNIcns=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@jinzcdev%2fmarkmap-mcp-server@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31219},"main":"./build/index.js","type":"module","types":"./build/index.d.ts","gitHead":"a8b074f90a4d13dc82c2ca0f67a2fdd8b61a7679","scripts":{"dev":"tsc-watch --onSuccess \"node build/index.js\" | pino-pretty","test":"vitest run | pino-pretty","build":"tsc && chmod u+x build/index.js","start":"node build/index.js","format":"prettier --write . --ignore-path .gitignore","prepare":"husky","test:watch":"vitest watch"},"_npmUser":{"name":"jinzcdev","email":"jinzcdev@gmail.com"},"repository":{"url":"git+https://github.com/jinzcdev/markmap-mcp-server.git","type":"git"},"_npmVersion":"10.8.2","description":"MCP server for converting Markdown to interactive mind maps with export support (PNG/JPG/SVG)","directories":{},"lint-staged":{"*.{js,ts,jsx,tsx}":["prettier --write","eslint --fix"],"*.{md,json,yml,yaml,html,css}":["prettier --write"]},"_nodeVersion":"20.19.1","dependencies":{"zod":"^3.24.2","open":"^10.1.0","pino":"^9.6.0","minimist":"^1.2.8","markmap-cli":"^0.18.11","@modelcontextprotocol/sdk":"^1.8.0"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^9.24.0","vitest":"^3.1.1","esbuild":"^0.25.2","globals":"^16.0.0","prettier":"^3.5.3","tsc-watch":"6.2.1","@eslint/js":"^9.24.0","typescript":"^5.8.3","@types/node":"^22.14.0","lint-staged":"^15.5.1","pino-pretty":"^13.0.0","@types/minimist":"^1.2.5","typescript-eslint":"^8.29.1","eslint-config-prettier":"^10.1.2","eslint-plugin-prettier":"^5.2.6","prettier-plugin-organize-imports":"^4.1.0"},"optionalDependencies":{"@rollup/rollup-linux-x64-gnu":"^4.40.0"},"_npmOperationalInternal":{"tmp":"tmp/markmap-mcp-server_0.1.0_1746461242831_0.18308763669597727","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@jinzcdev/markmap-mcp-server","version":"0.1.1","keywords":["markmap","mindmap","mindnode","xmind","mcp"],"author":{"name":"jinzcdev"},"license":"MIT","_id":"@jinzcdev/markmap-mcp-server@0.1.1","maintainers":[{"name":"jinzcdev","email":"jinzcdev@gmail.com"}],"homepage":"https://github.com/jinzcdev/markmap-mcp-server#readme","bugs":{"url":"https://github.com/jinzcdev/markmap-mcp-server/issues"},"bin":{"markmap-mcp-server":"build/index.js"},"dist":{"shasum":"4af0431e07ccb786914acd7b538de38b5c94068a","tarball":"https://registry.npmjs.org/@jinzcdev/markmap-mcp-server/-/markmap-mcp-server-0.1.1.tgz","fileCount":24,"integrity":"sha512-gauJUPp+1RbuSaK8iTh+KQYZ22yxJDKBRMChTflV+YjW7Ke47kFl51QJYQh6yssTu3klj1g9CAanpLU+shU8wg==","signatures":[{"sig":"MEUCIQCuxW1NCnHuLvkmUZv4KAUrQltoJ1tQ27ZNeHWl+l6QrgIgBzcy1WGJGpTyzvWhlq3aHT6qfn1c+VcHVv+O46XIlIc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@jinzcdev%2fmarkmap-mcp-server@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":30578},"main":"./build/index.js","type":"module","types":"./build/index.d.ts","gitHead":"4a9e1d76a834da8236ea411bc82a7a95b1261f66","scripts":{"dev":"tsc-watch --onSuccess \"node build/index.js\" | pino-pretty","test":"vitest run | pino-pretty","build":"tsc && chmod u+x build/index.js","start":"node build/index.js","format":"prettier --write . --ignore-path .gitignore","prepare":"husky","test:watch":"vitest watch"},"_npmUser":{"name":"jinzcdev","email":"jinzcdev@gmail.com"},"repository":{"url":"git+https://github.com/jinzcdev/markmap-mcp-server.git","type":"git"},"_npmVersion":"10.8.2","description":"MCP server for converting Markdown to interactive mind maps with export support (PNG/JPG/SVG)","directories":{},"lint-staged":{"*.{js,ts,jsx,tsx}":["prettier --write","eslint --fix"],"*.{md,json,yml,yaml,html,css}":["prettier --write"]},"_nodeVersion":"20.19.1","dependencies":{"zod":"^3.24.2","open":"^10.1.0","pino":"^9.6.0","minimist":"^1.2.8","markmap-cli":"^0.18.11","@modelcontextprotocol/sdk":"^1.8.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.3.5","husky":"^9.1.7","eslint":"^9.24.0","vitest":"^3.1.3","esbuild":"^0.25.2","globals":"^16.0.0","prettier":"^3.5.3","tsc-watch":"6.2.1","@eslint/js":"^9.24.0","typescript":"^5.8.3","@types/node":"^22.14.0","lint-staged":"^15.5.1","pino-pretty":"^13.0.0","@types/minimist":"^1.2.5","typescript-eslint":"^8.29.1","eslint-config-prettier":"^10.1.2","eslint-plugin-prettier":"^5.2.6","prettier-plugin-organize-imports":"^4.1.0"},"optionalDependencies":{"@rollup/rollup-linux-x64-gnu":"^4.40.1"},"_npmOperationalInternal":{"tmp":"tmp/markmap-mcp-server_0.1.1_1746518254595_0.767990973490519","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@jinzcdev/markmap-mcp-server","description":"MCP server for converting Markdown to interactive mind maps with Agent-friendly HTML/PNG/JPG/SVG export","version":"0.2.0","author":{"name":"jinzcdev"},"main":"./build/index.js","engines":{"node":">=20"},"keywords":["markmap","mindmap","mindnode","xmind","mcp"],"scripts":{"test":"vitest run | pino-pretty","test:watch":"vitest watch","build":"tsc && chmod u+x build/index.js","start":"node build/index.js","dev":"tsc-watch --onSuccess \"node build/index.js\" | pino-pretty","format":"prettier --write . --ignore-path .gitignore","prepare":"husky"},"bin":{"markmap-mcp-server":"build/index.js"},"type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jinzcdev/markmap-mcp-server.git"},"lint-staged":{"*.{js,ts,jsx,tsx}":["prettier --write","eslint --fix"],"*.{md,json,yml,yaml,html,css}":["prettier --write"]},"dependencies":{"@modelcontextprotocol/sdk":"^1.8.0","html-to-image":"^1.11.13","markmap-cli":"^0.18.11","markmap-common":"0.18.9","markmap-lib":"0.18.11","markmap-render":"0.18.10","minimist":"^1.2.8","open":"^10.1.0","pino":"^9.6.0","zod":"^4.4.3"},"devDependencies":{"@eslint/js":"^9.24.0","@types/minimist":"^1.2.5","@types/node":"^22.14.0","esbuild":"^0.25.2","eslint":"^9.24.0","eslint-config-prettier":"^10.1.2","eslint-plugin-prettier":"^5.2.6","globals":"^16.0.0","husky":"^9.1.7","lint-staged":"^15.5.1","pino-pretty":"^13.0.0","playwright":"^1.61.1","prettier":"^3.5.3","prettier-plugin-organize-imports":"^4.1.0","tsc-watch":"6.2.1","typescript":"^5.8.3","typescript-eslint":"^8.29.1","vite":"^6.3.5","vitest":"^3.2.6"},"optionalDependencies":{"@rollup/rollup-linux-x64-gnu":"^4.62.2","playwright":"^1.61.1"},"gitHead":"13d87510457bb710a9f88c9611f6a6a5eba8c29d","types":"./build/index.d.ts","_id":"@jinzcdev/markmap-mcp-server@0.2.0","bugs":{"url":"https://github.com/jinzcdev/markmap-mcp-server/issues"},"homepage":"https://github.com/jinzcdev/markmap-mcp-server#readme","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-Wz7h647qwq6vUhEAmkWQ9fcYDTITZzf+zRFi0sM+R7X2Q7K/KgTHvQkkIqNtmcps8UroR0zk/2GhfUGfS40eag==","shasum":"2ac138a16c4fb43ca590347754b0e9abef3c3f57","tarball":"https://registry.npmjs.org/@jinzcdev/markmap-mcp-server/-/markmap-mcp-server-0.2.0.tgz","fileCount":36,"unpackedSize":92163,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@jinzcdev%2fmarkmap-mcp-server@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICEhJv5NQRTZE0BTVoFGQ+F6rrFSzWWD7Ss5sXB/8VMSAiAaKB9EjLoTIy2eFM4Cbbf2C+iO4N0e3yk3JGlBmmLt3A=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a7380255-d6a5-42f4-b8c5-9bf0b345fa2b"}},"directories":{},"maintainers":[{"name":"jinzcdev","email":"jinzcdev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markmap-mcp-server_0.2.0_1785839838961_0.1813051721780592"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-05T16:07:22.746Z","modified":"2026-08-04T10:37:19.440Z","0.1.0":"2025-05-05T16:07:23.029Z","0.1.1":"2025-05-06T07:57:34.778Z","0.2.0":"2026-08-04T10:37:19.096Z"},"bugs":{"url":"https://github.com/jinzcdev/markmap-mcp-server/issues"},"author":{"name":"jinzcdev"},"license":"MIT","homepage":"https://github.com/jinzcdev/markmap-mcp-server#readme","keywords":["markmap","mindmap","mindnode","xmind","mcp"],"repository":{"type":"git","url":"git+https://github.com/jinzcdev/markmap-mcp-server.git"},"description":"MCP server for converting Markdown to interactive mind maps with Agent-friendly HTML/PNG/JPG/SVG export","maintainers":[{"name":"jinzcdev","email":"jinzcdev@gmail.com"}],"readme":"# Markmap MCP Server\n\n![Sample Mindmap](./docs/markmap.svg)\n\n[![NPM Version](https://img.shields.io/npm/v/@jinzcdev/markmap-mcp-server.svg)](https://www.npmjs.com/package/@jinzcdev/markmap-mcp-server)\n[![NPM Downloads](https://img.shields.io/npm/dm/@jinzcdev/markmap-mcp-server.svg)](https://www.npmjs.com/package/@jinzcdev/markmap-mcp-server)\n[![GitHub License](https://img.shields.io/github/license/jinzcdev/markmap-mcp-server.svg)](LICENSE)\n[![中文文档](https://img.shields.io/badge/简体中文-查看-blue)](README_zh-CN.md)\n[![Stars](https://img.shields.io/github/stars/jinzcdev/markmap-mcp-server)](https://github.com/jinzcdev/markmap-mcp-server)\n\nMarkmap MCP Server is based on the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction). It converts Markdown into interactive mind maps using [markmap](https://github.com/markmap/markmap), and can optionally export **PNG / JPG / SVG on the server** for Agent-friendly delivery. Generation runs **locally** — no third-party API keys required.\n\n## Features\n\n- **Markdown → Mind Map**: Convert Markdown (headings + nested lists) to interactive HTML mind maps\n- **Agent-friendly returns**: Return a file path, inline HTML, and/or image content (configured at startup)\n- **Server-side export**: Export PNG / JPG / SVG via Playwright for chat/inline preview\n- **Browser preview**: Configurable open behavior — always, never, or agent-decided (startup setting)\n- **Browser export toolbar**: When viewing HTML, also export PNG/JPG/SVG or copy Markdown in the page UI\n- **Offline HTML**: Startup `--offline` inlines assets so the page works without CDN access\n- **File workflows**: Read from `inputPath`, list recent outputs, clean up old files\n- **Privacy-first**: Fully local conversion; no cloud mind-map API\n\n## Prerequisites\n\n1. Node.js **v20 or above**\n2. For **server-side image export** (`format: png|jpg|svg`): install Playwright and Chromium\n\n```bash\nnpm install playwright\nnpx playwright install chromium\n```\n\n(`playwright` is an optional dependency of this package.)\n\n## Installation\n\n```bash\n# Install from npm\nnpm install @jinzcdev/markmap-mcp-server -g\n\n# Basic run\nnpx -y @jinzcdev/markmap-mcp-server\n\n# Specify output directory and auto-open in browser\nnpx -y @jinzcdev/markmap-mcp-server --output /path/to/output/directory --open always\n```\n\n### Docker\n\n```bash\ndocker build -t markmap-mcp-server .\ndocker run --rm -i \\\n  -v /path/to/output:/data/markmap \\\n  -e MARKMAP_DIR=/data/markmap \\\n  markmap-mcp-server\n```\n\nOr clone and run locally:\n\n```bash\ngit clone https://github.com/jinzcdev/markmap-mcp-server.git\ncd markmap-mcp-server\nnpm install && npm run build\n# Optional: enable server-side image export\nnpx playwright install chromium\nnode build/index.js\n```\n\n## Usage\n\nAdd the following configuration to your MCP client (Cursor / Claude Desktop / etc.):\n\n```json\n{\n  \"mcpServers\": {\n    \"markmap\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@jinzcdev/markmap-mcp-server\"],\n      \"env\": {\n        \"MARKMAP_DIR\": \"/path/to/output/directory\",\n        \"MARKMAP_OPEN\": \"never\",\n        \"MARKMAP_RETURN_MODE\": \"path\"\n      }\n    }\n  }\n}\n```\n\n### Server preferences (CLI / env)\n\nThese are decided when the server starts — **not** tool arguments:\n\n| Preference       | CLI               | Env                   | Values                                                    | Default          |\n| ---------------- | ----------------- | --------------------- | --------------------------------------------------------- | ---------------- |\n| Output directory | `--output` / `-o` | `MARKMAP_DIR`         | any directory path                                        | `~/.markmap-mcp` |\n| Open in browser  | `--open [mode]`   | `MARKMAP_OPEN`        | `always` \\| `never` \\| `agent` (bare `--open` = `always`) | `never`          |\n| Return mode      | `--return-mode`   | `MARKMAP_RETURN_MODE` | `path` \\| `content` \\| `both`                             | `path`           |\n| Offline HTML     | `--offline`       | `MARKMAP_OFFLINE`     | `true` \\| `false` (CLI: pass `--offline` to enable)       | `false`          |\n\nCLI flags override environment variables. `--output` overrides `MARKMAP_DIR`.\n\n**`--open`:** bare `--open` means `always`. You may also pass `--open always|never|agent`. An invalid value exits with an error. Without the flag, `MARKMAP_OPEN` is used (default `never`).\n\n**Return mode:**\n\n| Mode      | Meaning                                                                 |\n| --------- | ----------------------------------------------------------------------- |\n| `path`    | Paths JSON only (`htmlFilePath` + `filePath`)                           |\n| `content` | Inline content only (raw HTML text, or a base64 image block) — no paths |\n| `both`    | Paths JSON plus inline content                                          |\n\nGenerated HTML always includes the markmap toolbar, English export labels, and fully expanded nodes.\n\n### Example prompts\n\n- “Summarize this design doc as a mind map.”\n- “Convert `./notes/architecture.md` to a mind map.”\n- “Generate a PNG mind map of this outline for the chat.”\n\n## Available Tools\n\n### `markdown_to_mindmap`\n\nConvert Markdown into an interactive mind map (and optionally an image).\n\n| Parameter   | Type                              | Default | Description                                                                                                                       |\n| ----------- | --------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| `markdown`  | string                            | —       | Markdown content (required unless `inputPath` is set). Wins when both are provided.                                               |\n| `inputPath` | string                            | —       | Absolute path to a local `.md` file                                                                                               |\n| `format`    | `html` \\| `png` \\| `svg` \\| `jpg` | `html`  | Output format. Image formats need Playwright                                                                                      |\n| `filename`  | string                            | auto    | Output base name (sanitized; prefixed with `markmap-` if needed; reusing overwrites)                                              |\n| `open`      | boolean                           | `false` | Whether to open the result in browser. **Only exposed when server open mode is `agent`** (`--open agent` / `MARKMAP_OPEN=agent`). |\n\n**Return (`returnMode=path`):**\n\n```json\n{\n  \"htmlFilePath\": \"/path/to/markmap-….html\",\n  \"filePath\": \"/path/to/markmap-….html\"\n}\n```\n\nFor image formats, `filePath` is the image path and `htmlFilePath` is still the HTML source.\n\n**Return (`returnMode=content`):** Raw HTML text block, or an MCP `image` content block (base64) for png/jpg/svg — no paths JSON. Oversized HTML (≥200KB) falls back to paths JSON.\n\n**Return (`returnMode=both`):** Paths JSON plus the inline content above.\n\n> **Note:** Interactive zoom/collapse and the in-page “Export PNG/JPG/SVG” buttons are part of the **HTML viewer**. Server-side `format: png|jpg|svg` is what Agents can consume directly without a manual browser click.\n\n### `list_mindmaps`\n\nList recent generated files in the output directory (newest first). Only files whose names start with `markmap` are included.\n\n| Parameter | Type   | Default | Description                 |\n| --------- | ------ | ------- | --------------------------- |\n| `limit`   | number | `20`    | Max files to return (1–200) |\n\nReturns `{outputDir, files: [{name, filePath, size, mtimeMs, mtime}]}`.\n\n### `get_mindmap`\n\nRetrieve a generated mind map file by its absolute path. Path must stay inside the configured output directory (path traversal denied).\n\n| Parameter  | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| `filePath` | string | —       | Absolute path to the mind map file (HTML or image) |\n\nReturns JSON `{filePath, mimeType, size}`. For HTML/SVG under 200KB, also appends a text content block. PNG/JPG return metadata only (no image block) — re-export via `markdown_to_mindmap` with `format=png\\|jpg` if pixels are needed.\n\n### `cleanup_mindmaps`\n\nDelete old (or all) generated mind map files.\n\n| Parameter    | Type    | Default | Description                            |\n| ------------ | ------- | ------- | -------------------------------------- |\n| `maxAgeDays` | number  | `7`     | Delete files older than this many days |\n| `all`        | boolean | `false` | If true, delete all markmap files      |\n| `dryRun`     | boolean | `false` | If true, preview without deleting      |\n\n### Prompt: `mindmap_from_content`\n\nHelper prompt that asks the model to structure notes as Markdown, then call `markdown_to_mindmap`.\n\n| Parameter | Type   | Default | Description                             |\n| --------- | ------ | ------- | --------------------------------------- |\n| `topic`   | string | —       | Topic or raw notes to organize as a map |\n\n## Related Projects\n\n| Project                                                                         | Description                                                                        |\n| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |\n| **[MarkXMind Online](https://github.com/jinzcdev/markxmind)**                   | Create XMind mind maps with Markdown online. [Try it →](https://markxmind.js.org/) |\n| **[Obsidian MarkXMind Plugin](https://github.com/jinzcdev/obsidian-markxmind)** | Render XMindMark syntax as XMind mind maps inside Obsidian.                        |\n\n## License\n\nThis project is licensed under the [MIT](./LICENSE) License.\n","readmeFilename":"README.md"}