
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 分