Mindlm Mcp

io.github.qingchejun由 GitHub 账号 qingchejun 发布v0.1.1更新于 Oct 24, 2026

Turn text, web pages and PDFs into interactive mind maps. MCP server + CLI, no API key.

概览

AI 生成的概览

本地 MCP 服务器兼命令行工具,可将文本、网页和 PDF 转成 Markdown 大纲和可离线打开的单文件 HTML 思维导图。

可以做什么
把已有的文本或 Markdown 整理成大纲,可设置层级深度、每节点子项数和语言,并可同时导出 HTML 文件(text_to_mindmap)。抓取 http(s) 网页,提取正文内容并生成大纲(url_to_mindmap)。读取本地 PDF,可用书签作为骨架并选择页码范围,再生成大纲(pdf_to_mindmap)。把 Markdown 大纲渲染成单个自包含的 HTML 思维导图,可设置工具栏、展开层级和是否覆盖(export_mindmap)。获取可复用的大纲提示词(mindmap_outline)。同一套流程也提供命令行版本,含 demo、text、url、pdf、export 和 doctor 命令。
适用场景
适合想把笔记、文章或论文快速变成可浏览的思维导图,又不想注册账号或配置 API 密钥,并希望得到一个可离线打开或分享的 HTML 文件的场景。client 模式让助手自己的模型在规则草稿基础上改写大纲,适合助手已经读过原文的工作流。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js。无需账号或 API 密钥,所有环境变量均为可选。仅当希望服务器自行调用模型时,才需要 ANTHROPIC_API_KEY 或 OPENAI_API_KEY;使用 OpenAI 兼容端点时还需 MINDMAP_LLM_MODEL,可选 OPENAI_BASE_URL。MINDMAP_OUTPUT_DIR 决定导出 HTML 的位置(默认 ./mindmaps)。仅在抓取指定网址或调用自己的模型端点时需要网络。
安装前请注意
url_to_mindmap 会抓取你指定的网页,导出工具会向磁盘写入 HTML 文件;export_mindmap 默认不覆盖已有文件,除非设置 overwrite。将 MINDMAP_ALLOW_PRIVATE_HOSTS 设为 true 会让抓取器访问本机和私有地址(包括云元数据地址),非必要请保持关闭。提供 ANTHROPIC_API_KEY 或 OPENAI_API_KEY 会把源文本发送给对应模型服务商,可能产生费用。纯 JavaScript 渲染的页面、扫描版 PDF 以及需要登录或付费的内容无法处理。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mindlm Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mindlm-mcp

Turn text, web pages and PDFs into interactive mind maps — an MCP server and a command-line tool, with no API key required.

[mindlm-mcp turning an outline into a mind map]

bash
npx -y mindlm-mcp demo

That renders a built-in example and opens it. One HTML file, no build step, no account, no key.

  • Three inputs. Plain text or Markdown, an http(s) page, or a local PDF.
  • Two outputs. A Markdown outline you can edit, and a standalone HTML mind map (markmap) that works offline — every script is inlined.
  • Zero keys. Over MCP the server hands your own model a draft plus the cleaned source text and lets it write the final outline. Set your own API key only if you want the server to call a model itself. See How the outline gets written.

Docs and a live demo: https://qingchejun.github.io/mindlm-io/ · Source: https://github.com/qingchejun/mindlm-io


Quick start

Every client runs the same command — npx -y mindlm-mcp serve — and needs no environment variables. MINDMAP_OUTPUT_DIR below is optional; it just decides where exported files land.

Claude Code

bash
claude mcp add mindlm -- npx -y mindlm-mcp serve

Scope it to one project with --scope project, and pass environment variables with -e:

bash
claude mcp add mindlm -e MINDMAP_OUTPUT_DIR=~/Documents/mindmaps -- npx -y mindlm-mcp serve

Check it with claude mcp list, or /mcp inside a session.

Claude Desktop

Add this to claude_desktop_config.json, then restart the app:

json
{  "mcpServers": {    "mindlm": {      "command": "npx",      "args": ["-y", "mindlm-mcp", "serve"],      "env": {        "MINDMAP_OUTPUT_DIR": "~/Documents/mindmaps"      }    }  }}
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Cursor

The same block goes in ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

