obsidian-mcp
Wraps the Obsidian CLI to allow an LLM agent to interact with a running Obsidian instance, enabling read/write notes, search, manage frontmatter, navigate links, run plugins, and more.
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 my vault for notes tagged 'meeting'"
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
MCP server that wraps the official Obsidian CLI so an LLM agent can drive a running Obsidian instance — read/write notes, search, manage frontmatter, navigate links, run plugins, and more.
This server is a thin, comprehensive wrapper. Every tool maps 1:1 to an obsidian CLI command.
Prerequisites
Obsidian must be running. The CLI talks to the live app over IPC; it does not read the vault on disk directly.
Register the CLI binary. In Obsidian: Settings → General → Command line interface → Register CLI. Obsidian will add
obsidianto yourPATH.Verify:
obsidian versionprints the CLI version.
Install
Two paths depending on whether you want to build it yourself or grab a pre-published version from npm.
Option A — Clone & build (works today)
Clone the repo and build locally, then point Claude Code at the built file:
git clone https://github.com/yuchichang/obsidian-mcp.git
cd obsidian-mcp
npm install
npm run buildRegister it with Claude Code (one command):
# Add (user scope — available across all projects)
claude mcp add -s user obsidian -- node /absolute/path/to/obsidian-mcp/dist/index.js
# Remove
claude mcp remove obsidian
# List configured servers
claude mcp list-s user registers it for your whole user account. Use -s project to commit it to the repo's .mcp.json instead, or -s local for the current project only (default).
Or write it into .mcp.json manually:
{
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/absolute/path/to/obsidian-mcp/dist/index.js"]
}
}
}Option B — Install from npm (zero-build)
Prerequisite: the package must already be published to npm. The maintainer publishes once via
npm publish; all subsequent users get it vianpxautomatically. If you forked this repo and want this flow under your own scope, changenameinpackage.jsonto@<your-npm-username>/obsidian-mcp, thennpm publish.
Once published, no clone or build needed:
claude mcp add -s user obsidian -- npx -y @yuchichang/obsidian-mcpOr in .mcp.json / Claude Desktop's claude_desktop_config.json:
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["-y", "@yuchichang/obsidian-mcp"]
}
}
}Override the CLI path
If obsidian isn't on PATH, set the OBSIDIAN_CLI env var. Works with either install path:
{
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/absolute/path/to/obsidian-mcp/dist/index.js"],
"env": {
"OBSIDIAN_CLI": "C:/Users/you/AppData/Local/Obsidian/obsidian.cmd"
}
}
}
}Tools
Vault & files
Tool | Wraps |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Frontmatter properties
Tool | Wraps |
|
|
|
|
|
|
Search
Tool | Wraps |
|
|
|
|
Tags & links
Tool | Wraps |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Daily notes
Tool | Wraps |
|
|
|
|
|
|
Plugins
Tool | Wraps |
|
|
|
|
|
|
|
|
Developer / advanced
Tool | Wraps | Notes |
|
| ⚠️ Runs arbitrary JS inside Obsidian. Treat as destructive. |
|
| Returns base64 PNG. |
|
| |
|
|
Meta
Tool | Wraps |
|
|
|
|
Conventions
Targeting a note — file-targeting tools accept either:
file— wikilink-style note name (e.g."My Note"), orpath— vault-relative file path (e.g."Folder/My Note.md").
Multi-vault setups — every tool accepts an optional
vaultparameter. When omitted, the most recently focused vault is used.Output format — list/search/metadata tools default to JSON for easy machine parsing.
Sensitive operations & user confirmation
The following tools are gated behind a user-confirmation step:
Tool | Reason |
| Removes data (especially with |
| Renames + rewrites wikilinks across the vault. |
| Removes frontmatter data. |
| Bulk-rewrites tags across every note. |
| Grants a community plugin code execution. |
| Runs arbitrary JavaScript inside Obsidian. |
How the gate works:
MCP elicitation (preferred). If the connected client supports the
elicitationcapability (Claude Code does), the server sends anelicitation/createrequest and the client shows the user a Proceed? prompt with the action and target spelled out. Onlyaccept + confirm: trueproceeds.Explicit
confirm: trueparameter. Every sensitive tool's input schema includes an optionalconfirm: boolean. Passingconfirm: trueskips the elicitation prompt — use this only when the caller has already obtained user approval.Refusal fallback. If the client doesn't support elicitation and
confirm: truewas not provided, the tool returns anisErrorresult that names the action and instructs the caller to retry withconfirm: true.
Bypass for batch / automation
OBSIDIAN_MCP_AUTO_CONFIRM=1Set this env var (in your MCP client's env block) to skip every confirmation prompt. Use only in fully-trusted automation contexts.
Long content & argv limits
The Obsidian CLI does not (yet) support reading parameter values from stdin or from files — every value travels on the command line. That collides with platform limits:
Platform | Practical command-line limit |
Windows (cmd.exe) | ~8,191 chars total |
macOS / Linux |
|
To stay safe, the server automatically chunks long writes:
Tool | Chunking strategy |
| First chunk via |
| Sequential |
|
|
| Resolves the daily note path, then chunked append. |
| Not chunked — JS can't be split. Returns an error suggesting the script-via-note workaround. |
Splits happen at line boundaries when possible; oversized single lines fall back to UTF-8-safe character boundaries. Reassembled content is byte-identical to the original.
Configure the per-call byte threshold (defaults: 6,000 on Windows, 100,000 elsewhere):
OBSIDIAN_MCP_MAX_ARG_BYTES=4000If a chunk in the middle of a multi-chunk write fails, the server returns isError with a clear message stating which chunks made it to disk so the caller can recover.
Develop
npm run dev # tsc --watch
npm run inspect # launch MCP Inspector against the built server
node scripts/smoke-test.mjs # initialize + tools/list smoke testHow it works
runObsidian() (src/exec.ts) shell-quotes arguments, invokes the obsidian binary via child_process.exec, and parses stdout. Most read-style tools request format=json; results are parsed to structuredContent for clients that consume structured tool output, while still returning a text representation in content.
Tool registry lives in src/tools.ts — adding a new wrapped command is a single entry there.
Reference
Obsidian CLI: https://obsidian.md/help/cli
MCP spec: https://modelcontextprotocol.io
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/yuchi-chang/obsidian-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server