markmap-mcp-server
v0.2.0MCP server for converting Markdown to interactive mind maps with Agent-friendly HTML/PNG/JPG/SVG export
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
markdown_to_mindmap
Convert structured Markdown (headings # and nested lists -) into an interactive mind map HTML file, with optional server-side PNG/JPG/SVG export. Use when the user wants a visual mind map/outline of structured content (architecture, plans, notes, hierarchies), or asks to visualize / mindmap / diagram. Do not use for flat unstructured text (restructure first), or to list/read existing outputs (use list_mindmaps / get_mindmap). Behavior: - WRITES files under the configured output dir. HTML is always written; image formats write an extra file. Reusing filename overwrites. - html is fast (<1s).…
| Parameter | Type | Description |
|---|---|---|
filename | string | Output base name only (no directories). Omit for markmap-<timestamp>. Custom names are prefixed with markmap- if needed so list/cleanup can find them. Same name overwrites. |
format | string | Output format (default: html). Use html for interactive viewing; png/jpg/svg when the agent or user needs an image (Playwright required). |
inputPath | string | Absolute path to a local .md file. Prefer over markdown when content is >1KB already on disk (saves tokens). Ignored when markdown is also provided. |
markdown | string | Full Markdown document string (not a file path). Prefer ATX headings (# ## ###) and nested lists. Provide this or inputPath (at least one required). If both are set, markdown wins. |
list_mindmaps
List markmap* files (html/png/jpg/jpeg/svg) in the output directory, newest first. Read-only — no side effects. Missing/empty dirs return {"files":[]}. Returns: {"outputDir","files":[{"name","filePath","size","mtimeMs","mtime"}]} (mtime is ISO 8601). Use before get_mindmap to discover paths, or before cleanup_mindmaps to preview targets. Not for generating new mind maps (use markdown_to_mindmap).
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max files to return (default: 20, max: 200). Newest files are kept when truncating. |
get_mindmap
Retrieve a generated mind map file by absolute path. Read-only — no side effects. Only paths inside the configured output directory are allowed (path traversal denied). Returns JSON {"filePath","mimeType","size"}. For text/html or image/svg+xml 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 the agent needs pixels. On error: isError:true with {"error":"Failed to retrieve mind map","message"}. Use list_mindmaps first to obtain a valid filePath. Prefer this over regenerating when the f…
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Absolute path from list_mindmaps (must stay inside the server output directory). |
cleanup_mindmaps
Permanently delete markmap* files from the output directory. DESTRUCTIVE and irreversible when dryRun is false. dryRun defaults to false — omitting it WILL delete. Always call once with dryRun=true to preview, then again with dryRun=false to commit. Prefer list_mindmaps beforehand. Returns {"deleted":["<path>",...],"kept":<n>}; dryRun responses also include dryRun:true and do not delete. Use instead of manual file deletion when pruning old generated mind maps.
| Parameter | Type | Description |
|---|---|---|
all | boolean | If true, delete every markmap* file in the output directory (ignores maxAgeDays). Default false. |
dryRun | boolean | If true, preview deletions without removing files. Default false (actually deletes). Prefer true on the first call. |
maxAgeDays | number | Delete files older than this many days (default: 7). Ignored when all=true. |