json
{  "mcpServers": {    "mindlm": {      "command": "npx",      "args": ["-y", "mindlm-mcp", "serve"]    }  }}

Ready-to-copy versions of all three live in examples/configs/.

Then ask for a mind map in plain language — "make a mind map of this PDF", "map out https://example.com/article" — and the client picks the right tool.


Tools

Four tools, always advertised in this order. The three *_to_mindmap tools return a Markdown outline; export_mindmap turns an outline into an HTML file. Every result carries both a readable text block and structuredContent.

text_to_mindmap

Outline text or Markdown you already have — a draft, notes, a transcript, a pasted chapter.

FieldTypeNotes
textstring, requiredThe content to map. Capped by MINDMAP_MAX_INPUT_CHARS.
modeauto | client | llm | heuristicDefault auto.
titlestringRoot node title. Derived from the source if omitted.
maxDepthint 2–6Levels including the root. Default 4.
maxChildrenint 3–15Children kept per node. Default 8.
languagestringe.g. "English", "中文". Defaults to the source language.
exportbooleanAlso render an HTML file and return its path.
outputPathstringWhere that file goes.

Input:

json
{  "text": "# Tides\n\nSpring tides are the largest of the month.\n\n## Neap\n\nNeap tides are the smallest.\n"}

structuredContent (default auto mode with no API key, i.e. client mode):

json
{  "title": "Tides",  "markdown": "# Tides\n\n## Spring tides are the largest of the month.\n\n### Neap\n- Neap tides are the smallest.\n",  "mode": "client",  "stats": { "inputChars": 79, "nodes": 4, "depth": 4, "truncated": false },  "sourceText": "# Tides\n\nSpring tides are the largest of the month.\n\n## Neap\n\nNeap tides are the smallest.",  "instructions": "This is a DRAFT outline produced by a rule-based algorithm. …"}

With "mode": "heuristic" (or when an API key makes it "llm") the result is the same minus sourceText and instructions — the outline is final and ready to export.

url_to_mindmap

Fetch a page and outline its main content. Article text is extracted with Readability; navigation, footers and boilerplate are dropped. Page furniture goes too: reference markers ([1]), "[edit]" links, notes above the article, image captions, navigation boxes, and the trailing See also / References / Notes / Further reading / External links / Bibliography sections, which are link lists rather than content. A URL that serves a PDF is handed to the PDF pipeline automatically.

FieldTypeNotes
urlstring, requiredhttp(s) only. Private and loopback addresses are refused.
…plus every option from text_to_mindmap

Input:

json
{ "url": "https://example.com/tide-tables", "mode": "heuristic" }

structuredContent adds a source block describing where the text came from:

json
{  "title": "Tide tables",  "markdown": "# Tide tables\n\n## Spring tides …\n\n## Neap tides …\n",  "mode": "heuristic",  "stats": { "inputChars": 1042, "nodes": 9, "depth": 3, "truncated": false },  "source": {    "url": "https://example.com/tide-tables",    "finalUrl": "https://example.com/tide-tables",    "title": "Tide tables",    "siteName": "Example",    "fetchedAt": "2026-09-27T10:21:04.512Z",    "contentType": "text/html"  }}

pdf_to_mindmap

Read a local PDF, using its bookmarks as the skeleton when it has them. A PDF stores positioned lines rather than paragraphs, so the soft-wrapped lines of one paragraph are rejoined before sentences are split — otherwise a browser's "print to PDF" would yield nodes like "releases oxygen." instead of whole sentences.

FieldTypeNotes
pathstring, requiredPath to a local PDF. ~ is expanded.
pagesstring1-based selection: "1-20", "3", "1-5,9". All pages by default.
…plus every option from text_to_mindmap

Input:

json
{ "path": "~/papers/attention.pdf", "pages": "1-12", "mode": "heuristic" }

structuredContent:

json
{  "title": "mindlm-mcp PDF fixture",  "markdown": "# mindlm-mcp PDF fixture\n\n## 1. Introduction\n\n### Mind maps turn a wall of prose into something you can scan…\n",  "mode": "heuristic",  "stats": { "inputChars": 769, "nodes": 12, "depth": 4, "truncated": false },  "source": { "path": "/home/you/papers/attention.pdf", "totalPages": 3, "hasOutline": true }}

export_mindmap

