Brain MCP
Gives read-only MCP access to an Obsidian vault mounted into the container: search notes by words (optionally scoped to one folder) returning paths, modified dates and snippets; read a single note capped at 200 KB; list notes optionally under a folder; and list notes changed in the last N days, newest first. Access is restricted by folder allow/deny lists, with hidden files (.obsidian/, .git/), non-Markdown files, path traversal and escaping symlinks always refused.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Brain MCP
A small, read-only remote MCP server that shares an Obsidian vault with AI apps (a Claude custom connector, Claude Code, any MCP client), behind a single-user OAuth 2.1 sign-in.
Why: I kept re-explaining the same context (projects, decisions, plans) in every AI app. My notes already live in an Obsidian vault that my self-hosted assistant keeps current. Brain lets other AI apps read that vault directly, so every chat starts from the same source of truth. Only the assistant writes. Every outside app can only read.
flowchart LR
A[Assistant on the server] -- writes --> V[(Obsidian vault)]
V -- mounted read-only --> B[Brain MCP<br/>Node.js container]
T[Traefik<br/>HTTPS] --> B
C[Claude web, desktop, phone] -- OAuth 2.1 + MCP --> T
D[Claude Code] -- OAuth 2.1 + MCP --> TWhat it does
Four tools, all annotated readOnlyHint. There is no write path in the code.
Tool | Use |
| Find notes by words, optionally inside one folder. Returns paths, modified dates and snippets. |
| Read one note (capped at 200 KB). |
| List notes, optionally under a folder. |
| Notes changed in the last N days, newest first. |
The server also sends instructions to the client: start with Now.md, cite the note path and date, prefer Brain over the model's own memory, never claim to have edited a note, and quote timestamps in the owner's time zone.
Related MCP server: Another bloated Obsidian MCP Server
Security model
Read-only, three ways: no write tools, the vault is mounted
:ro, and the container root filesystem is read-only (cap_drop: ALL,no-new-privileges, memory and PID caps).Path rules: an allowlist (or
*for the whole vault) plus an optional denylist. Hidden files (.obsidian/,.git/), non-Markdown files,..traversal and symlinks that escape the vault are always refused.OAuth 2.1 for one user: PKCE, Dynamic Client Registration, and Client ID Metadata Documents accepted only from allowlisted hosts (default
claude.ai,claude.com,anthropic.com). One password, stored as a scrypt hash, unlocks the sign-in page. The login endpoint is rate-limited.Tokens: 1-hour access tokens, 30-day refresh tokens with rotation, 5-minute single-use authorization codes. Only SHA-256 hashes of tokens are written to disk.
Sign-in page: strict CSP (
default-src 'none').form-actionincludes the client's redirect origin, because Chrome appliesform-actionto the redirect that follows the form post.Stateless transport: Streamable HTTP at
/mcp, a fresh MCP server per request.
Design notes and trade-offs: docs/DESIGN.md.
Run the tests
npm ci
npm testThe suite covers the vault path rules, OAuth (registration, PKCE, wrong password, single-use codes, redirect checks, refresh rotation, metadata-document host allowlist), the sign-in page CSP, all four tools over HTTP, tokens never stored in plain text, time-zone formatting and config loading.
Configuration
Variable | Default | Meaning |
| required | Public base URL, e.g. |
| required | Output of |
|
| Vault root (mount it read-only) |
|
| Served top-level folders or files, comma-separated; |
| (empty) | Hidden sub-paths, comma-separated |
|
| Writable dir for client registrations and hashed refresh tokens |
|
| Hosts allowed to serve client metadata documents |
|
| Name used in the instructions sent to the AI |
|
| Who keeps the notes current |
|
| IANA time zone for |
|
| Listen port |
BRAIN_OWNER, BRAIN_WRITER and BRAIN_TZ can also live in brain.config.json inside the state dir ({"owner": "...", "writer": "...", "timeZone": "..."}). Environment variables win.
Deploy (Docker host with Traefik)
Point a DNS record (e.g.
brain.example.com) at the host.Put this repo on the host and run
npm ci --omit=dev.Run
cp deploy/local.env.example deploy/local.env, then set the domain, vault path and state path.Run
sudo bash deploy/install.sh. It asks for the password (hashed in a throwaway container, never written in plain text), detects Traefik's network, entrypoint and certificate resolver, writes a hardeneddocker-compose.ymland starts the container.
Change the password later with sudo bash deploy/install.sh --password. Remove everything except the vault with deploy/uninstall.sh.
Connect
Claude (web, desktop, phone): Settings > Connectors > Add custom connector >
https://brain.example.com/mcp, then sign in with the password.Claude Code, one session only:
echo '{"mcpServers":{"brain":{"type":"http","url":"https://brain.example.com/mcp"}}}' > brain.json claude --mcp-config brain.json --strict-mcp-config
Limits
Plain word search (all words must match); no embeddings or ranking.
Obsidian links and embeds come back as raw Markdown; there is no graph data.
Single user by design. A team would need real accounts and per-user scopes.
How it was built
Built with my self-hosted AI assistant (Hermes Agent running Claude). I set the goal, scope and security requirements, approved the design, ran the deployment on my own server and acceptance-tested it in Claude. The assistant wrote the code and tests. One real bug from deployment is now a regression test: the sign-in page's CSP form-action 'self' made Chrome block the redirect back to Claude after a correct password.
Stack: Node.js 22, the official @modelcontextprotocol/sdk, Express 5, zod, Docker, Traefik.
License
MIT © Carlos Chiu
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Persistent memory for AI assistants — one shared, OAuth-secured vault for every MCP client.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA local MCP server that enables AI applications like Claude Desktop to securely access and work with Obsidian vaults, providing capabilities for reading notes, executing templates, and performing semantic searches.829MIT
- AlicenseAqualityFmaintenanceA Model Context Protocol (MCP) server that provides AI assistants with secure access to Obsidian vaults. Enables reading, writing, searching, and managing notes without requiring Obsidian to be running.503,465 npmApache 2.0
- AlicenseNot gradedqualityDmaintenanceA lightweight MCP server that enables AI assistants to securely read, create, and modify notes in an Obsidian vault, with support for semantic search and web scraping.MIT
- FlicenseNot gradedqualityBmaintenanceRemote MCP server for Obsidian vault access, giving Claude read/search/archive access to markdown notes via OAuth 2.1 + PKCE auth.2-