Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
MCP server for TheBrain 15: search by meaning, graph traversal and batch writes over the local API
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
THEBRAIN_API_KEY, THEBRAIN_BASE_URL, THEBRAIN_DATA_DIR, THEBRAIN_ALLOW_DESTRUCTIVE, THEBRAIN_EMBEDDING_MODEL, THEBRAIN_EMBEDDING_DTYPE, THEBRAIN_TIMEOUT_MSค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"thebrain": {
"command": "npx",
"args": [
"-y",
"thebrain-mcp-server"
],
"env": {
"THEBRAIN_API_KEY": "ใส่ค่าของคุณ",
"THEBRAIN_BASE_URL": "ใส่ค่าของคุณ",
"THEBRAIN_DATA_DIR": "ใส่ค่าของคุณ",
"THEBRAIN_ALLOW_DESTRUCTIVE": "ใส่ค่าของคุณ",
"THEBRAIN_EMBEDDING_MODEL": "ใส่ค่าของคุณ",
"THEBRAIN_EMBEDDING_DTYPE": "ใส่ค่าของคุณ",
"THEBRAIN_TIMEOUT_MS": "ใส่ค่าของคุณ"
}
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add thebrain --env THEBRAIN_API_KEY='ใส่ค่าของคุณ' --env THEBRAIN_BASE_URL='ใส่ค่าของคุณ' --env THEBRAIN_DATA_DIR='ใส่ค่าของคุณ' --env THEBRAIN_ALLOW_DESTRUCTIVE='ใส่ค่าของคุณ' --env THEBRAIN_EMBEDDING_MODEL='ใส่ค่าของคุณ' --env THEBRAIN_EMBEDDING_DTYPE='ใส่ค่าของคุณ' --env THEBRAIN_TIMEOUT_MS='ใส่ค่าของคุณ' -- npx -y thebrain-mcp-serverเติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"thebrain": {
"command": "npx",
"args": [
"-y",
"thebrain-mcp-server"
],
"env": {
"THEBRAIN_API_KEY": "ใส่ค่าของคุณ",
"THEBRAIN_BASE_URL": "ใส่ค่าของคุณ",
"THEBRAIN_DATA_DIR": "ใส่ค่าของคุณ",
"THEBRAIN_ALLOW_DESTRUCTIVE": "ใส่ค่าของคุณ",
"THEBRAIN_EMBEDDING_MODEL": "ใส่ค่าของคุณ",
"THEBRAIN_EMBEDDING_DTYPE": "ใส่ค่าของคุณ",
"THEBRAIN_TIMEOUT_MS": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"thebrain": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"thebrain-mcp-server"
],
"env": {
"THEBRAIN_API_KEY": "ใส่ค่าของคุณ",
"THEBRAIN_BASE_URL": "ใส่ค่าของคุณ",
"THEBRAIN_DATA_DIR": "ใส่ค่าของคุณ",
"THEBRAIN_ALLOW_DESTRUCTIVE": "ใส่ค่าของคุณ",
"THEBRAIN_EMBEDDING_MODEL": "ใส่ค่าของคุณ",
"THEBRAIN_EMBEDDING_DTYPE": "ใส่ค่าของคุณ",
"THEBRAIN_TIMEOUT_MS": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
THEBRAIN_BASE_URL envTHEBRAIN_DATA_DIR envTHEBRAIN_ALLOW_DESTRUCTIVE envTHEBRAIN_EMBEDDING_MODEL envTHEBRAIN_EMBEDDING_DTYPE envTHEBRAIN_TIMEOUT_MS envค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub yBookoff ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
ต้องใส่ค่าเหล่านี้: THEBRAIN_API_KEY
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.3.0) เข้า registry 23 วันที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย
ในหมวดเดียวกันมี Context7, Codebase Memory, Exa
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
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 still
thebrain-mcp.
claude mcp add thebrain -e THEBRAIN_API_KEY=your-key -- npx -y thebrain-mcp-server
{
"mcpServers": { "thebrain": { "command": "npx", "args": ["-y", "thebrain-mcp-server"], "env": { "THEBRAIN_API_KEY": "your-key" } } } }
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:
npm install -g @huggingface/transformers
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.
| Variable | Default | Purpose |
|---|---|---|
THEBRAIN_API_KEY | — | Required |
THEBRAIN_BASE_URL | http://localhost:11522, then :8001 | Local API address |
THEBRAIN_DATA_DIR | ~/.thebrain-mcp | Where indexes are stored |
THEBRAIN_ALLOW_DESTRUCTIVE | 0 | Allow deleting thoughts and links |
THEBRAIN_EMBEDDING_MODEL | Xenova/multilingual-e5-small | Embedding model |
THEBRAIN_EMBEDDING_DTYPE | q8 | Weight precision |
THEBRAIN_TIMEOUT_MS | 30000 | API request timeout |
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.
Reading
| Tool | What it does |
|---|---|
brain_list | Brains, which one is open, whether the index is ready |
brain_get_thought | A thought, its aliases, its graph and its note in one call |
brain_search | Search by meaning |
brain_traverse | Walk the graph several hops out |
brain_list_types_and_tags | The brain's vocabulary |
brain_recent_changes | What changed, in plain language |
brain_index | Index status, build and refresh |
Writing
| Tool | What it does |
|---|---|
brain_create_thought | A thought together with its note, type, tags and aliases |
brain_update_thought | Name, label, type, colours; add and remove aliases |
brain_set_note / brain_append_note | Replace or extend a note |
brain_link | Connect two thoughts, with a label; with replace, make the link that joins them another kind |
brain_unlink | Remove a link, with human confirmation |
brain_tag | Attach and detach tags |
brain_create_type_or_tag | A new type or tag; a tag of a name the brain has is given back, not made twice |
brain_attach_url | Attach a link, without duplicates |
brain_activate | Open a thought on the user's screen |
brain_delete_thought | Delete, with human confirmation |
brain_ingest | Write a whole structure in one call |
brain_ingestThe 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:
{
"brainId": "…", "thoughts": [ { "tempId": "art", "name": "Article on RAG", "parent": " " }, { "tempId": "embed", "name": "Embeddings", "parent": "art", "note": "…" }, { "tempId": "store", "name": "Vector store", "parent": "art" } ], "links": [ { "from": "embed", "to": "store", "name": "is written into" } ] }
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.
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.
| Skill | When it fires |
|---|---|
thebrain-ingest | "put this article in my brain", "break this down and record it" |
thebrain-research | "what do I know about X", "have we discussed this already?" |
thebrain-organize | "clean up my brain", "find duplicates" |
thebrain-digest | "what did I add this week", "what have I been working on" |
Install them as symlinks, so edits in the repository take effect immediately:
mkdir -p ~/.claude/skills
for d in skills/*/; do ln -sfn "$PWD/$d" ~/.claude/skills/"$(basename "$d")" done
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).
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.
npm install
npm test # unit tests, no live TheBrain needed npm run build
Contract tests against a live API:
THEBRAIN_API_KEY=… npm test # read-only
THEBRAIN_API_KEY=… THEBRAIN_TEST_BRAIN_ID= npm test # + writes
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.
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.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.
MIT