Brain MCP
Click on "Deploy 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., "@Brain MCP search my vault for notes about hybrid retrieval and give me a summary"
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.
Brain MCP
MCP server for hybrid retrieval over a markdown vault: dense embeddings plus BM25, fused with RRF. Writes reindex the changed file. Optional shared embed process so each MCP session does not load models.
Compatible with any MCP stdio client.
Requirements
Python | 3.11+ |
Docker Compose | v2 (Qdrant + embed service) |
| |
RAM | ~1.2 GB for ONNX models |
Related MCP server: Datacron
Install
git clone https://github.com/Artur0927/brain-mcp.git
cd brain-mcp
bash scripts/deploy.shdeploy.sh creates a venv, copies examples/sample-vault to ./vault if missing, starts Qdrant and the embed service, runs brain-index, and writes examples/mcp/mcp.generated.json.
First run downloads embedding models (~400 MB). Merge the generated mcpServers block into your MCP client config (see docs/setup.md).
Existing vault:
bash scripts/deploy.sh --vault /path/to/markdownArchitecture
flowchart LR
Client(["MCP\nclient"]) <-->|stdio| Server
subgraph core [" "]
direction TB
Server["brain-mcp\n12 tools · ~140 MB"]
Server -->|encode| Embed["brain-embed :8091\nMiniLM-L12 + BM25"]
Server -->|prefetch + RRF| Qdrant[("Qdrant :6333")]
Server <-->|fs| Vault[("vault/")]
endSearch flow: query → brain-embed encodes dense (384d cosine) + sparse (BM25 IDF) → Qdrant runs two prefetches (3x limit each) → RRF fusion → ranked chunks returned.
Write flow: file written to vault → chunked on headings (max 1500 chars) → old chunks deleted from Qdrant → new chunks embedded and upserted.
Process | Role | Bind |
| MCP tools, vault I/O, Qdrant queries | stdio |
| Dense + sparse ONNX models, loaded once |
|
Qdrant | Hybrid vector collection |
|
| Markdown source of truth | filesystem |
| Incremental mtime-based reindex | systemd timer |
| Read-only Kanban + session logs |
|
Details: docs/architecture.md
Tools
Tool | Behavior |
| Dense + sparse prefetch, RRF fusion; optional |
|
|
| Read file by relative path |
| Up to 5 files per call |
| Depth-limited listing |
| Collection size, disk, embed health, |
| Mutate file, then reindex |
| Append to |
| Write |
| File locks under |
Server install
sudo bash scripts/deploy.sh --server --vault /data/vaultInstalls under /opt/brain-mcp, enables brain-reindex.timer and brain-dashboard. Remote MCP over SSH: scripts/mcp-launcher.sh (ControlMaster). Config: docs/setup.md, .env.example.
Configuration
Variable | Default |
|
|
|
|
|
|
|
|
|
|
|
|
CLI
brain-mcp stdio MCP server
brain-embed embedding HTTP service
brain-index full reindex (recreates collection)
brain-reindex mtime incremental reindex
brain-lessons-index rebuild knowledge/agent-lessons/INDEX.md
brain-dashboard HTTP UIOperations
Symptom | Check |
Tools missing in client | Reload MCP server; confirm |
|
|
Empty search |
|
| install ripgrep |
Slow first start | model download |
Port 8091 in use |
|
Layout
src/brain_mcp/ server, embed, indexer, dashboard
scripts/deploy.sh local and --server install
examples/sample-vault template vault
examples/mcp/ mcp.json template
deploy/systemd/ units
docs/ architecture, setup, agent protocol
docker-compose.yml qdrant + embedAgent boot/report convention: docs/agent-workflow.md.
Development
python3 -m venv .venv
source .venv/bin/activate
pip install -e .License
Available Tools
12 toolsbrain_appendB
Append to a vault file. Auto-reindexes.
Inputs: path (required), content (required). Returns: result
brain_batch_readA
Read up to 5 vault files in one call.
Inputs: paths (required), max_chars. Returns: result
brain_grepB
Exact/regex search via ripgrep. Returns file:line:match.
Inputs: pattern (required), limit. Returns: result
brain_lessonB
Persist a reusable lesson under knowledge/agent-lessons/. Auto-reindexes.
Inputs: body (required), agent (required), category (required), context. Returns: result
brain_listB
List files in the vault with depth and pattern limits.
Inputs: path, depth, pattern. Returns: result
brain_logC
Timestamped daily log entry (YYYY-MM-DD.md). Auto-reindexes.
Inputs: agent (required), message (required), type. Returns: result
brain_readA
Read a vault file by relative path.
Inputs: path (required), max_chars. Returns: result
brain_searchB
Dense + BM25 prefetch, RRF fusion. Optional path_prefix narrows scope.
Inputs: query (required), limit, path_prefix. Returns: result
brain_statsA
Collection size, disk usage, embed service health, .md count.
Inputs: no named parameters. Returns: result
brain_task_claimC
Atomically claim a task for parallel agent coordination.
Inputs: agent (required), task_id (required), ttl_hours. Returns: result
brain_task_releaseA
Release a task claim if you own it.
Inputs: agent (required), task_id (required). Returns: result
brain_writeA
Create or overwrite a vault file. Auto-reindexes.
Inputs: path (required), content (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool has a clearly distinct purpose: grep and search differ by exact/regex vs semantic search; read and batch_read differ by count; write, append, log, and lesson each target different write behaviors and destinations. The task claim/release pair is also unambiguous in ownership semantics.
Most tools follow a consistent brain_<verb> pattern such as brain_read, brain_write, brain_append, and brain_list. Minor deviations like brain_stats, brain_lesson, and brain_task_claim/task_release introduce nouns or object-verb ordering, but the overall pattern remains predictable.
Twelve tools is well within the ideal range and matches the server's dual purpose of knowledge vault management and agent task coordination. Each tool covers a meaningful operation without unnecessary redundancy or feature bloat.
Core vault operations like search, read, write, append, list, and specialized logging are covered well. However, there is no delete/remove or rename/move tool, and task coordination lacks a way to discover or list tasks, which can create dead ends in some workflows.
Maintenance
Related MCP Connectors
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Notes and memory assistant: one Markdown vault that Claude, ChatGPT and any MCP client can share.
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables managing and searching markdown notes with semantic search, question answering, and note generation, and provides an MCP server for GitHub Copilot integration.4-
- AlicenseAqualityBmaintenanceLocal MCP server for querying and maintaining a Markdown vault. Provides full-text search, backlinks, note retrieval, and optional confined write tools, without sending the whole vault to the client context.2261 PyPI1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceLocal-first MCP server for retrieval over markdown wikilink vaults, offering hybrid vector+lexical search, note reading, neighbor expansion, and recent activity tracking with fully local embeddings and no network egress.MIT
- AlicenseBqualityBmaintenanceEnables local hybrid search over Obsidian and Markdown vaults via MCP, combining vector retrieval, full-text search, reranking, graph navigation, and safe CRUD while keeping data local.431MIT