obsidian-rag
Enables semantic search and retrieval over an Obsidian vault, with tools to search notes, read note contents, and monitor vault status.
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., "@obsidian-rag find notes about the new product launch"
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.
Obsidian RAG Assistant
A local-first retrieval system that semantically searches an Obsidian Markdown vault from the command line or through read-only MCP tools for Claude.
Features
Recursively scans Markdown notes while ignoring
.obsidian,.git,.trash, and hidden folders.Parses headings, YAML front matter, tags, and Obsidian wiki-links.
Uses heading-aware structural chunking with an 800-character body limit and paragraph boundaries.
Generates local 384-dimensional embeddings with Ollama and
all-minilm:22m.Stores text, vectors, and source metadata in persistent local ChromaDB.
Performs dense semantic vector search with file and heading citations.
Incrementally synchronizes new, changed, and deleted notes without creating duplicates.
Exposes read-only
search_notes,read_note, andvault_statusMCP tools.
Current retrieval is dense semantic search only. BM25, hybrid search, overlap, semantic chunking, and reranking are not implemented yet.
Related MCP server: obsidian_mcp
Architecture
flowchart LR
subgraph Indexing
A[Obsidian vault] --> B[Recursive scanner]
B --> C[Markdown parser]
C --> D[Heading-aware chunks]
D --> E[Ollama MiniLM embeddings]
E --> F[(Persistent ChromaDB)]
end
subgraph Retrieval
G[Natural-language question] --> H[Query embedding]
H --> I[Vector similarity search]
F --> I
I --> J[Top-k cited passages]
end
subgraph Generation
J --> K[MCP]
K --> L[Claude]
endMCP does not perform RAG. It exposes the already-working retrieval functions to Claude, which uses the returned evidence to generate an answer.
Requirements
Quick start
git clone https://github.com/Amanaakash/Obsidian-RAG-with-Claude-mcp.git
cd Obsidian-RAG-with-Claude-mcp
uv sync --locked
ollama pull all-minilm:22mOllama normally starts with its desktop application. If it is not running, start it with ollama serve. Do not start a second server if port 11434 is already in use.
Index and search the included sample notes:
uv run obsidian-rag index --vault sample_vault
uv run obsidian-rag search "What is reciprocal rank fusion?"Every result includes its relative source path, heading hierarchy, vector distance, and retrieved text. Distance is a relative ranking signal, not a confidence percentage.
Use a real Obsidian vault
Choose a separate database directory for each vault:
uv run obsidian-rag index --vault "/absolute/path/to/ObsidianVault" --db ".rag_data/my_vault"
uv run obsidian-rag search "How do I evaluate retrieval quality?" --db ".rag_data/my_vault"Re-run index after changing the vault. Unchanged notes are skipped, changed notes are replaced, new notes are added, and deleted notes are removed from the index.
Changing the embedding model changes the vector dimensions and semantic space. Use a new database directory or rebuild the existing generated index after switching models.
Claude through MCP
The MCP server reads configuration exclusively from environment variables:
Variable | Required | Default | Purpose |
| Yes | — | Absolute path to the Obsidian vault |
| Yes | — | Absolute path to the persistent Chroma directory |
| No |
| Ollama embedding model |
| No |
| Chroma collection name |
| No |
| Ollama server address |
Claude Desktop
Merge an obsidian-rag entry into Claude Desktop's MCP configuration. Keep any existing server entries.
{
"mcpServers": {
"obsidian-rag": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/Obsidian-RAG-with-Claude-mcp",
"run",
"obsidian-rag-mcp"
],
"env": {
"OBSIDIAN_RAG_VAULT": "/absolute/path/to/ObsidianVault",
"OBSIDIAN_RAG_DB": "/absolute/path/to/Obsidian-RAG-with-Claude-mcp/.rag_data/my_vault",
"OBSIDIAN_RAG_MODEL": "all-minilm:22m",
"OBSIDIAN_RAG_COLLECTION": "obsidian_notes"
}
}
}
}On Windows, Claude Desktop stores this file at %APPDATA%\Claude\claude_desktop_config.json. Completely quit and reopen Claude Desktop after changing it.
Claude Code
Register the same stdio server in user scope:
claude mcp add --scope user obsidian-rag -e "OBSIDIAN_RAG_VAULT=/absolute/path/to/ObsidianVault" -e "OBSIDIAN_RAG_DB=/absolute/path/to/Obsidian-RAG-with-Claude-mcp/.rag_data/my_vault" -e "OBSIDIAN_RAG_MODEL=all-minilm:22m" -e "OBSIDIAN_RAG_COLLECTION=obsidian_notes" -- uv --directory /absolute/path/to/Obsidian-RAG-with-Claude-mcp run obsidian-rag-mcpEach MCP process starts a non-blocking incremental refresh. A cross-process file lock prevents Claude Desktop and Claude Code from writing to Chroma at the same time.
Privacy and safety
Vault scanning, embeddings, and Chroma storage run locally.
The MCP server is read-only and cannot create, edit, or delete notes.
read_noterejects absolute paths, traversal, hidden directories, non-Markdown files, and symlink escapes.Passages returned by
search_notesorread_noteare sent to Claude when Claude invokes those tools.Do not commit
.env,.mcp.json, real vault notes, or.rag_dataindexes.Review third-party MCP server permissions before granting access to a private vault.
Limitations
Dense semantic retrieval only; no BM25, hybrid fusion, or reranker.
Chunk limits are character-based rather than tokenizer-based.
No chunk overlap is currently used.
Heading-aware structural chunking is not LLM-based semantic chunking.
Tags and links are stored as metadata but do not affect ranking.
Only Markdown is indexed; PDFs, images, Canvas files, and attachments are ignored.
Retrieval distance is not a calibrated relevance or correctness probability.
Development
uv sync --locked --all-groups
uv run pytest -q
uv build
uv run obsidian-rag --helpAutomated tests use fake embedders and do not require Ollama, Claude, or a real vault. See CONTRIBUTING.md before opening a pull request.
Security and license
Report security issues privately as described in SECURITY.md. This project is available under the MIT License.
Available Tools
3 toolsread_noteA
Read one Markdown note or an exact heading using a safe relative path.
Inputs: source (required), heading, max_chars. Returns: object
search_notesB
Semantically search indexed Obsidian notes and return cited passages.
Inputs: query (required), top_k. Returns: object
vault_statusA
Check local index availability, chunk count, and refresh state.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct operation: semantic search, direct note reading, and vault/index status. There is no overlap or ambiguity between them.
search_notes and read_note follow a clear verb_noun pattern, but vault_status is a noun phrase rather than get_vault_status or check_vault_status. This is a minor deviation from an otherwise consistent snake_case convention.
Three tools is appropriate for a focused RAG server covering search, retrieval, and system status. No tool feels redundant or missing enough to bloat the surface.
The core read/search/status workflow is well covered for a read-only Obsidian RAG server. A possible minor gap is the lack of an explicit refresh/reindex action, though the status tool reports refresh state.
Maintenance
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Notes and memory assistant: one Markdown vault that Claude, ChatGPT and any MCP client can share.
Search your Obsidian vault to quickly find notes by title or keyword, summarize related content, a…
Search your Glasp web and Kindle highlights, notes, and AI memories from any MCP client. Read-only.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides Claude with read, search, and write access to an Obsidian vault through MCP tools.7,721 npmApache 2.0
- FlicenseNot gradedqualityCmaintenanceEnables reading, writing, searching, and managing Obsidian vault notes through MCP tools and prompts, allowing AI agents to interact with local knowledge bases.-
- AlicenseNot gradedqualityDmaintenanceEnables Claude to read, write, search, and manage an Obsidian vault with tools for notes, tags, folders, and full-text search.21 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude to read, search, and analyze your entire knowledge vault locally via MCP tools like search, drafting, and linting.102 npm7MIT