CherryTree MCP Server
CherryTree MCP Server
MCP 服务器,将 CherryTree .ctd(XML)文件的读写以 Claude Code 原生工具的形式暴露出来。
支持富文本、代码框、表格、图片、锚点和书签。所有写入操作都会自动进行逐字节审计,将备份与磁盘上生成的文件进行比对。
可用工具
读取
list_nodes— 列出树中的节点(含深度和面包屑导航)read_node— 读取节点内容(文本、格式、组件)search_nodes— 在所有节点中进行全文搜索list_bookmarks— 列出标记为收藏的节点
写入
create_node— 创建节点(纯文本或通过content_xml传入富 XML)create_node_with_codebox— 创建带代码框的节点(或通过content_xml传入富 XML)update_node_content— 替换或追加(纯文本或通过content_xml传入富 XML)append_codebox_to_node— 向现有节点添加代码框或富 XMLupdate_node_properties— 修改名称、标签、图标、颜色、只读属性delete_node— 删除节点及其子节点move_node— 将节点移动到另一个父节点下
书签
add_bookmark— 将节点添加到收藏remove_bookmark— 从收藏中移除节点
Related MCP server: notion-full-mcp
富文本(content_xml)
写入工具接受 content_xml 以实现完整的 CherryTree 格式:
<rich_text scale="h1" foreground="#00000000ffff" weight="heavy">Título</rich_text>
<rich_text>
Texto normal com </rich_text>
<rich_text weight="heavy">negrito</rich_text>
<rich_text> e </rich_text>
<rich_text style="italic">itálico</rich_text>
<rich_text foreground="#e66100" weight="heavy"> e laranja bold</rich_text>
<rich_text link="node 42">link interno</rich_text><rich_text> 支持的属性
属性 | 值 | 示例 |
|
| 粗体 |
|
|
|
|
| 高亮 |
|
| 斜体 |
|
| 下划线 |
|
| 删除线 |
|
| 标题 |
|
| 等宽字体 |
|
| 对齐 |
|
| 链接 |
|
| 缩进 |
组件(按 char_offset 定位)
组件在 char_offset 位置内联渲染(按各 <rich_text> 拼接文本中的字符数计数)。每个组件在缓冲区中恰好占用 1 个字符。
<codebox char_offset="42" justification="left" frame_width="700"
frame_height="200" width_in_pixels="1"
syntax_highlighting="python3" highlight_brackets="1"
show_line_numbers="0">print("hello")</codebox>
<table char_offset="100" col_min="40" col_max="400"
col_widths="200,200" is_light="0">
<row><cell>valor1</cell><cell>valor2</cell></row>
<row><cell>header1</cell><cell>header2</cell></row>
</table>
<encoded_png char_offset="50" anchor="nome_ancora"/>架构
读取使用
lxml进行 XML 解析/查询(安全,无写回)写入使用原始字符串操作,以避免
\r规范化破坏未编辑节点中的char_offset(lxml/ET序列化时的 bug)备份每次写入前自动创建
.ctd.bak审计每次写入后逐字节进行:从磁盘读取备份和新文件,比较前缀/后缀,识别被修改的节点,统计节点总数,验证 XML
审计格式
每次写入操作都会返回如下报告:
[AUDIT] readback 45,120,109 bytes: OK
delta: +252 bytes (45,119,857 -> 45,120,109)
change region: bak[45,119,844:45,119,844] -> disk[45,119,844:45,120,096]
prefix (45,119,844 bytes): OK
suffix (13 bytes): OK
nodes: 5304 (backup) -> 5305 (disco) [+1]
node adicionado: 6481 "Nome do Node" (alvo)
integridade: OK
XML parse: OK如果目标区域之外的任何字节在备份与磁盘之间不一致,报告将显示 CORRUPTED! 和 INTEGRITY FAILURE。
安装
1. 创建 virtualenv 并安装依赖
cd ~/cherrytree-mcp
python3 -m venv .venv
.venv/bin/pip install -e .2. 在 Claude Code 中配置 MCP
claude mcp add cherrytree -s user \
-e CHERRYTREE_FILE="/caminho/para/seu/arquivo.ctd" \
-- /caminho/para/cherrytree-mcp/.venv/bin/python \
/caminho/para/cherrytree-mcp/server.py3. 重启 Claude Code
工具会自动以 mcp__cherrytree__<tool_name> 的形式出现。
环境变量
变量 | 描述 |
| CherryTree |
要求
Python >= 3.11
CherryTree v1.x(
.ctdXML 格式,非.ctbSQLite)依赖:
mcp[cli]>=1.0.0、lxml>=5.0.0
限制
仅支持
.ctd(XML)格式。不支持.ctb(SQLite)文件。通过 MCP 编辑后,需要重新加载 CherryTree(关闭/打开或切换节点)才能在 UI 中反映更改。
在
update_node_content中使用append=False的写入操作会替换节点的全部内容(文本、代码框、图片、表格)。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that enables reading, writing, and searching documents in Outline via its API. It supports document management, full-text search, and collection organization using Markdown formatting.83817MIT
- AlicenseAqualityCmaintenanceFull-featured Notion MCP server enabling deep page reading, block editing, snapshot/restore, file uploads, table manipulation, page restore, and destructive page copying.33MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that provides read and write access to an Obsidian vault by interacting directly with markdown files on disk. Supports searching, listing, reading, creating, editing, and appending notes without requiring any Obsidian plugins.3,860ISC
- AlicenseNot gradedqualityDmaintenanceMCP server for mind-wiki — access your personal knowledge wiki from any directory or MCP-compatible client.MIT
Related MCP Connectors
MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lucaszarzur/cherrytree-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server