Obsidian MCP Server
It lets an AI agent search, read, summarize, index, and manage an Obsidian vault locally.
Search/read/list vault notes, use hybrid keyword/vector retrieval, and view vault/index stats.
Collect topic-focused contextual memory packets with compression, optional vault-note saving, memory loading, and batch continuation.
Trigger full vault re-indexing for vector search.
Generate and write/update Markdown frontmatter properties.
Create or update documents with AI-generated properties in a two-step workflow.
Organize linked attachments into folders and rewrite Markdown links.
Enables AI agents to explore and manage local Obsidian vault documents through tools for searching, reading, creating documents with auto-generated frontmatter properties, and organizing attachments by automatically moving linked files to appropriate folders.
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 MCP Server search for notes about AI agents and knowledge bases"
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 MCP Server
obsidian-mcp-server is an MCP server that allows AI agents to browse, search, and summarize Markdown documents in an Obsidian Vault.
Beyond simply reading documents, this project provides local hybrid search using transformers.js and includes an interactive CLI AI Agent UI that allows you to chat with your Vault directly from the terminal.
Key Features
π Hybrid Search: Combines keyword search with semantic (vector) search, providing optimal results through RRF (Reciprocal Rank Fusion) and Reranking.
π Zero-Dependency Local AI: Uses
@huggingface/transformersto run embedding and reranking models directly within the Node.js process (no external API server required).π¬ Built-in CLI Agent: Provides a terminal-based UI that uses MCP tools to ask questions about Vault content and receive answers. View Details
π¦ Token Optimization: Offers various compression modes and output limits to control the AI agent's token usage.
Related MCP server: Obsidian MCP
What You Can Do (MCP Tools)
Integrated Search (
vault,action="search"): Performs keyword and semantic-based searches simultaneously to find highly relevant documents.Read Document (
vault,action="read"): Retrieves the content and metadata of a specific note.List and Stats (
vault,action="list_all"|"stats"): Checks the overall status and file list of the Vault.Collect Context (
vault,action="collect_context"): Generates high-density knowledge packets related to a specific topic.Load Knowledge (
vault,action="load_memory"): Recalls saved memory snapshots.Frontmatter Management (
generate_property|write_property): Generates and applies AI-based metadata.Organize Attachments (
organize_attachments): Automatically moves images within documents to a dedicated folder and updates links.
Installation and Setup
1. Prerequisites
Node.js: v22.0.0 or higher
Obsidian Vault: You must know the absolute path.
2. Install Local AI Models (Required)
To enable semantic search and reranking features, you must download the necessary local models using the command below:
# λ‘컬 μλ² λ© λ° λ¦¬λνΉ λͺ¨λΈ μ€μΉ
npx @sunub/obsidian-mcp-server setupOr, if you have already installed the package:
obsidian-mcp-server setupThis command downloads the Xenova/paraphrase-multilingual-MiniLM-L12-v2 (embedding) and Xenova/bge-reranker-base (reranking) models and saves them to the local cache.
3. Environment Variable Setup
Environment Variable | Default | Role | Required |
| β | Absolute path to the Obsidian Vault | Required |
|
| Chat model API endpoint for CLI UI | Required for CLI |
|
| Model name to use for chat | Required for CLI |
|
| Log level ( | Optional |
MCP Client Configuration Example
In each client configuration, modify env.VAULT_DIR_PATH to your own Vault path.
Claude Desktop / Cursor / Copilot
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["-y", "@sunub/obsidian-mcp-server@latest"],
"env": {
"VAULT_DIR_PATH": "/Users/username/Documents/MyVault"
}
}
}
}How Hybrid Search Works
To capture semantic relationships that are difficult to find with traditional keyword search alone, it goes through the following pipeline:
Keyword Search: Extracts exact word matching results via the internal
Indexer.Vector Search: Searches for semantically similar chunks using LanceDB and
transformers.jsembeddings.RRF Fusion: Merges the rankings of both search results using the Reciprocal Rank Fusion algorithm.
Local Reranking: Re-evaluates the merged top results with the
BGE Rerankermodel to determine the final ranking.
If the models are not installed, it automatically operates in keyword-only mode and displays a message in the terminal recommending the execution of npx @sunub/obsidian-mcp-server setup.
Interactive CLI AI Agent UI
This project includes a terminal-based AI chat interface optimized for Obsidian Vault.
Features
RAG Integration: Automatically collects relevant context from the Vault when asked a question and passes it to the LLM.
Real-time Streaming: Renders the LLM's response and "thought process ()" in real-time.
Slash Commands: MCP tools such as
/search,/read, and/indexcan be called directly as commands from the CLI.Multi-MCP Management: Monitors the status and tool list of all connected MCP servers.
How to Run
Run Chat Model Server: Start a server like
llama.cpporOllamain OpenAI-compatible mode.Example:
llama-server -m models/gemma-2-9b-it.Q4_K_M.gguf --port 8080
Run CLI:
# νκ²½λ³μμ ν¨κ» μ€ν VAULT_DIR_PATH="/your/vault" LLM_API_URL="http://localhost:8080" npx @sunub/obsidian-mcp-server
Slash Command Help
/search <keyword>: Execute hybrid search/read "filename": Read a specific document/stats: Check Vault status/index: Force re-indexing of the vector DB/tools: View a list of all available MCP tools/help: View help
License
Apache-2.0
Available Tools
5 toolscreate_document_with_propertiesCreate Document with PropertiesAInspect
Starts and completes a two-step workflow for AI-generated frontmatter properties.
Step 1: Call this tool with sourcePath (and optional outputPath). It returns a structured instruction payload and a content preview for AI analysis. Step 2: Call this same tool again with aiGeneratedProperties. The tool then writes those properties by executing the same write logic used by the 'write_property' tool.
Use this tool when an AI agent should orchestrate analysis and write in a consistent workflow.
Inputs: sourcePath (required), quiet, overwrite, outputPath, +1 more.
generate_propertyGenerate Obsidian PropertyAInspect
Reads a target markdown document and returns an AI-facing payload for generating frontmatter properties.
This tool does not write to disk. It returns content_preview and a target output schema so an AI can produce a valid property object.
Use Cases:
After completing a draft, when you need property suggestions from content.
When missing frontmatter fields (title, tags, summary, slug, date, category, completed) should be generated.
To apply generated properties to a file, call 'write_property' with the resulting JSON.
Inputs: filename (required), overwrite.
organize_attachmentsOrganize AttachmentsAInspect
Scans a specified markdown file for linked images (or other attachments), moves them to a dedicated folder named after the document's title, and updates the links within the markdown file automatically.
Use Cases:
When a post is finalized and you want to clean up all associated images into a neat folder.
To automatically organize attachments for better vault management.
Example Workflow:
Specify 'my-awesome-post.md' as the fileName.
The tool finds the 'title' property in the frontmatter (e.g., "My Awesome Post").
It finds all image links like ![[my-image.png]].
It creates a folder at '{vault}/images/My Awesome Post/'.
It moves 'my-image.png' into that new folder.
It updates the link in the markdown file to ![[images/My Awesome Post/my-image.png]].
Inputs: keyword (required), quiet, destination, useTitleAsFolderName.
vaultObsidian Content GetterAInspect
Retrieves and searches the content of Markdown (.md, .mdx) documents stored in an Obsidian vault. Use this tool to find notes related to a specific topic or keyword and understand their core content.
When to use:
When you need to find a specific note by its title or a keyword to check its content.
When you want to synthesize and summarize information scattered across multiple notes.
When looking for answers to questions based on your saved records, such as "What was the project deadline?"
To discover connections by finding all notes that link to a specific note.
When you need to retrieve a list of unfinished tasks (- [ ]) from daily notes or meeting minutes.
Use "index_vault_to_vectordb" to manually trigger a full re-indexing of the vault for the vector database.
Returns the content of the most relevant document(s) in text format. It can also include metadata such as the document's title, tags, and creation date.
Requirements: The user's Obsidian Vault path must be correctly configured in an environment variable or a similar setting. For searches, use the exact filename or include core keywords for content-based queries.
IMPORTANT INSTRUCTION FOR AI: If the tool response includes a 'diagnostic_message' (usually found at the beginning of the text or in a <system_directive> tag), you MUST relay this information to the user exactly once. It contains essential advice on how to improve search quality by running a local setup script via 'npx @sunub/obsidian-mcp-server setup'. Do not ignore it.
Inputs: action (required), limit, query, quiet, +14 more.
write_propertyWrite Obsidian PropertyAInspect
Description: Adds or updates properties within the frontmatter section at the top of a specified Obsidian markdown file. This tool is primarily used to apply metadata generated by the 'generate_property' tool to an actual file.
Parameters:
filePath (string, required): The path to the target markdown file to which properties will be added or updated. Example: "my-first-post.md"
properties (object, required): A JSON object containing the key-value pairs to be written to the file's frontmatter. If a property with the same key already exists in the file, it will be overwritten with the new value.
Example:
JSON { "title": "Optimizing I/O Handling in a Serverless Environment", "date": "2025-04-03", "tags": ["serverless", "optimization"], "summary": "A case study on optimizing I/O in a serverless environment by benchmarking Promise.all and Workers.", "completed": true }
Return Value:
Upon successful execution, it returns a JSON object containing the status, a confirmation message, and the property object that was applied to the file.
Example:
JSON { "status": "success", "message": "Successfully updated properties for my-first-post.md", "properties": { "title": "Optimizing I/O Handling in a Serverless Environment", "date": "2025-04-03", "tags": ["serverless", "optimization"], "summary": "A case study on optimizing I/O in a serverless environment by benchmarking Promise.all and Workers.", "completed": true } }
Dependencies & Requirements:
Input Data: The properties parameter should typically be the JSON object output from the 'generate_property' tool.
Environment Setup: The absolute path to the user's Obsidian Vault must be correctly set as an environment variable.
Inputs: filePath (required), properties (required), quiet.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Several tools have overlapping boundaries: generate_property and create_document_with_properties both handle AI-generated frontmatter analysis, while write_property and create_document_with_properties both perform the write step. Only vault and organize_attachments are clearly distinct.
Most tools follow a clear verb_noun snake_case pattern like write_property and organize_attachments, but 'vault' breaks the pattern as a noun-only tool name. The naming is otherwise consistent and readable.
Five tools is a reasonable size for an Obsidian-focused server, but the functionality of generate_property, write_property, and create_document_with_properties overlaps enough that the set feels slightly padded. Still, the overall count is well within an appropriate range.
The tool set covers vault search/read, frontmatter generation and writing, and attachment organization, but lacks broader note lifecycle operations such as creating a simple note, editing note body content, deleting files, or listing vault contents. The metadata workflow is mostly complete, but general note management has notable gaps.
Maintenance
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Open-source Obsidian for MDX - edit local docs with agent assistance
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analyβ¦
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to read, write, search, and navigate Obsidian vault notes with support for CRUD operations, full-text search, graph navigation, daily notes, and frontmatter management.3,650 npm-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage Obsidian vaults through full CRUD operations, wikilink management, and section-level manipulation. It supports frontmatter editing, tag-based searching, and automated link updates to maintain vault integrity.MIT
- AlicenseAqualityAmaintenanceStandalone MCP server for Obsidian vaults - hybrid search (FTS5 + vector + reranking), files in agent-readable form (images, PDFs, canvases, HTML, scripts, data files), Kanban-aware tasks (Tasks-plugin + Dataview formats), structured memory with topic recall, fine-grained read/write tools, and link graph support. Run locally, self-host, or one-click deploy for remote access. OAuth 2.1.163539MIT
- AlicenseBqualityNot gradedmaintenanceEnables AI assistants to search, create, and manage notes in an Obsidian vault via 40+ local tools.5213 npmMIT