Obsidian MCP Server
Provides tools for managing Obsidian vaults, including multi-vault session management, structure-aware editing, token-efficient search, and YAML frontmatter control, enabling LLMs to interact with markdown notes in a vault-aware manner.
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 MCP ServerSearch for notes about 'machine learning'"
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
Turn your Obsidian vaults into structured context sources for Claude Desktop
π Technical Deep Dive: Read the full development journey β research notes, design decisions, and iteration history.
Why This Exists
Obsidian Vaults are where my knowledge lives. But connecting them to LLMs requires more than just "read file" β you need vault-aware sessions, heading-based navigation, and token-efficient search that doesn't blow your context window.
This MCP server solves that by treating Obsidian vaults as first-class data sources for LLMs, with tools designed around how markdown actually works (structure-based, not line-number-based).
β¨ Key Features
ποΈ Multi-Vault Session Management
Configure multiple vaults in
vaults.yaml(personal, work, research, etc.)Switch active vault mid-conversation: "Use my work vault"
Session-aware context tracking across tool calls
π― Structure-Aware Editing
Traditional file operations use line numbers. Markdown uses headings.
## Project Ideas
Some content here
### Idea 1
Details about idea 1
## Resources
Links and referencesWith this server:
insert_after_heading("Project Ideas")β Adds content in the right semantic locationreplace_section("Idea 1")β Updates just that subsectiondelete_section("Resources")β Removes heading + all content until next same-level heading
π Token-Efficient Search
Searching 10 notes with full content: ~50,000 tokens πΈ
Searching with contextual snippets: ~1,500 tokens β
# Returns 3 snippets per match, ~200 chars each
search_obsidian_content("MCP server design patterns")Claude gets enough context to understand matches without burning your token budget.
π·οΈ Frontmatter Control
Read, merge, replace, or remove YAML frontmatter without touching the note body
Enforces schema validation (size limits, UTF-8, YAML-safe types)
Designed for future automations like tag management and template validation
π Quick Start
Prerequisites
Python 3.11+
One or more Obsidian vaults
Installation
# Clone the repository
git clone https://github.com/nbaradar/obsidian-mcp-server.git
cd obsidian-mcp-server
# Install dependencies with uv (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txtConfiguration
Create
vaults.yamlin the project root:
default: personal
vaults:
personal:
path: "/Users/you/Documents/PersonalVault"
description: "Primary personal vault"
work:
path: "/Users/you/Documents/WorkVault"
description: "Work projects and documentation"Add to Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"obsidian": {
"command": "/absolute/path/to/.venv/bin/python",
"args": [
"/absolute/path/to/obsidian-mcp-server/server.py"
]
}
}
}Restart Claude Desktop
You should see "π MCP" in Claude Desktop with your Obsidian tools available.
π¬ What It Looks Like
Once configured, you'll see your Obsidian tools available in Claude Desktop:
22 tools available for multi-vault note management with heading-aware operations
Additionally, you can use your preferred MCP Clients as well! Here I'm using VSCode with Copilot in Agent mode.
For more detail on how to connect VSCode to MCP, check here
You can even use it with your own Local LLM models! Here I'm running qwen3-14b using LM Studio

