thebrain
v0.3.0MCP server for TheBrain 15: search by meaning, graph traversal and batch writes over the local API
Values you need
| Variable | What it is | |
|---|---|---|
THEBRAIN_API_KEY | required secret | Local API key from TheBrain: Settings > User > Local API Key |
THEBRAIN_BASE_URL | optional | Address of the local API. Default http://localhost:11522, then http://localhost:8001 for older TheBrain builds |
THEBRAIN_DATA_DIR | optional | Where semantic indexes are stored. Default ~/.thebrain-mcp |
THEBRAIN_ALLOW_DESTRUCTIVE | optional | Set to 1 to allow deleting thoughts. Deletion still requires human confirmation. Default 0 |
THEBRAIN_EMBEDDING_MODEL | optional | Embedding model for semantic search. Default Xenova/multilingual-e5-small |
THEBRAIN_EMBEDDING_DTYPE | optional | Weight precision: fp32, fp16, q8 or q4. Default q8 |
THEBRAIN_TIMEOUT_MS | optional | API request timeout in milliseconds. Default 30000 |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add thebrain -e 'THEBRAIN_API_KEY=<THEBRAIN_API_KEY>' -- npx -y --package=thebrain-mcp-server@0.3.0 thebrain-mcpAdd to
claude_desktop_config.json{
"mcpServers": {
"thebrain": {
"args": [
"-y",
"--package=thebrain-mcp-server@0.3.0",
"thebrain-mcp"
],
"command": "npx",
"env": {
"THEBRAIN_API_KEY": "<THEBRAIN_API_KEY>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"thebrain": {
"args": [
"-y",
"--package=thebrain-mcp-server@0.3.0",
"thebrain-mcp"
],
"command": "npx",
"env": {
"THEBRAIN_API_KEY": "<THEBRAIN_API_KEY>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "THEBRAIN_API_KEY",
"id": "thebrain-api-key",
"password": true,
"type": "promptString"
}
],
"servers": {
"thebrain": {
"args": [
"-y",
"--package=thebrain-mcp-server@0.3.0",
"thebrain-mcp"
],
"command": "npx",
"env": {
"THEBRAIN_API_KEY": "${input:thebrain-api-key}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.thebrain]
command = "npx"
args = ["-y", "--package=thebrain-mcp-server@0.3.0", "thebrain-mcp"]
env = { "THEBRAIN_API_KEY" = "<THEBRAIN_API_KEY>" }For AI agents
- Ask the user for: THEBRAIN_API_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: brain_list, brain_get_thought, brain_search, brain_traverse, brain_list_types_and_tags, brain_recent_changes, brain_index, brain_create_thought, ….
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json