Obsidian MCP Server
The Obsidian MCP Server enables AI models to interact with Obsidian vaults via secure API communication, providing:
File Operations: List, retrieve, append, and update files in the vault, including hierarchical directory structures.
Search Capabilities: Perform full-text searches with context, execute complex JsonLogic queries, and filter files based on content or metadata.
Property Management: Retrieve and update YAML frontmatter properties, manage tags, titles, and custom fields.
Advanced Tools: Use JsonLogic for complex filtering, manage timestamps, and intelligently merge or replace properties.
Integration: Works with Obsidian's Local REST API plugin and provides a standardized interface via the Model Context Protocol.
Security: Offers API key authentication, rate limiting, and SSL options for secure operations.
Enables AI models to interact with Obsidian vaults through a standardized interface, providing file operations, search capabilities, and property management for knowledge bases in Obsidian
Click on "Deploy 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 Serversearch for notes about machine learning projects"
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.
Overview
Read, write, search, and surgically edit Obsidian vault notes — sections, frontmatter, tags — over the Local REST API plugin, with folder-scoped read/write permissions built in. Runs as a stdio process or a local Streamable HTTP server.
Tools
Tool | Description |
| Read a note as raw content, full structured form (content + frontmatter + tags + stat, with optional outgoing links), structural document map, or a single section. |
| List notes and subdirectories under a vault path. Recursive walk (default depth 2, max depth 20; 1000-entry cap) with optional |
| List vault tags with usage counts, including hierarchical parents. Ordered by count descending and capped at |
| List Obsidian command-palette commands, optionally filtered by |
| Search the vault by text, JSONLogic, or BM25-ranked Omnisearch (when the plugin is reachable). Results paginate via opaque cursors. |
| Create a note, replace a single section in place, or — with |
| Append content to a note. Without |
| Surgical |
| Search-replace inside a single note, scoped to the body by default. Literal or regex matching with whole-word, whitespace-flexible, and case-sensitivity options; supports capture-group replacement. |
| Atomic |
| Add, remove, or list tags. Defaults to the frontmatter |
| Permanently delete a note. Always asks the user to confirm first — the call is answered with a confirmation request and retried with the answer. |
| Open a file in the Obsidian app UI, with |
| Execute an Obsidian command-palette command by ID. Opt-in via |
Resources
Resource | Description |
| A note in the vault — content, frontmatter, tags, and file metadata. |
| All tags found across the vault, with usage counts (full snapshot). |
| Server reachability, auth status, plugin/Obsidian version info, and registered API extensions. |
Vault-note and tag data are also reachable via tools — obsidian_get_note for obsidian://vault/{+path}, obsidian_list_tags for obsidian://tags (count-ranked and capped, unlike the resource's raw snapshot). obsidian://status has no tool equivalent. Resources exist for clients that prefer attaching a note or vault snapshot to a conversation.
Related MCP server: Another bloated Obsidian MCP Server
Capability reference
obsidian_get_note tool
format: "content" | "full" | "document-map" | "section"selects the projection;fullacceptsincludeLinks: truefor outgoing wiki/markdown links (vault-internal only — external URLs are filtered)Addressed by vault
path, theactivefile, or aperiodicnote (daily/weekly/monthly/quarterly/yearly)Heading sections use
Parent::Childsyntax; a bare leaf name matching several headings returns the first match and lists every colliding path incandidatesForgiving
pathresolution: a case-mismatched path retries against the canonical filename, an ambiguous case match fails withConflict, and aNotFoundcarriesDid you mean: …?suggestions when near-matches existTyped errors include
note_missing,path_forbidden,no_active_file,periodic_unsupported/periodic_disabled, andpath_traversal
obsidian_list_notes tool
Recursive walk from
path(default vault root);depth1–20 (default 2 = target plus immediate children)Optional
extensionandnameRegex(≤256 chars, no nested quantifiers) filters; a directory failingnameRegexis skipped without recursing into itHard cap of 1000 entries per call —
excluded.reason: "entry_cap"signals a truncated walk; narrowpathor the filters to see the restPer-directory
truncated: truemarks entries cut off by the depth limit or by path policy
obsidian_list_tags tool
Vault-wide tag counts, including hierarchical parents (
work/taskscontributes to bothworkandwork/tasks)Ordered by count descending, capped at
limit(default 200, max 10000); optionalnameRegexandminCountnarrow the candidate set before rankingReports
truncated/shown/capwhen the limit withheld resultsNot narrowed by
OBSIDIAN_READ_PATHS— tag names (never note contents) can surface from outside the read scope
obsidian_list_commands tool
Lists Obsidian command-palette IDs and display names; optional
nameRegexfilters on display nameOpt-in via
OBSIDIAN_ENABLE_COMMANDS=true— absent fromtools/listwhen unsetDiscovery partner for
obsidian_execute_command
obsidian_search_notes tool
mode: "text" | "jsonlogic"always;"omnisearch"is added to the schema only when the Omnisearch plugin's HTTP server is reachable at startup (restart to re-probe)text— substring match withcontextLength-sized context windows (default 100) and an optionalpathPrefix;jsonlogic— a JSONLogic tree withvarpaths intopath/content/frontmatter.<key>/tags/stat.{ctime,mtime,size}, plusglob/regexpoperators taking[PATTERN, VALUE];omnisearch— BM25-ranked, quoted phrases,-exclusion,path:/ext:filters, typo tolerance, PDF/OCR via Text Extractor, hard-capped at 50 upstream hits (truncated: truewhen likely hit)Cursor pagination — omit
cursorfor page one, passnextCursorfrom the prior response; text-mode hits additionally clip tomaxMatchesPerHit(default 10), flagged withtruncated/totalMatchesNo dedicated backlinks tool — express "what links here" via
jsonlogic:{"regexp": ["\\[\\[Target Note(\\||#|\\]\\])", {"var": "content"}]}
obsidian_write_note tool
Without
section— full-file write; refuses to clobber an existing note unlessoverwrite: true(file_existsconflict otherwise, naming the surgical-edit tools as the alternative)With
section—PATCH-with-replace against a heading/block/frontmatter target, leaving the rest of the file untouched (overwriteis ignored); a bare heading leaf shared by several headings fails withambiguous_sectionOutput reports
created, pluspreviousSizeInBytes/currentSizeInByteson every call to spot an accidental clobber or a mistyped path
obsidian_append_to_note tool
Without
section— appends to an existing file, or creates it with the given content as the whole body (created: trueflags the second case)With
section— appends to a heading/block/frontmatter target; the file must already exist, andcreateTargetIfMissing: truebrings the section itself into existenceBlock-reference targets concatenate with no separator — include a leading newline in
contentfor onepreviousSizeInBytes/currentSizeInBytesbracket every call for drift detection
obsidian_patch_note tool
operation: "append" | "prepend" | "replace"against one heading, block reference, or frontmatter field per callHeading targets accept the full
Parent::Childpath or an unambiguous bare leaf name; a leaf matching several headings fails withambiguous_sectionand lists the candidatespatchOptions:createTargetIfMissing,applyIfContentPreexists(idempotency guard — otherwisecontent_preexists),trimTargetWhitespace
obsidian_replace_in_note tool
One or more
replacements, applied in array order, each over the previous one's outputscope: "body"(default, frontmatter left byte-identical) |"frontmatter"|"both"; frontmatter/both re-parse the rewritten YAML afterward and write nothing if it breaks (frontmatter_invalid)Per-replacement options:
useRegex(≤1024 chars, no nested quantifiers),caseSensitive,wholeWord(\b…\bin both modes),flexibleWhitespace(literal mode only),replaceAll(defaulttrue)perReplacement[]reportsbodyCount/frontmatterCountper entry;totalReplacementssums them
obsidian_manage_frontmatter tool
operation: "get" | "set" | "delete"on a single frontmatterkey;setrequires a JSON-typedvalue(string, number, boolean, array, or object)getneeds read access;set/deleteneed the path insideOBSIDIAN_WRITE_PATHSwithOBSIDIAN_READ_ONLY=falseset/deletereturn the fullfrontmatterafter the change pluspreviousSizeInBytes/currentSizeInBytes
obsidian_manage_tags tool
operation: "add" | "remove" | "list";location: "frontmatter"(default, canonicaltags:array) |"inline"(body#tag,addappends at end-of-file) |"both"(reconciles both)Inline detection skips fenced/inline code spans, link spans (
[[...]],[text](...),[text][ref]), and\#-escaped hashes, so a heading anchor or wikilink alias is never mistaken for a tagadd/removereportappliedvs.skippedtags plus the fulltagsset after the change;listignores the inputtagsarray
obsidian_delete_note tool
Always asks for confirmation first — the initial call returns an elicitation request naming the file's byte size, and is retried with the answer; declining fails with
cancelledand issues noDELETENo API-level undo — recovery requires Obsidian's local trash
Requires an MCP client that can serve an elicitation round-trip; every other tool works without one
obsidian_open_in_ui tool
failIfMissing(defaulttrue) controls open-vs-create: opening an existing file needs read access, opening a missing one (withfailIfMissing: false) creates it and needs write accessnewLeafopens in a split pane instead of the active oneSame forgiving path resolution as
obsidian_get_note(case fallback,Did you meansuggestions);obsidian_delete_notedeliberately doesn't get it — a destructive op never silently rewrites its targetOutput reports
createdIfMissingso the caller can tell which branch ran
obsidian_execute_command tool
Dispatches an Obsidian command-palette command by
commandId(discover viaobsidian_list_commands); runs with the same authority as a keyboard invocationOpt-in via
OBSIDIAN_ENABLE_COMMANDS=true— absent fromtools/listwhen unsetBehavior is command-dependent — some are destructive (delete file, close vault), some open UI
obsidian://vault/{+path} resource
The
{+path}segment captures everything after/vault/, including slashesReturns the same shape as
obsidian_get_notewithformat: "full"— content, frontmatter, tags, statGated by
OBSIDIAN_READ_PATHS/OBSIDIAN_WRITE_PATHSlike the tool equivalent
obsidian://tags resource
Full snapshot of the upstream
/tags/payload — unsorted, uncapped, includes hierarchical parentsNot a mirror of
obsidian_list_tags: no count-descending order, nolimit/nameRegex/minCount
obsidian://status resource
Reachability, plugin version,
authenticated(whether the configuredOBSIDIAN_API_KEYwas accepted), and plugin manifest infoapiExtensions[]lists registered plugin extensions — check forlocal-rest-api-periodic-notesbefore relying onperiodictargets on plugin v5.0.2 and laterStill reports reachability when the API key is misconfigured; only
authenticatedreflects the key's validity
Path policy (folder-scoped permissions)
Three optional env vars gate which vault paths each tool can target. Default unset = full vault for both reads and writes — backwards compatible.
Goal | Config |
Default (current behavior) | all unset |
Read everywhere, write only in |
|
Read only |
|
Read-only deployment — no writes anywhere |
|
Matching is prefix-based with implicit recursion, case-insensitive, with trailing slashes normalized. projects/ matches projects/a.md, projects/sub/b.md, etc.
Write paths are implicitly readable — you can't sanely edit what you can't see. So a read passes when the target matches READ_PATHS or WRITE_PATHS.
OBSIDIAN_READ_ONLY=true short-circuits before the path checks — every write tool and the command-palette pair are wrapped with disabledTool() at startup (absent from tools/list), and any write that still reaches the service is denied at runtime regardless of WRITE_PATHS.
Denies are typed path_forbidden (JSON-RPC code Forbidden) with the active scope echoed back in data.recovery.hint and data.activeScope, so the LLM can self-correct without inspecting server logs. Search results from obsidian_search_notes are filtered against READ_PATHS silently — surfacing a "we hid N hits" indicator would defeat the gate.
Tag listing is vault-wide. obsidian_list_tags and the obsidian://tags resource aggregate tag names across the whole vault and are not narrowed by OBSIDIAN_READ_PATHS — they take no path to gate, so tag names (never note contents) from outside the read scope can surface.
The startup banner logs the active scope so operators can verify their config at boot.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Obsidian-specific:
Wraps the Obsidian Local REST API plugin — typed client, deterministic error mapping
Section-aware editing across headings, block references, and frontmatter fields via
PATCH-with-target operationsSearch across three modes — text, JSONLogic, and (when reachable) BM25-ranked Omnisearch — cursor-paginated per the MCP 2025-11-25 spec
Tag reconciliation across both representations: frontmatter
tags:array and inline#tagsyntaxFolder-scoped read/write permissions via
OBSIDIAN_READ_PATHS/OBSIDIAN_WRITE_PATHSand a globalOBSIDIAN_READ_ONLYkill switch; opt-in command-palette pair gated byOBSIDIAN_ENABLE_COMMANDSServer-level
instructionsoninitializereport the active deployment — path policy, read-only mode, command-palette toggle
Agent-friendly output:
Recovery-guided errors — every declared failure carries a
reason, a JSON-RPC code, and arecovery.hintwritten for that case, so a rejection names what to do next instead of only what brokeSize-delta self-correction — every mutating tool returns
previousSizeInBytes/currentSizeInBytes, so a caller can spot an accidental clobber or unexpected upstream behavior without a follow-up readAmbiguity surfaced structurally — a heading leaf name shared by several headings returns
candidatesinstead of silently picking one; tag operations reportappliedvs.skippedso a caller sees exactly what changedDiscriminated output contracts —
formatonobsidian_get_note,operationonobsidian_manage_frontmatterandobsidian_manage_tags,modeonobsidian_search_notes— callers branch on typed fields instead of parsing text
Getting started
Add the following to your MCP client configuration file. The Obsidian Local REST API plugin must be installed and enabled in your vault — see Prerequisites.
{
"mcpServers": {
"obsidian-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["obsidian-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"OBSIDIAN_API_KEY": "your-local-rest-api-key"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"obsidian-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "obsidian-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"OBSIDIAN_API_KEY": "your-local-rest-api-key"
}
}
}
}Or with Docker:
{
"mcpServers": {
"obsidian-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-e", "MCP_LOG_LEVEL=info",
"-e", "OBSIDIAN_API_KEY=your-local-rest-api-key",
"ghcr.io/cyanheads/obsidian-mcp-server:latest"
]
}
}
}The default OBSIDIAN_BASE_URL (http://127.0.0.1:27123) points at the container's own loopback, not your host — add -e OBSIDIAN_BASE_URL=http://host.docker.internal:27123 (Docker Desktop) or run with --network host (Linux) so the container can reach the plugin.
For Streamable HTTP, set the transport and start the server. Inline env vars work for one-off runs; for repeated use, copy values into .env (see .env.example) and run bun run start:http.
MCP_TRANSPORT_TYPE=http OBSIDIAN_API_KEY=... bun run start:http
# Server listens at http://127.0.0.1:3010/mcp by defaultPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
The Obsidian Local REST API plugin, v4.0.0 through v5.x, installed and enabled in your vault. Generate an API key in Settings → Community Plugins → Local REST API and copy it into
OBSIDIAN_API_KEY. Plugin v6.0 removes the markdown-patch 1.x wire format this server pins for section-targeted writes and the document map.Periodic-note targets (
target: { "type": "periodic" }) work across that whole range: natively on plugin v5.0.1 and earlier, and on v5.0.2 and later — which moved the/periodic/routes out of the plugin — once the companion periodic-notes API extension is installed. Without that extension on v5.0.2+, periodic targets fail with aperiodic_unsupportederror naming it;obsidian://statuslists the registered extensions if you want to check first. Every other target type is unaffected.An MCP client that can answer an input request (elicitation).
obsidian_delete_notealways asks for confirmation before deleting, so a client without that support can read and write notes but cannot delete one.This server defaults to
http://127.0.0.1:27123for simplicity. Enable "Non-encrypted (HTTP) Server" in the plugin settings to use it. To use the always-on HTTPS port instead, setOBSIDIAN_BASE_URL=https://127.0.0.1:27124; the plugin's self-signed cert is handled byOBSIDIAN_VERIFY_SSL=false(the default).
Installation
Clone the repository:
git clone https://github.com/cyanheads/obsidian-mcp-server.gitNavigate into the directory:
cd obsidian-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env # edit .env and set OBSIDIAN_API_KEY
Configuration
Variable | Description | Default |
| Required. Bearer token for the Obsidian Local REST API plugin. | — |
| Base URL of the Local REST API plugin. Use |
|
| Verify the TLS certificate. Default |
|
| Per-request timeout in milliseconds. |
|
| Opt-in flag for the command-palette pair ( |
|
| Comma-separated vault-relative folder allowlist for read operations. Prefix-based with implicit recursion; case-insensitive; trailing slashes normalized. Unset = full vault. Write paths are implicitly readable. | unset |
| Comma-separated vault-relative folder allowlist for write operations. Same syntax as | unset |
| Global kill switch. When |
|
| Override URL for the Omnisearch plugin's HTTP server. When unset, derives from | derived |
| Transport: |
|
| Host for the HTTP server. |
|
| Port for the HTTP server. |
|
| Endpoint path for the JSON-RPC handler. |
|
| Session handling for the HTTP transport: |
|
| Public origin override for TLS-terminating reverse-proxy deployments (landing page, Server Card, RFC 9728 metadata). | unset |
| Auth mode: |
|
| Required when | — |
| When |
|
| Log level (RFC 5424). |
|
| Directory for log files (Node.js only). |
|
| Enable OpenTelemetry instrumentation (spans, metrics, completion logs). |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security, changelog sync bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t obsidian-mcp-server .
docker run --rm -e OBSIDIAN_API_KEY=your-key -p 3010:3010 obsidian-mcp-serverThe Dockerfile defaults to HTTP transport, stateful session mode (required for the obsidian_delete_note confirmation round), and logs to /var/log/obsidian-mcp-server. Point OBSIDIAN_BASE_URL at http://host.docker.internal:27123 (Docker Desktop) or run with --network host (Linux) so the container reaches the plugin on your host. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
The image binds to 0.0.0.0 inside the container (required for Docker port mapping). For any deployment reachable beyond your own machine, set MCP_AUTH_MODE=jwt (with MCP_AUTH_SECRET_KEY) or oauth — otherwise the listener forwards your OBSIDIAN_API_KEY to the vault on behalf of every caller.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing ( |
| Local REST API client, frontmatter operations, section extractor, domain types. |
| Tool definitions ( |
| Resource definitions ( |
| Prompt definitions (currently empty — CRUD/search shape doesn't benefit from a structured template). |
| Vitest tests mirroring |
| Upstream OpenAPI spec for the Local REST API plugin and the generated |
| Per-version release notes; |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources via the barrels in
src/mcp-server/*/definitions/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Bugs, feature requests, and documentation gaps belong in an issue — see CONTRIBUTING.md for what makes one actionable, and CODE_OF_CONDUCT.md for how we work together. Security reports go through SECURITY.md, never a public issue.
Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Securely search and manage workspace context files for AI agents and teams.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Obsidian vaults through vector search, vault indexing, and file monitoring. It provides a standardized interface for searching and managing markdown-based personal knowledge management data within the Model Context Protocol.6,222 npm1MIT
- AlicenseAqualityFmaintenanceA Model Context Protocol (MCP) server that provides AI assistants with secure access to Obsidian vaults. Enables reading, writing, searching, and managing notes without requiring Obsidian to be running.506,222 npmApache 2.0
- FlicenseNot gradedqualityCmaintenanceMCP server that provides tools and resources for AI models to interact with an Obsidian vault, enabling file operations, search, and management via the Model Context Protocol.2-
- FlicenseNot gradedqualityAmaintenanceEnables semantic search and note management for Obsidian vaults via the Model Context Protocol, allowing LLMs to search, read, and index notes, PDFs, and web pages locally.-