obsidian-vault-mcp
Provides tools for accessing an Obsidian vault directly on disk, including full-text search, reading notes and images, listing tags, properties, links, backlinks, and daily notes, and checking sync status. In write mode it can also create notes, append or replace content, and update frontmatter properties.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
obsidian-vault-mcp
A small, auditable MCP server that gives an AI client (such as Claude) access to an Obsidian vault. It works directly on the Markdown files on disk, so Obsidian doesn't need to be running. It is meant to run on a small Linux server or container next to Obsidian Sync's headless client, behind a tunnel or proxy that handles user sign-in.
It is read-only by default. You can turn on a write mode that can create notes and edit them, but it has no tools that delete, move or rename anything.
Access modes
Set ACCESS_MODE before anything else. It decides which tools the server offers.
Mode | What the client can do |
| Search and read notes, images, tags, properties, links and daily notes. Check sync status. Nothing on disk changes. |
| Everything in |
| Reserved. The server refuses to start with it. See Future work. |
The server enforces the mode itself. In read mode the write tools are not registered, so they don't appear in tools/list, and a tools/call for one is refused whatever the client sends. A second check inside the tool runner refuses any tool above the configured mode.
Related MCP server: Obsidian MCP Server
Tools
Read tools (every mode):
Tool | What it does |
| Full-text search with ripgrep. Fixed-string by default, optional regex, case-sensitivity, folder filter and result limit. |
| A note's full text with parsed frontmatter, or just the body, the frontmatter, the outline (headings), or one heading's section. Returns a content hash. |
| An image by vault path, or one embedded or linked in a note ( |
| Notes in a folder and/or matching a glob. |
| Notes modified (or created) since a date. |
| Notes not modified since a date, for a weekly review. |
| Every tag with a note count, frontmatter and inline, nested tags in full. |
| Notes with a tag. |
| Every frontmatter key with a note count. |
| The values used for one key, with counts. |
| Notes where a key has a value, for example |
| Notes that link to a note or file. |
| Wikilinks and Markdown links in a note, and the file each one resolves to. |
| Notes that no other note links to. |
| The daily note for a date. In |
| All daily notes in a date range. |
| Whether the sync service is running, when the vault last changed, the last sync activity, and a stale flag. |
Write tools (write mode only):
Tool | What it does |
| Creates a note at a path, or in |
| Appends text to the end of a note, or to the end of a named heading's section. |
| Replaces text that must match exactly once. The client must send the note's current hash (from |
| Sets or removes frontmatter keys. Every other key, the key order and YAML comments stay as they were. |
Daily notes
The server reads the Daily Notes core plugin's settings from <vault>/.obsidian/daily-notes.json (fields folder, format and template). This file is the only thing it reads inside a dot folder, and no tool exposes it. Obsidian leaves fields out of that file when they're at their defaults, so any missing field falls back to DAILY_DIR, DAILY_FORMAT or DAILY_TEMPLATE, then to Obsidian's defaults (vault root, YYYY-MM-DD, no template). The format uses Moment.js tokens, as Obsidian does. Templates can use {{date}}, {{time}}, {{title}}, {{date:FORMAT}} and {{time:FORMAT}}.
"Today" uses the server's time zone. Set TZ in the env file if the host runs on UTC and you don't.
Stale warning
If the sync unit isn't active, or the newest file change in the vault is older than STALE_HOURS, every tool result starts with a one-line warning saying the vault may be out of date. The check is cached for a minute.
Last sync activity comes from the log that ob sync writes (sync/<vault id>/sync.log in ob's config folder). The server reads only that log's last line. It never opens ob's config.json or auth token.
Security model
Bearer auth on every request. Every HTTP request must carry
Authorization: Bearer <MCP_TOKEN>. The server hashes both values and compares them in constant time. Anything else gets a 401. The token must be at least 32 characters.Loopback only. The server binds to
127.0.0.1. Put a tunnel or reverse proxy in front of it. Requests with aHostheader not inALLOWED_HOSTSget a 403, which blocks DNS-rebinding attacks from a browser.No delete, move or rename tools. They aren't built, in any mode.
Path safety. Every path is vault-relative. The server rejects absolute paths,
.., and any dot-prefixed segment (.obsidian,.trash,.git). It resolves the real path and refuses anything outside the vault, including symlinks that lead out or into a dot folder. Writes only go to.mdfiles, never through a symlink, and never insideREADONLY_DIRS.Safe writes. Writes go to a temp file and are renamed into place. New notes are created with a hard link, which fails if the file already exists, so a create can never overwrite. One lock per file stops overlapping edits from this server. Reads and writes have size limits.
Write log. Every write logs the tool, path, byte count and SHA-256 to stdout as one JSON line, so journald keeps an audit trail.
No shell, no outbound network. ripgrep and systemctl run with
execFileand an argument array. The server makes no network calls of its own.Error messages use vault-relative paths and never include host paths or stack traces.
Local-only search (planned). The semantic search in the roadmap runs a local embedding model with no outside APIs.
Requirements
Node.js 22 or later
ripgrep (
apt install ripgrep)Linux with systemd for the sync check (the server runs elsewhere too, but
vault_statuswill report the unit asunknown)
Setup
git clone https://github.com/<you>/obsidian-vault-mcp.git /opt/obsidian-vault-mcp
cd /opt/obsidian-vault-mcp
npm ci --ignore-scripts
npm run build
sudo mkdir -p /etc/obsidian-vault-mcp
sudo cp .env.example /etc/obsidian-vault-mcp/env
sudo chown vault:vault /etc/obsidian-vault-mcp/env
sudo chmod 600 /etc/obsidian-vault-mcp/env
sudoedit /etc/obsidian-vault-mcp/env # set VAULT_DIR and MCP_TOKEN at leastGenerate a token with openssl rand -hex 32. The client (or the proxy in front of the server) sends it as a bearer token.
Configuration
All settings come from environment variables. .env.example lists every one with a placeholder.
Variable | Default | Meaning |
| required | Absolute path to the vault. |
| required | Bearer token, 32+ characters. |
|
| Port on 127.0.0.1. |
|
|
|
|
| Accepted |
| empty | Comma-separated vault-relative folders that are never written. |
| vault root | Folder for notes created with only a title. |
| empty, | Fallbacks for the Daily Notes settings. |
| system | Time zone for "today". |
|
| systemd unit to check. Empty turns the check off. |
| ob's default | Where |
|
| Age of the newest change that triggers the stale warning. |
|
| Largest image |
|
| Largest note the server reads. |
|
| Largest note the server writes. |
|
| Cap on search results. |
|
| Paths to those programs. |
Folder names are never hardcoded. Every folder the server treats specially comes from these settings or from Obsidian's own daily-notes settings.
Running with systemd
Both units are in deploy/. Adjust paths to match your system. command -v ob and command -v node give the right ExecStart paths.
/etc/systemd/system/obsidian-vault-mcp.service:
[Unit]
Description=obsidian-vault-mcp (MCP server for an Obsidian vault)
After=network.target obsidian-sync.service
[Service]
Type=simple
User=vault
Group=vault
WorkingDirectory=/opt/obsidian-vault-mcp
# chmod 600, owned by vault. Holds MCP_TOKEN, so keep it unreadable by other users.
EnvironmentFile=/etc/obsidian-vault-mcp/env
ExecStart=/usr/bin/node /opt/obsidian-vault-mcp/dist/index.js
Restart=always
RestartSec=5
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths=/home/vault/vault
# ...more hardening in deploy/obsidian-vault-mcp.service
[Install]
WantedBy=multi-user.target/etc/systemd/system/obsidian-sync.service, running Obsidian Sync continuously as the same user:
[Unit]
Description=Obsidian Sync (obsidian-headless, continuous)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=vault
Group=vault
WorkingDirectory=/home/vault/vault
ExecStart=/usr/bin/ob sync --continuous
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetThen:
sudo systemctl daemon-reload
sudo systemctl enable --now obsidian-sync obsidian-vault-mcp
journalctl -u obsidian-vault-mcp -f # start line, write log, errorssystemctl is-active works without root, so the vault user can check the sync unit.
Container hardening
If you run this in a container next to the sync client, these steps keep the vault and your credentials safe:
Use an unprivileged LXC container (or equivalent), not a privileged one.
Allow SSH keys only. Set
PasswordAuthentication noandPermitRootLogin noinsshd_config.Turn on unattended-upgrades for security updates.
Run both services as a dedicated
vaultuser. Make ob's config folder (~/.config/obsidian-headless, which holds the Obsidian auth token and vault encryption key) and the env file readable only by that user:chmod 700on the folder,chmod 600on the files.Keep encrypted backups of the vault (for example restic or borg with a passphrase stored off the host). Sync is not a backup.
Expose the server only through an authenticated tunnel or proxy. Never open its port to the internet.
Development
npm ci --ignore-scripts
./check # typecheck, tests, gitleaks scanTests run against a synthetic fixture vault in tests/fixtures/vault, copied to a temp folder for each test. They never touch a real vault.
Secret scanning: git config core.hooksPath .githooks turns on a gitleaks pre-commit hook. CI runs gitleaks over the full history on every push.
Future work
fullmode: delete and move tools, with move rewriting links across the vault the way Obsidian does. Until those exist,ACCESS_MODE=fullrefuses to start so nobody runs it by accident.Local semantic search: hybrid keyword and meaning search with a small local embedding model and a SQLite index, plus related-notes suggestions. No outside APIs.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Search, read, and safely update Markdown notes in your connected Phasoric knowledge vaults.
Search your Obsidian vault to quickly find notes by title or keyword, summarize related content, a…
Personal context for every AI: search, read, and write back to your private Markdown library.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to read, search, and manage Obsidian vault markdown files, including YAML frontmatter, wikilinks, and graph operations through a secure stateless I/O layer.MIT
- 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.4,114 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
- AlicenseNot gradedqualityCmaintenanceEnables LLM clients to read, create, edit, delete, move, and search notes in local Obsidian vaults via direct filesystem access, including tag management and support for multiple vaults.12 PyPIMIT