# thebrain [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/yBookoff/thebrain-mcp  
**GitHub Stars:** 8  
**npm Downloads (last month):** 342  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/thebrain

## Description
MCP server for TheBrain 15: search by meaning, graph traversal and batch writes over the local API

## Tools
Capabilities this server exposes over MCP:

- **brain_list** — Lists the user's brains and which one is currently open in the app. Call this first in any session: every other tool needs a brainId and guessing one is not allowed. Also shows whether the semantic index is ready.
- **brain_get_thought** — A thought in full: note, aliases, parents, children, jumps, tags, type and attachments in one call. The main way to understand a thought's context. Call it when you need to know what a thought is about and how it connects, before changing or extending it.
- **brain_search** — Finds thoughts by meaning. Call it when looking for something by description rather than exact title — for instance to check whether a thought on this topic already exists. Always pass variants: several phrasings of the same concept (synonyms, translation, a broader and a narrower term). They raise recall noticeably, and if the semantic index is not built they are all that works.
- **brain_traverse** — Walks the graph several hops out from a thought. Call it when you need to see the whole neighbourhood: which region of the brain adjoins a topic, where new material should slot in, what already sits nearby. Viewing a thought shows one hop only.
- **brain_list_types_and_tags** — The brain's vocabulary: which thought types and tags exist. Call it before creating thoughts so you use this brain's established conventions instead of inventing new ones.
- **brain_recent_changes** — What changed in the brain over a period, in plain language. Call it for digests ("what did I add this week") and to understand what work was in progress before continuing it.
- **brain_index** — Manages the semantic index: status, build, refresh. Call with action=status when brain_search complains the index is missing; with action=rebuild to build it for the first time or after changing the model; with action=sync to pull in changes (fast, new material only). The first build on a large brain takes minutes.
- **brain_create_thought** — Creates a thought and sets its note, type, tags and aliases in the same call. Call it when adding something new. Always supply parentId — a thought with no links gets lost in the graph. Search first: a suitable thought may already exist, in which case extending it is the better move.
- **brain_update_thought** — Changes a thought's properties: title, caption, aliases, type, colours. Call it to rename or reclassify. It does not touch the note — use brain_set_note or brain_append_note for that.
- **brain_set_note** — Replaces a thought's note entirely. The previous text is lost — to add rather than replace, call brain_append_note. Read an existing note with brain_get_thought before overwriting it.
- **brain_append_note** — Appends text to the end of a note without erasing anything. The main way to accumulate material on a thought. If no note exists yet, one is created.
- **brain_link** — Links two thoughts. Call it when you spot a meaningful relationship between existing thoughts — links are what make a brain a graph rather than a list. Label the link via name: "motivates", "solved by", "contradicts". Two thoughts share one link: where one joins them already nothing is added, and the result says what is there.
- **brain_unlink** — Removes the link between two thoughts, with its label. There is no undo. Requires human confirmation. Call it only when the user asked for the link to go. brain_link with replace changes a link's kind; a tag goes with brain_tag, a type with brain_update_thought.
- **brain_tag** — Attaches and removes a thought's tags. Tags are separate thoughts of a special kind; take their identifiers from brain_list_types_and_tags, and create a new tag via brain_create_type_or_tag. A single call can both add and remove.
- **brain_create_type_or_tag** — Creates a thought type or a tag: the vocabulary thoughts are classified with, which brain_create_thought cannot make. Call it when brain_list_types_and_tags has none that fits. Under the name of a tag the brain has, in any letter case, no second tag is made and the result gives that one. A type is made even when another has the name.
- **brain_attach_url** — Attaches a link to a thought. Checks first whether the same URL is already attached and avoids duplicates. Leave name empty to take the title from the page.
- **brain_activate** — Opens a thought in the user's TheBrain app on screen. Call it to show the person a result — for instance a structure you have just created, so they can see it in the graph.
- **brain_delete_thought** — Permanently deletes a thought along with its note and links. There is no undo. Requires human confirmation. Do not call it to tidy up on your own initiative — only when the user explicitly asked for a deletion.
- **brain_ingest** — Writes a whole structure of thoughts, links, notes, tags and aliases in a single call. Call it once you have decomposed some material (an article, a document, a discussion) into several connected thoughts — creating them one by one at that volume is slow and breaks halfway.
Thoughts reference each other by tempId, arbitrary labels you invent yourself; the server substitutes real identifiers. A parent may be either a tempId from this batch or the UUID of an existing thought, which is how a new branch grafts onto what the brain already holds.
Search with brain_search first: some of the thoughts may already exist, and linking to them beats creating duplicates.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "thebrain": {
    "command": "npx",
    "args": ["-y","thebrain-mcp-server"],
    "env": {
      "THEBRAIN_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `THEBRAIN_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What thebrain MCP server does

thebrain MCP server gives an MCP-compatible agent access to a local TheBrain 15 installation. It exposes a smaller set of semantic operations rather than mirroring every local API endpoint. Reading tools can list available brains, identify the open brain, retrieve a thought with its note and graph context, search for related concepts, traverse nearby relationships, inspect types and tags, review recent changes, and check indexing state.

Writing tools cover thought creation and updates, note replacement or appending, labeled links, tag changes, URL attachments, screen activation, deletion, and multi-item ingestion. The `brain_ingest` operation is intended for material that should become a connected structure instead of one unstructured note. It accepts temporary identifiers, resolves dependencies, and can create links among newly added thoughts and existing graph nodes.

## How it works

The server communicates with TheBrain 15 over its local API. Semantic search uses a local vector index when the optional `@huggingface/transformers` package is installed and the index has been built or refreshed with `brain_index`. The default embedding model is `Xenova/multilingual-e5-small`. Indexing is incremental after the initial build, so later runs recompute only changed content.

Without the embeddings package, search remains available through fan-out prefix queries based on synonyms supplied by the agent, but recall is lower.

`brain_ingest` validates a complete plan before writing. It rejects cycles and unresolved references before the first change, resolves thought dependencies regardless of input order, and avoids duplicating the same plan when run again.

## Setup and configuration

Thebrain MCP server requires TheBrain 15 to be running with its local API enabled, Node.js 22 or newer, and an API key from TheBrain's User settings. Install the published `thebrain-mcp-server` package through `npx`, while the executable command remains `thebrain-mcp`. Configure the key as `THEBRAIN_API_KEY` in the MCP client's environment.

`THEBRAIN_BASE_URL` defaults to `http://localhost:8001`. Other settings control the local data directory, embedding model, embedding precision, API timeout, and whether destructive operations are allowed. Changing the model or precision invalidates the current index and requires a rebuild. Install `@huggingface/transformers` separately only when semantic vector search is wanted.

## Tools and capabilities

The available operations include:

- Discovering brains, the open brain, vocabulary, recent changes, and index status.
- Retrieving thoughts with graph and note data.
- Searching by meaning or fallback synonyms and traversing multiple graph hops.
- Creating and updating thoughts, notes, labels, types, colors, tags, and URLs.
- Linking thoughts with relationship labels and opening a thought on screen.
- Ingesting a connected structure in one call.

The repository also includes optional Claude Code skills for ingestion, research, organization, and digest workflows. These are editable Markdown files and are separate from the server's deterministic tool mechanism.

## Limitations and notes

Deletion is disabled by default. Enabling `THEBRAIN_ALLOW_DESTRUCTIVE=1` still does not let an agent delete without human consent: confirmation is required through a supported form or an explicit second call.

Vector search adds a substantial optional dependency and a model download on first use. A 10,000-thought index is documented as taking about a minute to build. Write contract tests require a separate throwaway brain and refuse brains containing more than 500 thoughts. The project is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/thebrain/readme_