Render a Markdown outline into a standalone HTML mind map. Call this after you (or your model) have written the outline. It will not overwrite an existing file unless you ask.

FieldTypeNotes
markdownstring, requiredOne # root, then ##/### and - bullets.
titlestringPage title. Defaults to the outline root.
outputPathstringFile, or a directory to generate a name in.
offlinebooleanInline every script. Default true.
toolbarbooleanZoom / fit / expand toolbar. Default true.
initialExpandLevelint −1–6Levels expanded on open; -1 expands everything.
colorFreezeLevelint 0–6Stop changing branch colour below this level.
maxWidthint 0–2000Maximum node width in pixels; 0 is unlimited.
overwritebooleanReplace the file if it exists. Default false.
returnHtmlbooleanInclude the whole document in the result. Default false.
brandingbooleanAdd a small "Made with mindlm-mcp" footer link. Default false.

Input:

json
{  "markdown": "# Tides\n\n## Spring\n\n- Sun and moon in line\n\n## Neap\n\n- At right angles\n"}

structuredContent:

json
{  "path": "/home/you/mindmaps/tides-20260927-183322.html",  "fileUrl": "file:///home/you/mindmaps/tides-20260927-183322.html",  "bytes": 344349,  "nodes": 5,  "offline": true}

Prompt

The server also exposes one prompt, mindmap_outline, which returns the outline rules (optionally in a given language) followed by an instruction to call export_mindmap.


Command line

The same pipeline without a client. With no arguments and no terminal attached, mindlm-mcp starts the MCP server — which is what an MCP client wants.

bash
mindlm-mcp demo                                   # render a built-in example and open itmindlm-mcp text notes.md -o notes.html            # a file, or "-" to read stdinmindlm-mcp url https://example.com/article --openmindlm-mcp pdf paper.pdf --pages 1-20mindlm-mcp export outline.md -o map.html          # an outline you wrote yourselfmindlm-mcp serve                                  # MCP server on stdiomindlm-mcp doctor                                 # runtime, LLM config, output directory
CommandWhat it does
serveStart the MCP server on stdio.
demoRender the built-in example (--no-open to skip the browser).
text <file>Outline a .txt/.md file, or - for stdin.
url <url>Fetch a page and outline its main content.
pdf <file>Outline a local PDF.
export <outline>Render an existing Markdown outline.
doctorReport what is configured and where files will be written.

Options on the conversion commands:

OptionMeaning
-o, --output <path>Write here. A .md path writes the outline, .html the mind map.
--title <title>Root node title and page title.
--mdPrint the Markdown outline to stdout.
--mode <auto|llm|heuristic>How the outline is written.
--depth <n> / --max-children <n>Shape of the tree.
--lang <language>Language for the node labels.
--provider <anthropic|openai> / --model <name>Override the LLM configuration.
--no-offlineLink CDN assets instead of inlining them.
--no-toolbarHide the mind map toolbar.
--openOpen the result in a browser.
--overwriteReplace the output file if it exists.
--brandingAdd the "Made with mindlm-mcp" footer link.
-q, --quietOnly print results, no progress.
--env-file <path>Load environment variables from a file first.

Results a script might consume (a file path, an outline) go to stdout; progress and diagnostics go to stderr. Exit codes: 0 ok, 1 usage error, 2 input error, 3 LLM error.

There is also a small programmatic API — textToOutline, urlToOutline, pdfToOutline, renderMindmapHtml, exportMindmap — exported from the package root.


How the outline gets written

Deciding what belongs in the tree is the hard part, and there are three ways to do it. You never have to supply a key for any of this to work.

ModeWhen it is usedWhat happens
clientMCP default with no keyThe server returns a rule-based draft, the cleaned source text and instructions. Your client's model — the one you are already talking to — rewrites the outline and calls export_mindmap. Nothing leaves your machine except what the client already sees.
heuristicCLI default with no keyRules only, no network: headings become branches, ranked sentences become leaves. Fast, deterministic, offline.
llmWhenever ANTHROPIC_API_KEY or OPENAI_API_KEY is setThe server calls that model itself, over plain fetch, using your key and your endpoint. Falls back to the heuristic draft if the call fails.

