thebrain-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@thebrain-mcpsearch my brain for thoughts about RAG"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 — 17 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
Related MCP server: thebrain-mcp-server
Install
Claude Code
claude mcp add thebrain -e THEBRAIN_API_KEY=your-key -- npx -y thebrain-mcp-serverClients with a config file
{
"mcpServers": {
"thebrain": {
"command": "npx",
"args": ["-y", "thebrain-mcp-server"],
"env": { "THEBRAIN_API_KEY": "your-key" }
}
}
}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:
npm install -g @huggingface/transformersThen, 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
Variable | Default | Purpose |
| — | Required |
|
| Local API address |
|
| Where indexes are stored |
|
| Allow deleting thoughts |
|
| Embedding model |
|
| Weight precision |
|
| API request timeout |
Changing the model or the precision makes an existing index unusable — the server will say so and ask for a rebuild.
Tools
Reading
Tool | What it does |
| Brains, which one is open, whether the index is ready |
| A thought, its graph and its note in one call |
| Search by meaning |
| Walk the graph several hops out |
| The brain's vocabulary |
| What changed, in plain language |
| Index status, build and refresh |
Writing
Tool | What it does |
| A thought together with its note, type and tags |
| Name, label, type, colours |
| Replace or extend a note |
| Connect two thoughts, with a label |
| Attach and detach tags |
| Attach a link, without duplicates |
| Open a thought on the user's screen |
| Delete, with human confirmation |
| Write a whole structure in one call |
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:
{
"brainId": "…",
"thoughts": [
{ "tempId": "art", "name": "Article on RAG", "parent": "<uuid of an existing thought>" },
{ "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. 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.
Skill | When it fires |
| "put this article in my brain", "break this down and record it" |
| "what do I know about X", "have we discussed this already?" |
| "clean up my brain", "find duplicates" |
| "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")"
doneOr 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
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
npm install
npm test # unit tests, no live TheBrain needed
npm run buildContract tests against a live API:
THEBRAIN_API_KEY=… npm test # read-only
THEBRAIN_API_KEY=… THEBRAIN_TEST_BRAIN_ID=<uuid> npm test # + writesThe write tests require a separate, throwaway brain and refuse to touch any brain with more than 500 thoughts.
Documentation
ARCHITECTURE.md— how the server is built and why: layer boundaries, the mechanism/policy split, error philosophy, the semantic layer, and the measurements behind each decision.docs/api-map.md— the local API's behaviour, including the undocumented parts, verified against a live instance.docs/stack-evaluation.md— why TypeScript, with numbers.CONTRIBUTING.md— how to work on this.
License
MIT
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
- Alicense-qualityCmaintenanceA personal knowledge base MCP server with semantic search, storing thoughts in PostgreSQL with pgvector embeddings and providing 8 tools for capture, search, browse, stats, relations, traces, and hydration.Apache 2.0
- Flicense-qualityDmaintenanceWraps TheBrain knowledge graph as an MCP server, enabling AI assistants to search, create, and manage thoughts, links, and notes via natural language.5
- Alicense-qualityAmaintenanceA universal MCP server providing persistent, structured memory through a knowledge graph with graph storage, semantic vector search, and multi-hop traversal for AI agents and IDEs.1MIT
- Alicense-qualityBmaintenanceMCP server that provides semantic memory with search, related-content traversal, and write-back capabilities, all powered by local embeddings of your notes, documents, and chat histories.14MIT
Related MCP Connectors
Person-owned, portable AI memory as a remote MCP server, readable and writable by any MCP client.
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
FastMCP server for TheBrain API — AI access to a personal knowledge graph, Tollbooth-monetized
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/yBookoff/thebrain-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server