
Thebrain
io.github.yBookoff由 GitHub 账号 yBookoff 发布v0.3.0更新于 Nov 4, 2026
MCP server for TheBrain 15: search by meaning, graph traversal and batch writes over the local API
概览
面向 TheBrain 15 的 MCP 服务器,让助手按语义搜索大脑、遍历图谱,并批量写入相互连接的思考与链接。
- 可以做什么
- 读取大脑:列出大脑与索引状态,一次取得思考及其别名、图谱和笔记,按语义搜索,多跳遍历,列出类型与标签,查看近期变更。
- 管理语义索引:查看状态、构建与刷新本地向量索引。
- 创建与编辑思考:带笔记、类型、标签和别名创建,修改名称、标签、颜色和别名,替换或追加笔记,附加网址。
- 连接与整理:为两个思考建立或改换链接,添加与移除标签,创建类型和标签,在屏幕上打开某个思考。
- 用批量写入一次性写入整块结构,自动解析临时标识、避免重复,并在写入前拒绝有问题的方案。
- 仅在显式开启并经人工确认时删除思考与链接。
- 适用场景
- 适合在 TheBrain 15 中积累笔记、希望助手把文章或研究整理成相互连接的思考写入其中,或基于已有内容回答问题、清理重复项和回顾近期新增内容的场景。
- 运行要求
- 本机运行并启用本地 API 的 TheBrain 15、Node.js 22 或更高版本,以及在 TheBrain 设置中获取、通过 THEBRAIN_API_KEY 传入的 API 密钥。可选的语义搜索需另行安装 Hugging Face transformers 包并下载模型;索引存放在 THEBRAIN_DATA_DIR 下。
安装
在 SourceWeft 中
- 打开 控制台中的 Thebrain,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
thebrain-mcp
An MCP server for TheBrain 15, built on its local API.
It gives an agent semantic operations over your brain: search by meaning, read a neighbourhood of the graph, and write a decomposed piece of material into the brain as a whole connected structure. It is not a mirror of the API — 19 tools instead of 48 endpoints.
The point is not "save this text". The point is that when you hand an agent an article, it reads it, breaks it into meanings, works out where each one belongs in the graph you already have, what to link it to, and what each note should say.
Published on npm as
thebrain-mcp-server— npm considers the shorter name too close to an unrelated existing package. The installed command is stillthebrain-mcp.
Requirements
- TheBrain 15 running, with the local API enabled
- Node.js 22 or newer
- An API key: Settings → User → Local API Key
Install
Claude Code
Clients with a config file
Semantic search
TheBrain's own search matches prefixes: OT finds OTGP, while a synonym or a
typo finds nothing. To search by meaning, the server builds a local vector index.
The embeddings package is not part of the install: it weighs around 380 MB, plus 113 MB for the model itself on first run. Install it separately, and only if you want it:
Then, from your client: brain_index with action: "rebuild". Indexing a
10,000-thought brain takes about a minute; later runs only recompute what changed.
The server works without the package. brain_search falls back to a fan-out
of prefix queries over the synonyms the agent supplies, and says plainly that
recall is lower.
Everything is local: neither your brain's contents nor your queries are sent anywhere.
Settings
Changing the model or the precision makes an existing index unusable — the server will say so and ask for a rebuild.
THEBRAIN_BASE_URL rarely needs setting. A TheBrain update moved the local API
from port 8001 to 11522, so the server tries the new port and falls back to the
old one. Set the variable only if TheBrain listens somewhere else; the endpoint
exactly as Settings shows it (http://localhost:11522/api/) is fine.
Tools
Reading
Writing
brain_ingest
The main tool for filling a brain. The agent breaks material into thoughts, wires them together through temporary identifiers, and the whole thing lands in one call:
The order of thoughts in the input does not matter — dependencies resolve themselves. Running the same plan twice duplicates nothing, and a thought that was already there keeps the note it has: a plan's note is written only where there is none, and the result says which notes were kept. Bad plans (a cycle, a reference to nowhere) are rejected before the first write.
Skills
The server provides the mechanism — deterministic operations. The methodology (how finely to split meanings, when to attach to something that already exists, what belongs in a note) lives separately, in Claude Code skills. They are plain markdown files, so you can adjust them to your own way of working without rebuilding the server.
Install them as symlinks, so edits in the repository take effect immediately:
Or copy them, if you do not want the link to the repository. For a single
project, use .claude/skills in its root instead of ~/.claude/skills.
Skills are picked up when a session starts — an already running session needs a
restart (claude --continue keeps the conversation).
Deletion
Of a thought (brain_delete_thought) and of a link (brain_unlink). Off by
default. Even with THEBRAIN_ALLOW_DESTRUCTIVE=1 it requires human
consent: through a confirmation form if the client supports one, otherwise
through a second call with an explicit flag. The agent cannot make this decision
for you.
Development
Contract tests against a live API:
The write tests require a separate, throwaway brain and refuse to touch any brain with more than 500 thoughts. The read-only tests that need a brain read that one too, and skip without it: no test reads another brain.
Documentation
ARCHITECTURE.md— how the server is built and why: layer boundaries, the mechanism/policy split, error philosophy, the semantic layer, and the reasons behind each decision.docs/api-map.md— the local API's behaviour, including the undocumented parts, verified against a live instance, with the measurements.docs/stack-evaluation.md— why TypeScript, with numbers.CONTRIBUTING.md— how to work on this.
Support
thebrain-mcp is built and maintained in spare time. If it earns a place in your workflow, you can sponsor it on GitHub — once or monthly.
License
MIT
来源:README.md,提交 31d66e5
工具
0版本历史
4- v0.3.0最新Oct 14, 2026
- v0.2.0Oct 13, 2026
- v0.1.5Sep 30, 2026
- v0.1.2Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分