SuperAPIAI Directory

markmap-mcp-server

github.com · AI developer platforms

Convert Markdown into interactive markmap mind maps with PNG/JPG/SVG export and live browser preview.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Purpose

Markmap MCP Server is a server-side tool based on the Model Context Protocol (MCP), used to convert Markdown text into interactive mind maps. It uses the markmap rendering engine to parse headings and nested lists in Markdown into visualized mind maps, and can export PNG, JPG, and SVG images on the server side according to configuration, making it easy for Agents to directly consume and pass on.

Main Capabilities

  • Markdown to Mind Map: Convert Markdown containing headings and nested lists into an interactive HTML mind map.
  • Agent-friendly return methods: Can return file paths, inline HTML, and/or image content, determined by the configuration at startup.
  • Server-side export: Export PNG / JPG / SVG on the server side via Playwright, making it convenient for preview in chat or inline.
  • Browser preview: The opening behavior can be configured, supporting always, never, or agent (decided by the Agent); this option is set when the server starts.
  • Browser export toolbar: When viewing HTML, you can directly export PNG/JPG/SVG or copy Markdown in the page UI.
  • Offline HTML: Adding --offline parameter at startup inlines resources, so the page works without CDN access.
  • File workflow: Supports reading files from inputPath, listing recently generated outputs, and cleaning up old files.
  • Privacy first: Fully local conversion, no cloud mind map API is used.

Usage

Environment Requirements

  • Node.js v20 or later.
  • For server-side image export (format: png|jpg|svg), Playwright and Chromium need to be installed. Playwright is an optional dependency of this package.

Configure the MCP Client

Add the corresponding configuration in an MCP client (such as Cursor / Claude Desktop, etc.). You can also clone the repository and run it locally.

Server Preferences (via CLI or environment variables)

These settings need to be determined when the server starts, rather than being passed in as tool parameters:

  • CLI flags override environment variables.--output overrides MARKMAP_DIR。
  • --open: using --open alone means always. You can also pass --open always|never|agent. Invalid values will cause an error and exit. If this flag is not passed, the environment variable MARKMAP_OPENis used (default value is never).
  • The generated HTML always includes the markmap toolbar, English export labels, and fully expanded nodes.

Available Tools

markdown_to_mindmap

Convert Markdown into an interactive mind map, and optionally generate images. The returned content differs according to returnMode:

  • returnMode=path: For image formats, filePath is the image path, and htmlFilePath is still the HTML source file path.
  • returnMode=content: Return the raw HTML text block, or for png/jpg/svg return an MCP image content block (base64), without returning path JSON. HTML larger than 200KB falls back to path JSON.
  • returnMode=both: Return path JSON plus the inline content described above.

Note: Interactive zoom/collapse and the in-page "Export PNG/JPG/SVG" button are features of the HTML viewer. The server-side format parameter (png|jpg|svg) is a format that the Agent can directly consume, without manually clicking in the browser.

Other Tools

  • List recently generated files in the output directory (newest first). Only includes files whose names start with markmap. Returns {outputDir, files: [{name, filePath, size, mtimeMs, mtime}]}.
  • Retrieve generated mind map files by absolute path. The path must be within the configured output directory; path traversal is prohibited. Returns JSON {filePath, mimeType, size}. For HTML/SVG smaller than 200KB, a text content block is also attached. PNG/JPG returns only metadata (without an image block); if you need pixel content, re-export via markdown_to_mindmap with format=png|jpg.
  • cleanup_mindmaps: Delete old (or all) generated mind map files.
  • Prompt mindmap_from_content: A helper prompt that asks the model to organize notes into Markdown, then call markdown_to_mindmap.

Example Prompts

  • "Summarize this design document into a mind map."
  • "Convert ./notes/architecture.md into a mind map."
  • "Generate a PNG mind map of this outline for chat."

Use Cases

  • Quickly convert Markdown notes, document outlines, design documents, etc. into visualized mind maps within an Agent or chatbot workflow.
  • Need to display a mind map directly in a conversation as an image, without manually opening a browser to operate.
  • Scenarios with privacy requirements, where fully local conversion is desired without calling cloud APIs.

Limitations

  • Requires Node.js v20 or above.
  • Server-side image export depends on Playwright and Chromium.
  • Settings such as preview open behavior and output method must be determined at server startup and cannot be changed dynamically as tool call parameters.
  • When retrieving files, paths must be within the configured output directory; path traversal is not allowed.
  • Retrieval of PNG/JPG returns only metadata, without an image block.
  • This project is based on the MIT License.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools