xmind-mcp-server: Instructions file for Codex

AGENTS.md

xmind-mcp-server AGENTS.md is an instructions file for Codex, OpenCode from GarryWhite109909/xmind-mcp-server. It costs 1,598 tokens per session, scanned A, original, MIT.

Repository instructions for developing the xmind-mcp-server, a local service that lets an AI client read and edit XMind files. They cover setup, tests, code checks, startup commands, project folders, and rules such as not adding OCR or model inference.

In plain words
What is it for?
Use them when installing the project, running tests or lint checks, starting the MCP server, locating its components, or checking release requirements.
Why use it?
They give contributors and coding agents one place to find the project's required commands and boundaries. This reduces setup mistakes and changes that conflict with the design.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is GarryWhite109909/xmind-mcp-server's own configuration. It tells Codex and OpenCode how to work on xmind-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything xmind-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to GarryWhite109909/xmind-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/GarryWhite109909/xmind-mcp-server/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/GarryWhite109909/xmind-mcp-server

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xmind-mcp-server AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/garrywhite109909/xmind-mcp-server/agents-md/github.svg)](https://agentmods.dev/instructions/garrywhite109909/xmind-mcp-server/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/garrywhite109909/xmind-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/garrywhite109909/xmind-mcp-server/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for xmind-mcp-server AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/garrywhite109909/xmind-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/garrywhite109909/xmind-mcp-server/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,598 This file is loaded in full into every session.
When invoked 1,598 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01598 $0.01598
Opus 5.5 $0.00639 $0.00639
Sonnet 5.5 $0.00320 $0.00320
Haiku 4.5 $0.00160 $0.00160

Measured yesterday against content hash 8f506cae3a90, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

xmind-mcp-server AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

XMind MCP Server — 项目规则

本地 MCP Server:解析 / 编辑 / 写回 XMind(JSON 格式),把节点图片作为 ImageContent 直接交给多模态模型。不包含 OCR,也不要重新引入 OCR、 模型推理、GPU 检测或启动时 pip 安装。

常用命令

# 创建环境并安装(开发)
python -m venv .venv
.venv/Scripts/python.exe -m pip install -e ".[dev]"   # Windows
# .venv/bin/python -m pip install -e ".[dev]"         # POSIX

# 跑测试(已有 .venv 时)
.venv/Scripts/python.exe -m pytest -q
# .venv/bin/python -m pytest -q

# 静态检查
.venv/Scripts/ruff.exe check src tests
# ruff check src tests

# 启动(stdio,给 MCP 客户端用)
xmind-mcp
xmind-mcp --info
xmind-mcp --toolset read

# 可选:用 XMind 官方 CLI 校验生成的结构(需要先登录)
xmind validate path/to/file.xmind

发布前至少跑:ruff check src tests 和 pytest -q。测试不允许联网、不允许依赖真实 XMind 安装。

目录地图

路径 职责
src/xmind_mcp/tool_schemas.py 工具 schema、分组(TOOLSETS)、只读/破坏性标注
src/xmind_mcp/tools.py 工具 handler、文件缓存、树格式化、SVG 导出
src/xmind_mcp/markdown_import.py Markdown → XMind 大纲解析与公式注入
src/xmind_mcp/xmind_parser.py 解析 zip / content.json,节点树与 ID 索引
src/xmind_mcp/xmind_writer.py 修改 raw_content、保存(备份 / 冲突检测 / 原子写)
src/xmind_mcp/xmind_props.py 中文样式名 → XMind 内部值的映射与校验
src/xmind_mcp/render.py 自绘 PNG 预览
src/xmind_mcp/formula.py Markdown 块级公式 → PNG
src/xmind_mcp/image_payload.py 图片缩放 / JPEG / base64 负载
src/xmind_mcp/config.py ~/.xmind-mcp/config.json
src/xmind_mcp/cli.py 启动、--info、--uninstall
src/xmind_mcp/server.py MCP stdio 握手与 tools/list、tools/call
tests/ pytest;test_golden.py 守住官方文件结构

硬约定

  1. 所有写操作走 XMindWriter。 不要直接重写 zip;save() 负责备份、 跨进程冲突检测、清理过期缩略图、原子替换。
  2. 改完 raw_content 必须调用 xm.refresh_from_raw()。 节点树和 find_topic 的 ID 索引都由它重建;漏调用会让后续查询看到旧树。
  3. 保存前不要绕过冲突检测。 覆盖原文件时若磁盘摘要与 xm.source_digest 不同,必须抛 FileChangedError,让调用方另存。
  4. 工具要在五处登记: tool_schemas.py 的 build_tool_list()、TOOLSETS、 _READ_ONLY_TOOLS(只读工具)、_DESTRUCTIVE_TOOLS(会删/覆盖的工具), 以及 tools.py 的 XMindTools._handlers。 test_every_listed_tool_has_handler 会抓漂移;工具总数变化时同步 test_server.py 和 README。
  5. 路径参数一律以 _path 结尾。 _guard_paths 只校验这个后缀; 新工具如果叫 file / target 会绕过 allowed_roots。
  6. 图片只走 types.ImageContent。 统一用 prepare_image() 缩放、转 JPEG、 控制体积;不要在工具里直接返回原始 base64。
  7. 版本号两处同步: pyproject.toml 与 src/xmind_mcp/__init__.py。
  8. 配置向后兼容: Config.load() 忽略不认识的字段,旧的 image_mode=ocr/both 归一化为 inline;不要因为旧配置报错。
  9. 用户数据默认保留: 备份目录 ~/.xmind-mcp/backups/ 不随卸载删除; 删除/覆盖用户文件前先备份,并在返回文案里说明。
  10. 对外文案用中文,标识符用英文。 工具描述要告诉模型“什么时候用、 参数收什么”,不要写营销句。

Read the full file on GitHub · 103 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 103 lines · 1,598 tokens per session scan A 8f506cae3a90

Subscribe to this mod's changes

xmind-mcp-server AGENTS.md is an instructions file published in the GitHub repository GarryWhite109909/xmind-mcp-server (0 stars, last pushed 2d ago), licensed MIT. It adds 1,598 tokens to every session, about $0.0064 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-09.

Related

xmind-mcp-server AGENTS.md compared with instructions from other repositories

xmind-mcp-server AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
xmind-mcp-server AGENTS.mdGarryWhite109909/xmind-mcp-serverInstructions file02d agoMITA1,598Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot