obsidian-rag-mcp
Provides RAG-based search over an Obsidian vault, allowing AI agents to retrieve and answer questions from notes with source citations.
Click on "Install 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-mcpsearch my notes for information on the CIA triad"
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.
rag-obsidian-lmstudio
Fully local RAG over an Obsidian (or any markdown) vault, powered by LM Studio. Nothing leaves your machine.
Two ways to use it:
obsidian-rag— a terminal REPL: ask questions, get answers grounded in your notes with source citations.obsidian-rag-mcp— an MCP server for the LM Studio GUI: the chat model gets asearch_notestool and answers from your vault, inside the app.
Indexing is incremental: only new or edited files are re-embedded on each run.
Prerequisites
LM Studio with the local server running (Developer tab → Start Server, default
http://localhost:1234).Two models loaded:
a chat model (e.g. any Gemma / Llama / Qwen instruct model)
an embedding model (e.g.
nomic-embed-text-v1.5)
Python ≥ 3.11 and
uv(orpipx).
Related MCP server: obsidian-local-mcp
Install
uv tool install git+https://github.com/shirokoweb/rag-obsidian-lmstudio
# or: pipx install git+https://github.com/shirokoweb/rag-obsidian-lmstudioUse the terminal REPL
obsidian-rag --docs-dir ~/path/to/your/vaultChat: google/gemma-4-e4b
Embed: text-embedding-nomic-embed-text-v1.5
Indexed 317 chunks from /Users/you/vault
Ask a question (blank line or Ctrl-D to quit).
? What is the CIA triad?
The CIA triad is a model that helps organizations consider risk ...
sources: Module 2/25. Explore the CIA triad.md, ...
top score: 0.830Use inside LM Studio (MCP)
Add the server to LM Studio's mcp.json (Program tab → Install →
Edit mcp.json):
{
"mcpServers": {
"obsidian-rag": {
"command": "obsidian-rag-mcp",
"env": {
"RAG_DOCS_DIR": "/Users/you/path/to/your/vault"
}
}
}
}Then ask the chat model anything about your notes — it calls search_notes
and answers grounded, with source filenames.
If LM Studio can't find the command, use the absolute path (
which obsidian-rag-mcp) in thecommandfield.
Configuration
CLI flags take precedence over environment variables.
Flag | Env var | Default | Purpose |
|
| (required) | Vault / notes directory |
|
|
| LM Studio server URL |
|
| auto-detect | Chat model id |
|
| auto-detect | Embedding model id |
|
|
| Retrieved chunks per question (1–20) |
Auto-detection picks the first loaded model whose id contains embed as the
embedder and the first other model for chat. With several chat models loaded,
set RAG_CHAT_MODEL explicitly.
The embedding cache lives in your OS user-cache directory (e.g.
~/Library/Caches/rag-obsidian-lmstudio on macOS) — never inside your vault.
Deleting it is always safe; it will be rebuilt.
Troubleshooting
Symptom | Fix |
| Start the server: LM Studio → Developer tab → Start Server |
| Load an embedding model and a chat model in LM Studio |
| The chat model is too large/slow — set |
| Pass |
Stale answers after editing notes | Nothing to do — the index refreshes on every run/query |
Privacy & security notes
All traffic goes to your configured LM Studio URL (localhost by default); there are no other network calls, no telemetry.
The cache uses plain JSON + NumPy
.npz— no pickle, nothing executable.The tool only ever reads your vault; it never writes into it.
Development
git clone https://github.com/shirokoweb/rag-obsidian-lmstudio
cd rag-obsidian-lmstudio
uv sync --all-extras
uv run pytest # tests
uv run ruff check . && uv run ruff format --check .
uv run mypy src # typecheckSee SPEC.md for design decisions. MIT license.
Available Tools
1 toolsearch_notesA
Search the user's markdown notes for passages relevant to the query. Use this for any question about the user's notes, then answer using only the returned passages and cite their source filenames.
Args: query: A natural-language question or topic to search for. top_k: How many passages to return (default 4, max 20).
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| top_k | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the transparency burden. It clearly implies a read-only search operation and discloses that results are passages with source filenames. However, it does not mention edge-case behavior (e.g., no results or duplicated passages), which is a minor omission for a search tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, front-loaded with the primary purpose, and uses a clear 'Args' block for parameter details. Every sentence earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a simple 2-parameter search tool and the presence of an output schema, the description covers purpose, usage, and parameters comprehensively. It even includes post-condition instructions (cite sources), making it complete for typical use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema descriptions are absent (0% coverage), but the description fully compensates by explaining 'query' as a natural-language question and 'top_k' as a count of passages with default and max values. This adds necessary semantic meaning beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('Search the user's markdown notes for passages relevant to the query') and reinforces its role as the tool for any note-related question. The verb and resource are unambiguous, making the tool's purpose immediately clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly instructs when to use this tool ('Use this for any question about the user's notes') and how to handle the output ('answer using only the returned passages and cite their source filenames'). This provides concrete usage context, even without listing alternative tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.1- First observed
search_notes
TDQS
With only one tool, there is no possibility of confusion between tools. The single tool's purpose is clear and distinct.
The tool name 'search_notes' follows a clear verb_noun pattern. As the only tool, it is internally consistent.
A single tool is borderline. It is not trivial and serves the core purpose of searching notes, but the tool surface feels thin for a server intended to support RAG over an entire note collection.
The search tool covers the primary retrieval need. Minor gaps exist, such as no ability to list all notes or fetch a specific note directly, but these can be worked around by searching with broad queries.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.
Google Keep-style notes app with an MCP server for AI agents to read/write notes.
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.832MIT
- FlicenseNot gradedqualityDmaintenanceA local MCP server that wraps the Obsidian CLI to give AI assistants direct access to read, edit, and manage notes within an Obsidian vault. It enables advanced operations such as frontmatter property management, context-aware searching, and the execution of internal Obsidian commands.2-
- AlicenseNot gradedqualityAmaintenanceAn Obsidian plugin that runs an MCP server, enabling external LLM tools to read, search, create, and modify notes in your vault via HTTP or stdio transport.1639MIT
- FlicenseNot gradedqualityBmaintenanceMCP server that provides natural language access to an Obsidian vault, enabling reading, searching, listing, and creating notes.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/shirokoweb/rag-obsidian-lmstudio'
If you have feedback or need assistance with the MCP directory API, please join our Discord server