vault-context-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., "@vault-context-mcpget a cited context pack for continuing ATLAS architecture"
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.
vault-context-mcp
vault-context-mcp is a local-first MCP server that turns an Obsidian vault into compact, cited context packs for Claude Desktop, Claude Code, Codex, and future MCP-compatible clients.
It is not a chatbot, UI, agent orchestrator, or vault writer. v0 is a read-only context broker.
Why It Exists
Obsidian is the canonical memory. Frontier LLMs should not spend tokens scanning an entire vault. They should ask a local broker for the smallest useful context slice, with source paths and heading anchors.
Related MCP server: grounded-mcp
Architecture
Obsidian Vault
↓
vault-context-mcp indexer
↓
SQLite index
↓
MCP tools
↓
Claude Desktop / Codex / Claude Code / future clientsInstallation
cd vault-context-mcp
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
cp config.example.yaml config.yamlEdit config.yaml and set vault_root to your Obsidian vault.
Configuration
The runtime config is loaded from:
export VAULT_CONTEXT_CONFIG=/absolute/path/to/config.yamlIf no config is provided, vault-context explains how to copy config.example.yaml.
Indexing The Vault
vault-context doctor
vault-context indexRunning The CLI
vault-context search "current state"
vault-context pack "Continue my LLM agnostic Obsidian context broker design"
vault-context pack "Continue ATLAS architecture" --mode standard --project ATLASRun the retrieval quality gate independently of your vault or configuration:
vault-context benchmark-retrievalIt creates and removes a temporary synthetic vault and index, uses no model or network service, and prints JSON with named checks. A failed check exits 1. Checks cover ranking, useful cited context, restricted-content isolation, source refresh, source preservation and SQLite LIKE fallback. This is synthetic regression coverage; it does not measure your real vault's retrieval accuracy. CI runs this same command after the test suite.
To run the bundled sample-vault acceptance path:
VAULT_CONTEXT_CONFIG="$(pwd)/config.sample.yaml" vault-context doctor
VAULT_CONTEXT_CONFIG="$(pwd)/config.sample.yaml" vault-context index
VAULT_CONTEXT_CONFIG="$(pwd)/config.sample.yaml" vault-context search "ATLAS project state"
VAULT_CONTEXT_CONFIG="$(pwd)/config.sample.yaml" vault-context pack "Continue ATLAS architecture" --mode standard --project ATLASSource provenance and freshness
Optional deterministic provenance records source versions and derivation dependencies outside the vault. It never writes source notes or calls a model. Enable a bounded scope in your local configuration:
librarian:
provenance:
enabled: true
scope: ["Main_Vault/00_Inbox/Chats"]
state_dir: "~/.vault-context-mcp/provenance"Run vault-context provenance-scan twice to observe discovery followed by a no-op. provenance-propose ID --dep RELATIVE_PATH, provenance-review ID --accept, and provenance-report --json track proposals, review and stale dependencies. provenance-trace SUBJECT shows the transition history. Reports show counts by default; --paths requests paths under the caller's clearance. Existing librarian refreshes also scan when enabled. Keep state outside the vault, serialize commands, and use a fresh state directory when changing scope. See ADR 0006.
Running The MCP Server
vault-context serve-mcpClaude Desktop Setup
Claude Desktop config path on macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonPython module launch:
{
"mcpServers": {
"vault-context-mcp": {
"command": "/absolute/path/to/python",
"args": [
"-m",
"vault_context_mcp",
"serve-mcp"
],
"env": {
"VAULT_CONTEXT_CONFIG": "/absolute/path/to/config.yaml"
}
}
}
}Console script launch:
{
"mcpServers": {
"vault-context-mcp": {
"command": "vault-context",
"args": ["serve-mcp"],
"env": {
"VAULT_CONTEXT_CONFIG": "/absolute/path/to/config.yaml"
}
}
}
}You can patch Claude's config safely:
vault-context install-claudeThen restart Claude Desktop.
Codex Setup
See docs/codex_setup.md. In MCP-compatible Codex environments, configure vault-context with serve-mcp and set VAULT_CONTEXT_CONFIG to an absolute config path.
Multi-Client Setup
Configure supported local MCP clients:
vault-context install-all-clientsSee:
docs/client_setup.mddocs/claude_desktop_setup.mddocs/claude_code_setup.mddocs/codex_setup.mddocs/gemini_setup.mddocs/chatgpt_setup.md
Local Librarian
Run a hygiene audit:
vault-context librarian-auditRun the watcher in the foreground:
vault-context librarian-watchInstall the macOS background watcher:
vault-context install-librarian-agentThe librarian automatically refreshes the SQLite index when Markdown files change and writes hygiene reports outside the vault by default. See docs/librarian.md.
LLM clients can call:
get_librarian_reportCross-LLM Session Capture
Log useful thinking from Claude, ChatGPT, Gemini, Codex, and local LLMs into one vault trail:
vault-context log-session --source chatgpt --title "ATLAS review" --project ATLAS --transcript-file transcript.mdRun the localhost capture endpoint:
vault-context serve-captureInstall it as a background service:
vault-context install-capture-agentMCP clients can call log_session, get_recent_sessions, and get_session_handoff. Existing Claude project session logs in 01-Sessions/ and 08-Sessions/ are recognized as first-class handoff context. See docs/session_capture.md.
For ChatGPT, Gemini, and Claude browser sessions, install the userscript at scripts/vault_context_capture.user.js after starting or installing the local capture endpoint. It adds a Log to Vault button that sends selected chat text to the local capture pipeline.
For the Claude-style phrase flow, use the persistent instruction in docs/frictionless_capture.md. MCP-capable clients can then treat "log this chat/session" as a direct call to log_session.
Troubleshooting
vault-context doctor
vault-context pack "test task"Use absolute paths in MCP configs and restart Claude Desktop after config changes.
Security Model
Retrieval and librarian tools are read-only for vault content.
Session capture is an allowlisted write path for preserving LLM thinking.
MCP tools do not execute shell commands.
Reads are restricted to the configured vault root.
Symlinks escaping the vault root are rejected.
No cloud API is required.
Optional Ollama summarization is local only.
The local librarian refreshes the index and writes reports outside the vault by default.
See docs/security_model.md.
Roadmap
Local embedding provider interface.
Incremental indexing.
Better markdown link and tag awareness.
Optional local Ollama summaries with stricter time budgets.
Explicitly designed write-back tools in a future version.
This server cannot be deployed
Maintenance
Related MCP Connectors
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
OAuth-protected, read-only-by-default MCP server for provenance-labeled QuillCaddie project memory.
Read-only MCP server for the OrchestKit docs: full-text search + Markdown fetch. No auth.
Related MCP Servers
- AlicenseCqualityCmaintenanceRead-only MCP server for querying a running Obsidian vault from agentic runtimes, exposing safe Obsidian CLI commands.551MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server for markdown/Obsidian knowledge vaults that enables trusted, read-only retrieval with cited provenance, honest abstention when no adequate answer exists, index-level entitlement enforcement, and redaction guarding.MIT
- FlicenseNot gradedqualityCmaintenanceProvides read-only Obsidian-style vault retrieval and auditing over MCP stdio with authority-aware search, metadata, sections, and related notes while enforcing path containment and bounded response sizes.-
- AlicenseNot gradedqualityAmaintenanceEnables LLM clients to read, search, and write to a local Obsidian vault over MCP, with full-text search, vault analytics, health scoring, and policy-enforced file operations.1MIT