mode: "auto" (the default everywhere) picks the row that applies. You can always force one with mode over MCP or --mode on the CLI. Run mindlm-mcp doctor to see which one auto resolves to right now.

There is no hosted service behind any of this: no telemetry, no update check, no call home.

Configuration

Every variable is optional. Copy .env.example to .env and pass it explicitly with --env-file .env — nothing is loaded automatically — or set the variables in your MCP client's env block.

VariableDefaultMeaning
MINDMAP_OUTPUT_DIR./mindmapsWhere exported HTML files go. ~ is expanded.
MINDMAP_LLM_PROVIDERauto-detectedanthropic or openai. Inferred from whichever key is set.
ANTHROPIC_API_KEY—Switches auto to llm mode.
OPENAI_API_KEY—Same, for any OpenAI-compatible endpoint.
OPENAI_BASE_URLhttps://api.openai.com/v1The endpoint used with OPENAI_API_KEY.
MINDMAP_LLM_MODELclaude-sonnet-5-5 for AnthropicModel name. Required for OpenAI-compatible endpoints, where no name is portable.
MINDMAP_ALLOW_PRIVATE_HOSTSfalseLet url_to_mindmap reach localhost and private networks.
MINDMAP_MAX_INPUT_CHARS200000Hard cap on characters read from any one input.
MINDMAP_CLIENT_MAX_CHARS60000Cap on the source text returned in client mode.

The exported HTML

One file, openable with a double click. By default every script and stylesheet — d3, markmap-view, the toolbar — is inlined, so the map keeps working with no network, on a locked-down machine, or five years from now when a CDN has moved on. That costs about 340 KB per file; pass offline: false (--no-offline) if you would rather link the CDN copies.

The KaTeX and highlight.js markmap plugins are deliberately disabled: both pull stylesheets from a CDN, which would quietly break an "offline" export. Raw HTML in the outline is not rendered (markdown-it runs with html: false), so text extracted from a hostile page cannot inject script into the file you open.

Exports carry no attribution by default. --branding / branding: true adds one small footer line if you want it.

Limitations

  • JavaScript-only pages. url_to_mindmap reads the HTML the server sends. A single-page app that renders its content client-side will come back empty or nearly so — copy the text and use text_to_mindmap instead. There is no headless browser.
  • Scanned PDFs. A PDF needs a real text layer. Scans and image-only exports are rejected with a clear error; there is no OCR.
  • Long documents are truncated, not chunked, at MINDMAP_MAX_INPUT_CHARS. Use pages on a long PDF, or map it a section at a time.
  • The heuristic is a draft. It ranks sentences by position and term frequency. It is stable and fast, and it will sometimes pick the wrong sentence. That is exactly why client mode exists.
  • Paywalls, logins and robots. The fetcher sends no cookies and does not log in.

Security

  • SSRF guard. url_to_mindmap resolves the host first and refuses loopback, private, link-local (including the 169.254.169.254 cloud metadata address), CGNAT and multicast ranges unless you set MINDMAP_ALLOW_PRIVATE_HOSTS=true. Only http: and https: are accepted.
  • Limits. 5 MB per fetched response, a 15 s timeout, at most 5 redirects, 50 MB / 300 pages per PDF, and a character cap on every input.
  • No telemetry, no update check, no hosted backend. The only network calls are the URL you ask for and — if you configured a key — your own LLM endpoint.
  • No raw HTML in exports, and inlined JSON has </script> escaped.
  • Reporting a vulnerability, and the known DNS-rebinding caveat: SECURITY.md.

Launch materials and directory listings

This section is a placeholder owned by the outreach lead. Announcement copy, awesome-list entries and MCP directory submissions (mcp.so, Glama, Smithery, PulseMCP, the official MCP Registry) are tracked in docs/launch.md and are intentionally empty here.

Contributing

Issues and pull requests are welcome — see CONTRIBUTING.md. Requires Node ≥ 22.12.

bash
npm ci && npm run lint && npm run typecheck && npm test && npm run build

Want a full editor?

mindlm-mcp is deliberately small: outline in, one HTML file out. If you want to keep editing the map afterwards — drag nodes around, restyle branches, collaborate, keep a library of maps — that is what mindlm.io is for. This package works completely on its own and never talks to it.

License

MIT © 2026 青澈君

来源:README.md,提交 92dd57b

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Oct 15, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分