π Usage Examples
Basic Operations
User: "Create a note called 'Project Ideas' in my personal vault"
Claude: [uses create_obsidian_note]
User: "Switch to my work vault and list all notes"
Claude: [uses set_active_vault, then list_obsidian_notes]
User: "Search for notes about 'machine learning'"
Claude: [uses search_obsidian_content for snippets]Advanced: Structured Editing
User: "In my 'Meeting Notes' file, add today's standup under the 'Daily Standups' heading"
Claude: [uses insert_after_heading_obsidian_note]
User: "Replace the 'Action Items' section with..."
Claude: [uses replace_section_obsidian_note]
User: "Add a summary paragraph at the end of 'Project Updates' before any subsections"
Claude: [uses append_to_section_obsidian_note]
User: "Whatβs the most recent note in my Mental Health folder?"
Claude: [uses list_notes_in_folder("Mental Health", include_metadata=True, sort_by="modified")]π οΈ Available Tools
Management
Tool | Purpose |
| Discover configured vaults and current session state |
| Switch active vault for subsequent operations |
Core Operations
Tool | Purpose |
| Create new markdown file |
| Read full note contents |
| Overwrite entire file |
| Add content to end |
| Add content to beginning |
| Remove file |
| Move or rename note (optional backlink updates) |
Structured Editing
Tool | Purpose |
| Insert content below a heading |
| Append content to a headingβs section before subsections |
| Replace content under a heading |
| Remove heading and its section |
Frontmatter
Tool | Purpose |
| Return only the YAML frontmatter block |
| Merge fields into existing frontmatter |
| Overwrite the entire frontmatter block |
| Remove the frontmatter block entirely |
Discovery
Tool | Purpose |
| List all notes, optionally include metadata |
| Search note titles (supports metadata + sorting) |
| Targeted folder listing (metadata + recursion support) |
| Token-efficient content search |
| Token-efficient tag-based search |
Metadata on demand:
list_obsidian_notes,search_obsidian_notes, andlist_notes_in_folderacceptinclude_metadata=Trueto attach ISO timestamps and file sizes. The flag adds roughly 9 tokens per note, so keep it off for broad listings and enable it when you need βmost recentβ or βlargest noteβ style queries.
π§ Internal Architecture
As of v1.4.3, the codebase uses a modular package structure for better maintainability and testability:
obsidian_vault/
βββ core/ # Pure business logic (NO MCP dependencies)
β βββ vault_operations.py # Path validation and sandboxing
β βββ note_operations.py # Note CRUD operations
β βββ search_operations.py # Search and discovery
β βββ section_operations.py # Heading-based manipulation
β βββ frontmatter_operations.py # YAML frontmatter ops
β
βββ tools/ # MCP tool wrappers (thin layer)
β βββ vault_tools.py # Vault management tools
β βββ note_tools.py # Note CRUD tool wrappers
β βββ search_tools.py # Search tool wrappers
β βββ section_tools.py # Section tool wrappers
β βββ frontmatter_tools.py # Frontmatter tool wrappers
β
βββ server.py # FastMCP server initialization
βββ config.py # Configuration loading (vaults.yaml)
βββ session.py # Per-session active vault tracking
βββ models.py # Data models (VaultMetadata, etc.)Key Benefits:
Separation of Concerns: Core logic is MCP-agnostic and can be tested independently
Single Responsibility: Each module has one clear purpose
Extensibility: Add new features by extending core modules, tool wrappers auto-register
Testability: Core modules can be unit tested without MCP server infrastructure
Data Flow:
MCP tool wrapper receives request (handles context, vault resolution)
Calls corresponding core operation (pure business logic)
Core operation returns structured data
Tool wrapper formats response for MCP client
ποΈ Design Principles
1. Token Efficiency First
Every tool is designed to minimize context window usage:
Snippet-based search over full-content retrieval
Heading-based navigation over full-file reads
Combined operations over multiple tool calls
Task | Naive | This Server | Savings |
βFind most recent note in Mental Healthβ | ~60k tokens | ~450 tokens | ~99% |
βFind largest filesβ | ~30k tokens | ~850 tokens | ~97% |
2. Markdown-Native Operations
Traditional editors use line numbers. This breaks with note edits. Semantic anchors (headings) remain stable as content changes.
3. Session-Aware Context
Claude can switch between vaults mid-conversation without losing state.
4. MCP Builder Compliance
All tools follow the MCP Builder Skill format β one-line summary β explanation β parameters β return schema β use/donβt-use guidance.
5. Logging and Debugging
The server uses Pythonβs logging (stderr/file) for all operations: vault switches, CRUD events, helper calls, and errors.
Logs stored in
~/Library/Logs/Claude/when running under Claude Desktop.Avoid
print()β it breaks STDIO JSON-RPC streams.Token cost tracking hooks (coming soon) will log per-operation token estimates for debugging.
6. Error Handling Philosophy
Graceful, descriptive, and safe:
Missing notes / bad paths β suggests correct tools or paths.
Malformed YAML β reports exact line/type.
Vault or filesystem errors β cites config path.
Destructive operations always confirmed by clients.
π§ͺ Testing Summary
Implementation verified across multiple real vaults and automated suites.
27 tag-search tests covering format handling, case insensitivity, metadata sorting, nested folders, AND/OR semantics, performance, and async MCP integration.
4 path-normalization regression tests ensuring dotted note titles, nested paths, uppercase
.MD, and traversal rejection behave as expected.Test command:
PYTHONPATH=. uv run --with pytest --with pytest-asyncio pytest tests/test_path_normalization.py tests/test_tag_search.py
πΏ Frontmatter Rules
Frontmatter tools operate purely on YAML blocks to save tokens and avoid unnecessary content rewrites.
Validates UTF-8 and YAML-safe types; rejects malformed or oversized metadata.
Merge semantics by default (preserve unknown keys).
Designed for future tag automation and template validation.
π Remote Access (Planned)
Currently runs via STDIO (local-only). Future versions will support HTTP transport for remote clients with optional authentication per the MCP specification.
π§ Known Limitations
No regex or property/frontmatter-based search (yet).
No SQLite indexing or caching.
No image/attachment management.
No backlink maintenance (beyond link updates on move/rename).
No HTTP transport or auth (STDIO only).
Note titles with dots are fully supported as of v1.4.2;
_normalize_note_identifierpreserves inner segments while enforcing sandbox rules.
πΊοΈ Roadmap
v1.0 β Core CRUD operations
v1.1 β Token-efficient content search
v1.2 β Structured heading-based editing
v1.3 β Improve Vault Navigation
v1.4 β Frontmatter Manipulation + Tag Search
v1.4.1 β Tag search tooling refinement (completed)
v1.4.2 β Preserve dotted note identifiers in
_normalize_note_identifierv1.4.3 β Refactor Codebase Structure
v1.5 β Pydantic Data Models for Input Validation
v1.6 β Vault-Aware Prompt Resources
v1.6.1 β Vault-Specific Templates
v2.0 β HTTP transport for remote access
See AGENTS.md for detailed development notes and architecture decisions.
π Documentation
Development Journey β Full technical writeup with research notes, debugging stories, and design iterations
MCP Overview β My research notes on the Model Context Protocol
Building Your First MCP Server β Step-by-step guide
π€ Contributing
This project is in active development. Contributions, issues, and feature requests are welcome!
Particularly interested in:
Testing on Windows/Linux (currently Mac-focused)
Additional vault sources (Notion, Roam, etc.)
Performance optimization for large vaults (10k+ notes)
π License
MIT License - see LICENSE for details.
π Acknowledgments
Built with:
FastMCP by Anthropic
Model Context Protocol specification
Inspiration from the Obsidian community's API work
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/nbaradar/obsidian-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server