Obsidian MCP Server
Provides tools to manage an Obsidian vault programmatically, including reading, writing, editing notes, frontmatter, tags, links, graph analysis, and organization.
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 Serverfind orphans in my vault"
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
This project is a high-performance Model Context Protocol server for Obsidian vaults. It gives AI assistants like Claude, Gemini, and Cursor ability to manage your Obsidian vault programmatically. It provides 28 tools organized into categories: read, write, edit, frontmatter, tags, links, graph analysis, and organization.
Key design principles:
Simple setup. Works directly with vault files on disk. No Obsidian plugins, no REST API, no Obsidian running in the background.
Performance. In-memory cache + real-time file watching (watchdog) enables speedy 0(1) note lookups.
Flexible. 28 tools covering reading, writing, line-by-line editing, bulk editing, graph analysis, and more.
Safety. Path traversal protection, atomic bulk operations with rollback, comprehensive test suite (139 tests).
This server is compatible with any MCP client: Claude, Gemini, Cursor, or any applications that support the MCP protocol.
Tools
Category | Tool | Description |
Read |
| List all notes in the vault (paginated) |
Read |
| Read a note by name (no .md extension needed) |
Read |
| Full-text search with regex support, path filtering, and pagination |
Read |
| Vault-wide statistics (note count, total links, folder breakdown) |
Read |
| Notes modified within the last N days |
Write |
| Create a new note, optionally in a subfolder |
Write |
| Replace a note's entire content |
Write |
| Append content to the end of a note |
Write |
| Delete a note (requires confirmation flag) |
Edit |
| Read a note with line numbers (supports ranges) |
Edit |
| Insert content after a specific line |
Edit |
| Replace a range of lines |
Edit |
| Delete a range of lines |
Edit |
| Apply multiple edits across multiple notes atomically, with automatic rollback on failure |
Frontmatter |
| Read all YAML frontmatter or a specific property |
Frontmatter |
| Set a frontmatter property (auto-detects types: lists, ints, bools) |
Frontmatter |
| Remove a frontmatter property |
Tags |
| All tags across the vault with occurrence counts (frontmatter + inline #hashtags) |
Tags |
| Find notes by tag (case-insensitive) |
Links |
| Extract all WikiLinks from a note |
Links |
| Check which links in a note point to existing vs. missing notes |
Graph Analysis |
| Vault-wide link structure summary, or per-note analysis with related note suggestions |
Graph Analysis |
| Notes with zero connections (no incoming or outgoing links) |
Graph Analysis |
| Most connected notes, ranked by total link count |
Graph Analysis |
| All notes linking to a given note |
Organization |
| Move a note to a different folder with automatic backlink updates across the vault |
Organization |
| Search for folders by name or partial match |
Organization |
| Create a new folder |
Related MCP server: Obsidian MCP Server
Setup
Prerequisites
Python 3.10+
An Obsidian vault
Install
Clone the repo and set up a Python virtual environment:
git clone https://github.com/faisalhossainnyc/obsidian-mcp-server.git
cd obsidian-mcp-server
python -m venv venvActivate the virtual environment:
macOS/Linux:
source venv/bin/activateWindows:
venv\Scripts\activate
Then install dependencies:
pip install -r requirements.txtConfigure
Copy the example environment file and set your vault path:
cp .env.example .envEdit .env and set VAULT_PATH to your vault directory (replace you with your actual username and adjust the path as needed):
macOS:
VAULT_PATH="/Users/you/Documents/My Obsidian Vault"Linux:
VAULT_PATH="/home/you/Documents/My Obsidian Vault"Windows:
VAULT_PATH="C:\Users\you\Documents\My Obsidian Vault"
Start the Server
All MCP clients (Claude Desktop, Cursor, Gemini CLI, etc.) launch the server process for you based on the config below, so you don't need to start it manually. The command field in the config tells the client how to start it.
If you want to run the server manually (e.g., to test it or debug):
source venv/bin/activate # Windows: venv\Scripts\activate
python -m src.serverYou should see output confirming the vault cache has loaded and the server is listening.
Connect to an MCP Client
This server uses the standard mcpServers configuration format supported by all major MCP clients. Add the following to your client's config file, replacing the three placeholders with your actual paths:
command— full path to the Python binary inside your venv (e.g./Users/you/Projects/obsidian-mcp-server/venv/bin/pythonon macOS/Linux, orC:\Projects\obsidian-mcp-server\venv\Scripts\python.exeon Windows)cwd— full path to the cloned repo folder (e.g./Users/you/Projects/obsidian-mcp-server)VAULT_PATH— full path to your Obsidian vault folder
{
"mcpServers": {
"obsidian": {
"command": "/path/to/obsidian-mcp-server/venv/bin/python",
"args": ["-m", "src.server"],
"cwd": "/path/to/obsidian-mcp-server",
"env": {
"VAULT_PATH": "/path/to/your/vault"
}
}
}
}Find your config file based on your client:
Client | Config File |
Claude Desktop (macOS) |
|
Claude Desktop (Linux) |
|
Claude Desktop (Windows) |
|
Gemini CLI |
|
Cursor |
|
Claude Code |
|
This server implements the Model Context Protocol (MCP), an open standard adopted by Claude, Gemini CLI, ChatGPT, Cursor, VS Code, and more. If your client isn't listed above, check its documentation for the MCP config file location. The JSON format above should work universally.
Architecture
src/
├── server.py # Entry point — initializes FastMCP + vault cache, registers tools
├── cache.py # VaultCache: in-memory index with watchdog file watcher (O(1) lookups)
├── utils.py # Shared utilities: safe_resolve(), read_note(), extract_wikilinks()
└── tools/
├── read.py # 5 tools — list, read, search, stats, recent
├── write.py # 4 tools — create, update, append, delete
├── edit.py # 5 tools — line-level editing with bulk edit + rollback
├── frontmatter.py # 3 tools — YAML frontmatter get/set/delete
├── tags.py # 2 tools — tag listing and search
├── links.py # 2 tools — WikiLink extraction and validation
├── graph.py # 4 tools — vault graph analysis (orphans, hubs, backlinks)
├── move.py # 1 tool — move with backlink updates
└── folders.py # 2 tools — folder search and creationOn startup VaultCache builds an in-memory {name → Path} index of every .md file in the vault. A watchdog file observer keeps this index in sync as files are created, deleted, moved, or renamed. every tool call does an O(1) dict lookup instead of scanning the filesystem.
All path-accepting tools use safe_resolve() to prevent path traversal attacks (e.g., ../../etc/passwd is rejected).
The bulk_edit tool reads all target files into memory before applying changes. If any write fails mid-operation, it restores every file from the in-memory backup with no partial writes.
Running Tests
./run_tests.shOr directly:
PYTHONPATH=. python -m pytest tests/ -vThe test suite uses a temporary vault fixture that rebuilds from scratch before each test, so tests are fully isolated and don't touch your real vault.
License
MIT
This server cannot be installed
Maintenance
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
- 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/faisalhossainnyc/obsidian-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server