|
| 1 | +# Markmap MCP Server |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +[](https://www.npmjs.com/package/@jinzcdev/markmap-mcp-server) |
| 6 | +[](https://www.npmjs.com/package/@jinzcdev/markmap-mcp-server) |
| 7 | +[](README_zh-CN.md) |
| 8 | +[](https://github.com/jinzcdev/markmap-mcp-server) |
| 9 | + |
| 10 | +Markmap MCP Server is based on the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) that allows one-click conversion of Markdown text to interactive mind maps, built on the open source project [markmap](https://github.com/markmap/markmap). The generated mind maps support rich interactive operations and can be exported in various image formats. |
| 11 | + |
| 12 | +## Features |
| 13 | + |
| 14 | +- 🌠 **Markdown to Mind Map**: Convert Markdown text to interactive mind maps |
| 15 | +- 🖼️ **Multi-format Export**: Support for exporting as PNG, JPG, and SVG images |
| 16 | +- 🔄 **Interactive Operations**: Support for zooming, expanding/collapsing nodes, and other interactive features |
| 17 | +- 📋 **Markdown Copy**: One-click copy of the original Markdown content |
| 18 | +- 🌐 **Automatic Browser Preview**: Option to automatically open generated mind maps in the browser |
| 19 | + |
| 20 | +## Prerequisites |
| 21 | + |
| 22 | +1. Node.js runtime environment |
| 23 | + |
| 24 | +## Installation |
| 25 | + |
| 26 | +### Manual Installation |
| 27 | + |
| 28 | +```bash |
| 29 | +# Install from npm |
| 30 | +npm install @jinzcdev/markmap-mcp-server -g |
| 31 | + |
| 32 | +# Basic run |
| 33 | +npx -y @jinzcdev/markmap-mcp-server |
| 34 | + |
| 35 | +# Specify output directory |
| 36 | +npx -y @jinzcdev/markmap-mcp-server --output /path/to/output/directory |
| 37 | +``` |
| 38 | + |
| 39 | +Alternatively, you can clone the repository and run locally: |
| 40 | + |
| 41 | +```bash |
| 42 | +# Clone the repository |
| 43 | +git clone https://github.com/jinzcdev/markmap-mcp-server.git |
| 44 | + |
| 45 | +# Navigate to the project directory |
| 46 | +cd markmap-mcp-server |
| 47 | + |
| 48 | +# Build project |
| 49 | +npm install && npm run build |
| 50 | + |
| 51 | +# Run the server |
| 52 | +node build/index.js |
| 53 | +``` |
| 54 | + |
| 55 | +## Usage |
| 56 | + |
| 57 | +Add the following configuration to your MCP client configuration file: |
| 58 | + |
| 59 | +```json |
| 60 | +{ |
| 61 | + "mcpServers": { |
| 62 | + "markmap": { |
| 63 | + "type": "stdio", |
| 64 | + "command": "npx", |
| 65 | + "args": [ |
| 66 | + "-y", |
| 67 | + "@jinzcdev/markmap-mcp-server", |
| 68 | + "--output", |
| 69 | + "/path/to/output/directory" |
| 70 | + ] |
| 71 | + } |
| 72 | + } |
| 73 | +} |
| 74 | +``` |
| 75 | + |
| 76 | +> [!TIP] |
| 77 | +> |
| 78 | +> The service supports the following environment variables: |
| 79 | +> |
| 80 | +> - `MARKMAP_DIR`: Specify the output directory for mind maps (optional, defaults to system temp directory) |
| 81 | +> |
| 82 | +> **Priority Note**: |
| 83 | +> |
| 84 | +> When both the `--output` command line argument and the `MARKMAP_DIR` environment variable are specified, the command line argument takes precedence. |
| 85 | +
|
| 86 | +## Available Tools |
| 87 | + |
| 88 | +### markdown-to-mindmap |
| 89 | + |
| 90 | +Convert Markdown text into an interactive mind map. |
| 91 | + |
| 92 | +**Parameters:** |
| 93 | + |
| 94 | +- `markdown`: The Markdown content to convert (required string) |
| 95 | +- `open`: Whether to automatically open the generated mind map in the browser (optional boolean, default is false) |
| 96 | + |
| 97 | +**Return Value:** |
| 98 | + |
| 99 | +```json |
| 100 | +{ |
| 101 | + "content": [ |
| 102 | + { |
| 103 | + "type": "text", |
| 104 | + "text": "JSON_DATA_OF_MINDMAP_FILEPATH" |
| 105 | + } |
| 106 | + ] |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +## License |
| 111 | + |
| 112 | +This project is licensed under the MIT License. |
0 commit comments