obsidian-mcp
Provides tools for interacting with Obsidian vaults, enabling AI agents to read, create, edit, delete, move, search notes, manage tags, frontmatter, and retrieve vault statistics.
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-mcpsearch for meeting notes"
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
Remote MCP server that gives AI agents read/write access to your Obsidian vaults. On personal machines it mounts the real local vault folders used by the Obsidian app; on server-style machines without local desktop vaults it falls back to syncing with obsidian-headless.
Installation
curl -fsSL https://raw.githubusercontent.com/hanzpo/obsidian-mcp/main/install.sh | bashThat installs the app, runs interactive setup, and prints a remote MCP config. On personal machines it uses your real desktop vaults directly and lets you choose either a temporary Cloudflare URL or a persistent Cloudflare Tunnel hostname.
Related MCP server: obsidian-codex-mcp
Which Mode Should I Use?
Laptop or desktop with the Obsidian app already installed: use local.
VPS, home server, or separate always-on machine: use production.
If local desktop vaults are detected,
obsidian-headlessis blocked on that machine to avoid sync conflicts.
Modes
Mode | Best for | Remote URL | URL stability | Infra burden | Survives reboot by default |
Local | Running on your own machine with the Obsidian app | Yes | Temporary or stable, depending on tunnel choice | Medium | No |
Production | Long-term self-hosting | Yes | Stable domain | Higher | Yes |
1. Local
Uses local desktop vaults directly.
Lets you choose a temporary
trycloudflare.comURL or a persistent Cloudflare Tunnel hostname.Persistent local mode requires a Cloudflare-managed domain.
Best for running on your own machine without
obsidian-headless.
Manage local-mode processes:
npm run setup
npm run status
npm run logs
npm run stop2. Production
curl -fsSL https://raw.githubusercontent.com/hanzpo/obsidian-mcp/main/install.sh | sudo bashUses
obsidian-headless, Caddy, and system services.Refuses to run on machines with local desktop vaults.
Best for a stable endpoint on a separate always-on machine.
If you use your own domain, point its
Arecord orAAAArecord at the server's public IP.If you use
sslip.io, no DNS changes are needed. The setup flow prefers an IPv4-based hostname when available because it is more widely reachable from clients.
Prerequisites
a machine that can stay online while you use the MCP server
for server or headless mode: an Obsidian Sync subscription and a machine without local Obsidian desktop vaults
for local mode on your own machine: the Obsidian app installed with at least one local vault configured
for persistent local mode: a Cloudflare-managed domain
Where Files Live
Install directory:
user install default:
~/.local/share/obsidian-mcpproduction install default:
/opt/obsidian-mcp
Local generated config for this install:
.envLocal runtime state for this install:
.obsidian-mcp/PID files
logs
active mode marker
mounted desktop-vault map
Headless sync mirrors:
vaults/only used when the machine is running
obsidian-headless
Real desktop vault folders:
not copied into this repo
not owned by this app
mounted directly from the paths already managed by the Obsidian app
~/.obsidian-headlessowned by
obsidian-headlessstores its auth/local sync state
not removed by
npm run uninstall
Cloudflare Tunnel resources for local mode
named tunnel and DNS route live in your Cloudflare account
not removed by
npm run uninstall
Manual Setup
If you want to install things yourself instead of using install.sh:
Clone and enter the repo:
git clone https://github.com/hanzpo/obsidian-mcp.git
cd obsidian-mcpInstall dependencies:
Local mode also needs:
brew install cloudflared # macOS
# or install cloudflared another way on LinuxHeadless/server mode also needs:
npm install -g obsidian-headlessProduction also needs:
# install CaddyRun setup:
npm run setupClient Config
Both modes print a ready-to-paste MCP config at the end. It looks like this:
{
"mcpServers": {
"obsidian": {
"type": "streamableHttp",
"url": "https://your-endpoint.example/mcp",
"headers": {
"Authorization": "Bearer <your-api-key>"
}
}
}
}Tools
Tool | Description |
| Read a note's content and metadata |
| Batch read up to 10 notes |
| Create a note with optional frontmatter |
| Append, prepend, or find-and-replace |
| Delete a note (requires confirmation) |
| Move or rename a note |
| Browse vault structure |
| Full-text search with BM25 ranking |
| Read YAML frontmatter as JSON |
| Merge or remove frontmatter fields |
| Add, remove, or list tags |
| Vault statistics and recent files |
| Outgoing wikilinks and backlinks |
Path model:
In single-vault mode, tool paths are relative to that vault root.
In mounted desktop mode,
list_directorywith an empty path shows the top-level vault aliases first, and other tool paths should be prefixed with one of those aliases such aswork/...orpersonal/....
Commands
Start with:
npm run helpRecommended commands:
Command | What it does |
| Interactive setup. Choose local or production |
| Show status for the active mode |
| Tail logs for the active mode |
| Stop the active mode |
| Restart the active mode |
| Refresh repo files and rerun setup for the active mode |
| Compile TypeScript |
| Type-check, lint, and test |
| Generate or rotate the API key |
| Safely remove obsidian-mcp setup from this machine |
Active Mode
npm run setupis the only setup entrypoint.During setup, you choose local or production.
That choice is remembered in
.obsidian-mcp/mode.After that,
npm run status,logs,stop,restart, andupdateact on the active mode automatically.If no active mode is detected, those commands tell you to run
npm run setupfirst.
Auth Notes
The printed client config uses
Authorization: Bearer <api-key>, which is the preferred option.For compatibility with some clients and transports, the server also accepts
X-API-Key,?api_key=..., and?token=....Temporary local mode uses
trycloudflare.com, so the URL can change on restart.Persistent local mode uses a named Cloudflare Tunnel hostname, so the URL stays the same, but the machine and tunnel still need to be running.
Troubleshooting
Local tunnel did not come up
npm run logsLook at .obsidian-mcp/logs/cloudflared.log.
Sync is not working
ob sync-list-remote
npm run logsIf ob login keeps asking for credentials, run it again and rerun setup.
Production HTTPS/certificate errors
If using sslip.io, make sure ports 80 and 443 are open. Caddy needs port 80 for the ACME challenge.
ufw allow 80/tcp
ufw allow 443/tcpRe-running setup
setup.sh is safe to re-run. In local mode it restarts the background MCP and tunnel processes. In production it refreshes services and configuration.
What npm run update does
refreshes the repo files
uses
git pullfor git checkoutsfalls back to downloading the latest repo archive for installer-style checkouts
reruns setup for the active mode
local stays local, production stays production
Start over safely
npm run uninstallThat removes obsidian-mcp's generated config and services from this machine after an explicit confirmation prompt, but intentionally preserves:
your real Obsidian desktop vault folders
synced vault contents under
vaults/~/.obsidian-headlessCloudflare Tunnel resources such as named tunnels and DNS routes
remote Obsidian Sync state
Uninstall vs Purge
npm run uninstallis a safe uninstall.It removes this app's generated config, runtime files, and installed services from this machine.
It does not delete your notes, your desktop vault folders, your headless state, your Cloudflare Tunnel resources, or your remote Obsidian Sync state.
If you want a real purge of synced mirrors,
~/.obsidian-headless, or Cloudflare tunnel resources, do that manually after uninstall.
Recovery
If something looks broken, start with
npm run statusandnpm run logs.If you changed configuration or updated the repo, run
npm run update.If you want to choose the mode again or rebuild local state, rerun
npm run setup.If you want to remove the app cleanly without touching note state, run
npm run uninstall.
Development
npm ci
npm run dev
npm test
npm run checkThis 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/hanzpo/obsidian-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server