Guide
Obsidian MCP Server: Connect Your Vault to AI Agents
An Obsidian MCP server lets a coding agent read and search your Obsidian vault as a tool — pulling notes, specs, and docs into context. There are two established servers with different trade-offs; this guide sets up both and wires them into Claude Code, Cursor, and OpenCode. Package versions verified 2026-06-21.
Before you start
- Obsidian with a vault you want the agent to access
- An MCP-capable agent: Claude Code, Cursor, or OpenCode
- For obsidian-mcp: Node.js (it runs via npx)
- For mcp-obsidian: the Obsidian "Local REST API" community plugin + uv/uvx (or pip)
Steps
- 01
Choose your approach
Two real servers, different trade-offs. obsidian-mcp (npm) reads the vault directory directly — simplest, no plugin, point it at the vault folder. mcp-obsidian (PyPI) talks to Obsidian through its Local REST API plugin — Obsidian must be open, but it goes through Obsidian's own API. Pick direct (A) for simplicity, REST (B) if you want Obsidian itself in the loop.
- 02
Option A — obsidian-mcp (direct vault access)
No plugin needed. The server takes your vault path as an argument. Verify the exact CLI arguments in the package README, then add it to your agent. For Claude Code, use the stdio add command; the server runs on demand via npx.
# Claude Code (stdio) — pass your vault path after the package name claude mcp add obsidian -- npx -y obsidian-mcp /path/to/your/vault # Verify it connected claude mcp list - 03
Option B — mcp-obsidian (via Local REST API plugin)
In Obsidian, install and enable the "Local REST API" community plugin, then copy its API key from the plugin settings. Run the server with that key in the environment. Obsidian must be running for the REST endpoint to answer.
# Claude Code — pass the plugin's API key as an env var claude mcp add obsidian -e OBSIDIAN_API_KEY=your-rest-api-key -- uvx mcp-obsidian # (uvx comes with uv: https://docs.astral.sh/uv/ ) - 04
Add it to OpenCode or Cursor
The same server works across agents — only the config format differs. OpenCode uses a local MCP block in opencode.json (command is an array). Cursor uses .cursor/mcp.json with command + args. Swap in whichever server (and args) you chose above.
// OpenCode — ~/.config/opencode/opencode.json or ./opencode.json { "$schema": "https://opencode.ai/config.json", "mcp": { "obsidian": { "type": "local", "command": ["npx", "-y", "obsidian-mcp", "/path/to/your/vault"], "enabled": true } } } - 05
Verify the agent can see your notes
Confirm the server is connected and the tools are exposed, then ask the agent something that requires your vault — e.g. "search my vault for notes about the auth rewrite." In Claude Code run /mcp; in OpenCode run opencode mcp list.
# Claude Code /mcp # OpenCode opencode mcp list
Troubleshooting
- obsidian-mcp starts but finds no notes
- The vault path is wrong or not passed. Give the absolute path to the vault folder (the directory that contains your .md files / the .obsidian folder), and confirm the exact argument format in the obsidian-mcp README — flags can change between versions.
- mcp-obsidian returns connection or 401 errors
- The Local REST API plugin must be installed AND enabled, Obsidian must be open, and OBSIDIAN_API_KEY must match the key shown in the plugin settings. The plugin defaults to HTTPS on port 27124 — check its settings if you changed the host/port.
- command not found: npx or uvx
- obsidian-mcp needs Node.js (npx ships with it). mcp-obsidian needs uv (which provides uvx) — install from docs.astral.sh/uv, or run the server with pip/python instead.
Our AI agents
From the team behind AI Coding Hub — agents that pick up where the code ends:
- AI document agentDraftlizeTurn rough notes, specs and transcripts into clean, structured docs with an AI doc agent.Try Draftlize →
- AI presentation agentDecklizeGenerate editable slide decks from a prompt or an existing doc with an AI presentation agent.Try Decklize →
- AI data agentTablizeQuery, clean and chart spreadsheets and CSVs in plain English with an AI data agent.Try Tablize →
FAQ
- Which Obsidian MCP server should I use?
- Use obsidian-mcp (npm) for the simplest setup — it reads the vault directory directly and needs no plugin. Use mcp-obsidian (PyPI) if you want access to go through Obsidian's own Local REST API plugin (Obsidian stays in the loop). Both are actively published; pick by whether you want a plugin dependency.
- Does an Obsidian MCP server need a plugin?
- It depends which one. obsidian-mcp works directly on the vault folder with no plugin. mcp-obsidian requires the Obsidian "Local REST API" community plugin (and Obsidian to be running), because it talks to that plugin's endpoint.
- Is it safe to give an agent access to my vault?
- The agent can read (and, depending on the server and tools, modify) notes in the vault you point it at. Scope it to a vault you are comfortable exposing, review which tools the server enables, and treat it like any MCP server with file access. Back up the vault before granting write access.
- Which agents work with an Obsidian MCP server?
- Any MCP-capable client: Claude Code, Cursor, OpenCode, and others. MCP is a shared standard, so the same server works across them — only the way you register it differs (claude mcp add vs opencode.json vs Cursor's .cursor/mcp.json).
Related