obsidian-pkm
This server gives Claude Code persistent, structured access to an Obsidian vault — reading, writing, searching, querying, and navigating notes via MCP tools.
Read & inspect notes —
vault_read(by heading, line range, chunk, tail, or tail sections, with auto-redirect for huge files) andvault_peek(metadata, frontmatter, heading outline with line numbers, preview).Create & edit —
vault_write(14 enforced templates with validated frontmatter),vault_append(positional inserts under/around headings),vault_edit(exact string replacement),vault_update_frontmatter(atomic YAML field updates with type-aware enum validation).Search & discover —
vault_search(keyword, folder-scoped),vault_query(frontmatter filters: type, status, tags, dates, custom fields, smart sorting),vault_tags(tag counts, glob patterns, optional inline tags).Browse —
vault_list(glob/recursive) andvault_recent(recently modified files).Graph & links —
vault_links(incoming/outgoing),vault_neighborhood(BFS wikilink traversal, optionally with semantic neighbors),vault_add_links(annotated wikilinks with dedup),vault_link_health(orphans, broken, weak, ambiguous links).Organize —
vault_move(rename/move with automatic wikilink rewriting; folders too) andvault_trash(soft-delete to.trash/with broken-link warnings).Session memory —
vault_activityqueries or clears a cross-session log of every tool call with timestamps, session IDs, and arguments.
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-pkm search my vault for notes about distributed systems"
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.
Vault PKM
Give Claude persistent, structured memory across conversations using your Obsidian vault. Read, write, search, and navigate your knowledge base — all from within Claude Code.
Under the hood, this Claude Code plugin provides 20 MCP (Model Context Protocol) tools for note creation, semantic search, graph traversal, metadata queries, and session memory — plus agents, hooks, and skills for seamless workflow integration. Published on npm as obsidian-pkm.
If you find this useful, please star the repo — it helps others discover the plugin.
Why
Claude Code has built-in memory, but it's flat text files scoped to individual projects — no structure, no search beyond exact matches, no connections between notes, and no way to query across projects. As knowledge grows, it doesn't scale. This server replaces that with a proper PKM layer: structured notes with enforced metadata, semantic search, a navigable knowledge graph, and cross-project access through a single Obsidian vault.
Structured session memory — Every tool call is logged with timestamps and session IDs, so Claude can recall exactly what was read, written, and searched in previous conversations — not just what was saved to a text file.
Structured knowledge creation — ADRs, research notes, per-session devlog notes, and tasks are created from enforced templates with validated frontmatter — not freeform text dumps. Your vault stays consistent and queryable.
Semantic discovery — "Find my notes about caching strategies" works even if you never used the word "caching." Conceptual search surfaces relevant knowledge that keyword search misses.
Graph-aware connections — Claude explores your knowledge graph by following wikilinks, discovering related notes by proximity rather than just content. Link suggestions help weave new notes into your existing web of knowledge.
Knowledge capture — Decisions, tasks, and research findings are captured by specialized agents in the background without interrupting your coding flow.
Without this, knowledge stays fragmented across per-project memory files and chat logs. With it, your AI assistant maintains a unified knowledge base that compounds over time.
How It Compares
Vault PKM | Claude built-in memory | ||
Knowledge base | Your Obsidian vault (markdown files you own) | Compressed conversation logs ( | CLAUDE.md + auto-memory files |
Scope | Cross-project (one vault for everything) | Per-project | Per-project (git-repo scoped) |
Semantic search | OpenAI embeddings | — | — |
Graph traversal | Wikilink BFS, link health audits | — | — |
Structured notes | 14 templates with validated frontmatter | Plain markdown | Plain markdown |
Metadata queries | Filter by type, status, tags, dates, custom fields | — | — |
Session memory | Activity log (every tool call with timestamps) | Tiered daily summaries (Haiku-compressed) | Manual (user writes CLAUDE.md) |
Setup effort | Medium (vault path + optional OpenAI key) | Low (auto hooks, no config) | None (built-in) |
MCP tools | 20 | 0 (hooks-based) | 0 |
Agents | 3 (explorer, capture, auditor) | 0 | 0 |
remember is great for lightweight session continuity with minimal setup. Vault PKM is for developers who want a structured, searchable, interconnected knowledge base that grows with every project.
Related MCP server: obsidian-ai-curator
Features
Knowledge Creation & Editing
Tool | Description |
| Create notes from templates with enforced frontmatter (ADRs, research, devlogs, tasks, etc.) |
| Add content to notes, with positional insert (after/before heading, end of section; the heading must be unique) |
| Surgical string replacement for precise edits |
| Atomic YAML frontmatter updates (set, create, remove fields; validates enums by note type) |
Discovery & Search
Tool | Description |
| Full-text keyword search across markdown files |
| Conceptual similarity search via OpenAI embeddings — finds related notes even with different wording |
| Query by YAML frontmatter (type, status, tags, dates, custom fields) with sorting |
| Discover all tags with per-note counts; folder scoping, glob filters, inline tag parsing |
| Suggest relevant notes to link based on content similarity |
Graph & Connections
Tool | Description |
| Wikilink analysis (incoming and outgoing links for a note) |
| Graph exploration via BFS wikilink traversal — discover related notes by proximity |
| Add annotated wikilinks to a note's section with deduplication |
| Audit link quality — find orphans, broken links, weak connections, ambiguous links |
Reading & Navigation
Tool | Description |
| Read note contents (pagination by heading, tail, chunk, line range; auto-redirects large files). Output is capped with a hint for reading on; a duplicated heading returns an error listing its line numbers |
| Inspect file metadata and structure without reading full content; the heading outline shows line numbers and pages 50 headings at a time ( |
| List files and folders |
| Recently modified files |
Organization & Maintenance
Tool | Description |
| Move/rename notes with automatic wikilink updating across the vault. Moving a folder does not rewrite links that pointed at the notes inside it |
| Soft-delete a note to |
Session Memory
Tool | Description |
| Cross-conversation memory — logs every tool call with timestamps and session IDs (summarised arguments, 90 days by default) |
Agents, Skills & Commands
Agents (3) run autonomously in foreground or background:
Agent | Purpose |
| Research what the vault already knows about a topic |
| Devlog notes + knowledge capture when a PR is opened and after work blocks; a hook hands it the project and the new session activity, and it keeps a little memory of durable capture lessons across sessions |
| Audit vault link health after bulk note changes |
Skills (6) are guided workflows triggered by slash commands:
Skill | Purpose |
| Duplicate checking, location and template choice, and link discovery when creating a note |
| Graph + semantic exploration to map existing knowledge on a topic |
| The capture workflow |
| Fast task capture from a title with duplicate detection, priority shorthands, and due date |
| Surface open tasks as a numbered list with git completion hints; batch-update via shorthand (e.g. |
| Work a task end-to-end: read, explore vault context, route to the right workflow tier, close when done |
Commands (2) for setup and configuration:
Command | Purpose |
| Configure vault path, API keys, and permissions |
| Link a code repository to a vault project folder through the project's |
| Split a project's single-file |
Prerequisites
Node.js >= 20 (uses native
fetchand ES modules). Node 20 reached end-of-life in April 2026, so Node 22 or 24 is recommended; CI tests 20, 22 and 24.An MCP-compatible client such as Claude Code
The two native dependencies normally install without a compiler: better-sqlite3 downloads a prebuilt binary at install time when one exists for your Node version and platform, and sqlite-vec ships prebuilt packages for macOS (x64/arm64), Linux (x64/arm64) and Windows x64. If no prebuilt better-sqlite3 binary matches, npm compiles it from source, which needs C++ build tools — see Troubleshooting.
Quick Start
1. Install the Plugin
claude plugin marketplace add anthropics/claude-plugins-community
claude plugin install vault-pkm@claude-community2. Configure
Run the setup skill in Claude Code:
/vault-pkm:setupThe setup skill walks you through vault path, API keys, tool permissions, and verification. Hooks are registered automatically by the plugin system.
Important: Restart your Claude Code session after setup completes so the MCP server picks up the new configuration.
3. Scaffold Your Vault (optional)
If you need templates and the PARA folder structure, run the vault scaffolding wizard:
npx obsidian-pkm initThis is separate from the plugin install above — it only sets up your vault's directory structure (PARA folders, note templates). Nothing is written until you confirm each step.
Note: The first
npxrun downloads and compiles native dependencies, which may take 30-60 seconds. Subsequent runs are instant.
Step 1 — Vault path. Point to an existing Obsidian vault or create a new one. The wizard resolves ~, $HOME, and relative paths automatically. Safety checks prevent using system directories (/, /home, etc.) as a vault. For existing non-empty directories you can use it as-is, create a subfolder inside it, or wipe it (with triple confirmation). You'll be offered an optional backup before any changes.
Step 2 — Note templates. Copies template files into <vault>/05-Templates/. Three options:
Full set — all 14 templates (
adr,daily-note,devlog,devlog-session,fleeting-note,literature-note,meeting-notes,moc,note,permanent-note,project-index,research-note,task,troubleshooting-log)Minimal — just
note.md(a single generic template)Skip — for users with their own templates
Existing templates are never overwritten.
Step 3 — PARA folder structure. Creates 7 top-level folders with _index.md stubs:
Folder | Purpose |
| Quick captures and unsorted notes |
| Active project folders |
| Ongoing areas of responsibility |
| Reference material and reusable knowledge |
| Completed or inactive items |
| Note templates |
| System configuration and metadata |
Each _index.md has type: moc frontmatter. Existing folders and index files are skipped.
4. Verify It Works
Open Claude Code and try:
List the folders in my vault
Claude should call vault_list and show your vault's directory structure. If it works, the server is connected and ready.
5. Enable Semantic Search (optional)
Add your OpenAI API key to ~/.claude/settings.json under the env block:
{
"env": {
"VAULT_PATH": "/path/to/vault",
"VAULT_PKM_OPENAI_KEY": "sk-your-key-here"
}
}Use VAULT_PKM_OPENAI_KEY (preferred) to avoid conflicts with project-level OpenAI keys. OPENAI_API_KEY is also accepted as a fallback. The previously-documented OBSIDIAN_PKM_OPENAI_KEY still works as a deprecated fallback — plan to rename it in your config. Restart Claude Code after saving.
Optional: VAULT_PKM_VAULT_NAME — overrides the vault name used in obsidian:// links emitted in tool output. Defaults to basename(VAULT_PATH), which is correct for most setups. Set this only if your on-disk folder name differs from the vault name you registered in Obsidian (e.g. VAULT_PATH=/Users/me/Notes but Obsidian shows the vault as My PKM).
Optional: VAULT_PKM_ACTIVITY_RETENTION_DAYS — how many days vault_activity keeps entries (default 90; 0 keeps everything). Older entries are deleted when the server starts. An activity log from a version before 4.0 keeps everything until you agree to trim it (see Finishing the upgrade), except that while this variable is set, its window applies.
This enables vault_semantic_search and vault_suggest_links. Uses text-embedding-3-large with a SQLite + sqlite-vec index stored at .obsidian/semantic-index.db. The index rebuilds automatically — delete the DB file to force a full re-embed.
If OpenAI rejects the key or the account runs out of credits, the index switches to a disabled state instead of silently going stale. Semantic tools then answer Semantic search disabled since <date>: <reason>, each call retries the API once, and the index re-enables and catches up by itself as soon as a request succeeds. The session-start summary line, npx obsidian-pkm doctor and the server's startup log show the status, the reason and how many notes are stale. When notes have changed since they were last indexed, semantic search results end with a footer saying so.
The server works with any Obsidian vault. The included templates assume this layout:
Vault/
├── 00-Inbox/
├── 01-Projects/
│ └── ProjectName/
│ ├── _index.md
│ ├── planning/
│ ├── research/
│ └── development/decisions/
├── 02-Areas/
├── 03-Resources/
├── 04-Archive/
├── 05-Templates/ # Note templates loaded by vault_write
└── 06-System/Templates
vault_write loads all .md files from 05-Templates/ at startup and enforces frontmatter on every note created. Run npx obsidian-pkm init to install them automatically, or copy the files from templates/ manually.
14 included templates: adr, daily-note, devlog, devlog-session, fleeting-note, literature-note, meeting-notes, moc, note, permanent-note, project-index, research-note, task, troubleshooting-log. Add your own templates to 05-Templates/ and they become available to vault_write automatically.
A template missing from your vault's 05-Templates/ falls back to the copy bundled with the plugin, so devlog-session works in vaults set up before it existed. A copy in your vault always wins over the bundled one. A vault set up before devlog.md became a hub still has the old devlog template, which would create a hub without its table: delete 05-Templates/devlog.md (the bundled hub template then applies) or replace it with the package's templates/devlog.md. obsidian-pkm doctor warns while the old one is there.
Task notes enforce status (pending, active, done, cancelled) and priority (low, normal, high, urgent) enums. All other note types accept any string values for these fields.
CLAUDE.md for Your Projects
Most repos need no CLAUDE.md content for the vault: run /vault-pkm:init-project to link the repo, and the plugin supplies the rules (see Project resolution under How It Works). sample-project/CLAUDE.md is an 8-line optional template for the cases that need a file: a commented-out # PKM: line to enable for a repo with no remote, and a place for repo-specific notes.
Module dependencies:
graph LR
CC[Claude Code] -->|MCP protocol| IDX[index.js]
IDX --> HND[handlers.js]
IDX --> T[tools.js]
IDX --> E[embeddings.js]
IDX --> A[activity.js]
HND --> H[helpers.js]
HND --> G[graph.js]
HND --> U[utils.js]
HND --> VFS[vault-fs.js]
HND --> MD[markdown.js]
HND --> FM[frontmatter.js]
HOOKS[hooks/] --> MD
HND -->|read/write| V[(Obsidian Vault)]
E -->|embeddings API| OAI[OpenAI]
E -->|vector store| DB[(SQLite + sqlite-vec)]
A -->|activity log| DB2[(SQLite)]File layout:
├── index.js # MCP server setup, request routing, lifecycle
├── tools.js # MCP tool definitions (names, descriptions, input schemas)
├── handlers.js # Tool handler implementations
├── helpers.js # Pure functions (filtering, templates, peek); re-exports path and frontmatter helpers
├── vault-fs.js # File access: path containment, write-target rules, live file index, atomic writes
├── markdown.js # Dependency-free markdown parsing (frontmatter split, headings, code masking), shared with hooks
├── frontmatter.js # YAML frontmatter parse/render/byte-preserving update (yaml package)
├── graph.js # Wikilink resolution and BFS graph traversal
├── embeddings.js # Semantic index (OpenAI embeddings, SQLite + sqlite-vec)
├── semantic-health.js # Dependency-free semantic index health formatting (server, hooks, doctor)
├── activity.js # Activity log (session tracking, SQLite)
├── activity-retention.js # Dependency-free record of whether an older activity log may be trimmed (server, hooks)
├── trim-activity.js # `obsidian-pkm trim-activity`: approve trimming an older activity log
├── utils.js # Shared utilities (file listing; re-exports frontmatter parsing)
├── instructions.js # Server instructions (vault rules every session receives) and the note routing table
├── cli.js # CLI entry point (routes `init` / `doctor` / `migrate-devlog` / `upgrade` / `trim-activity` or starts the server)
├── init.js # Vault scaffolding wizard (templates, PARA folders)
├── doctor.js # `obsidian-pkm doctor` setup diagnostics
├── upgrade-checks.js # Dependency-free checks for the upgrade steps an older setup left behind (hooks, doctor)
├── upgrade-dismissals.js # Upgrade steps dismissed on this device (`~/.claude/vault-pkm/upgrade-dismissals.json`)
├── upgrade.js # `obsidian-pkm upgrade dismiss` / `reset`
├── .claude-plugin/ # Plugin packaging
│ └── plugin.json # Plugin manifest (identity, version, MCP server launch config)
├── hooks/ # Claude Code hooks
│ ├── hooks.json # Hook registrations (SessionStart, SubagentStart, PostToolUse)
│ ├── session-start.js # Loads project context at session start
│ ├── resolve-project.js # Maps the working directory to a vault project (annotation, repos:, folder name)
│ ├── load-context.js # Reads the index, open tasks and newest devlog items for the context block
│ ├── upgrade-block.js # Formats the upgrade steps left into a capped block for Claude
│ ├── capture-context.js # SubagentStart: gives pkm-capture its project and new session activity
│ ├── capture-state.js # Per-session capture cursor, delta file paths and pruning
│ ├── transcript.js # Condenses a session transcript into a short digest
│ └── capture-reminder.js # Prompts pkm-capture after a successful `gh pr create`
├── agents/ # Specialized agents (vault-explorer, pkm-capture, link-auditor)
├── skills/ # PKM workflow skills (pkm-write, pkm-explore, pkm-session-end, add-task, triage-tasks, tackle-task)
├── commands/ # Slash commands (setup, init-project, migrate-devlog)
├── templates/ # Obsidian note templates
├── scripts/ # Release tooling (publish-time tag/version check)
├── tests/ # Test suite (Node.js built-in test runner)
└── sample-project/ # Sample CLAUDE.md for your reposindex.js initializes the semantic index and activity log, then injects them into createHandlers(). All paths passed to tools are relative to vault root. The server includes path security to prevent directory traversal.
How It Works
Knowledge creation is template-based. vault_write loads templates from 05-Templates/, substitutes Templater-compatible variables (<% tp.date.now("YYYY-MM-DD") %>, <% tp.file.title %>), and validates required frontmatter fields (type, created, tags). This ensures every note in your vault has consistent metadata — making it queryable, sortable, and discoverable from day one. Task notes enforce enum validation on status and priority; other types accept project, deciders, due, and source.
Knowledge discovery works at two levels. Keyword search (vault_search) finds exact terms. Semantic search embeds notes using OpenAI and finds conceptually related content — so "managing overwhelm" surfaces notes about "cognitive load" even if those exact words never appear together. The semantic index watches for file changes in real time. It lives in .obsidian/ but stays on each machine (Obsidian Sync does not carry it), so each machine builds its own index on first start.
Knowledge connections are maintained through Obsidian's [[wikilink]] graph. vault_neighborhood traverses links via BFS to discover related notes by proximity, while vault_suggest_links recommends connections you haven't made yet. vault_move rewrites wikilinks across the vault when you reorganize, and vault_trash warns about links that would break.
Session memory records every tool call with timestamps and session IDs, so Claude can recall what was read, written, or searched in previous conversations. This turns ephemeral chat sessions into a continuous thread of work.
Knowledge capture uses the pkm-capture agent to add a section to the session's own devlog note and persist PKM-worthy content from a session (decisions, research findings, tasks, bug root causes) in one pass. It is triggered automatically when you open a pull request: a PostToolUse hook watches for a successful gh pr create and asks Claude to dispatch the agent with the PR URL. You can also dispatch it manually after significant work blocks. It runs in the background on Haiku without interrupting the coding flow.
Whoever dispatches it, the capture itself goes through one path. A SubagentStart hook resolves the project, condenses the session since the previous capture into a short digest file (what you and Claude said, one line per tool call, and the first line of each error; tool output is never included) and gives the agent the project, the session and the digest path as its start-up context. The hook also records the new capture position in a small per-session state file (under $CLAUDE_PLUGIN_DATA/captures, or ~/.claude/vault-pkm/captures), so the next capture starts where this one ended and a range is normally not captured twice (two captures that start at the same moment can cover the same range). A capture that finds no project leaves the position where it was, so the first capture after you link the repo still covers that range. Claude Code's SubagentStop input carries no final message, so success can't be checked when the agent stops: the position advances when the agent starts, and a capture that fails is not retried automatically. The agent ends with a status line (Status: captured, nothing new, no project or failed - <reason>) that tells the main conversation what happened. A failed capture names its digest file in the reason, and because the position has already moved past that range, the main conversation passes that path to the next dispatch, which reads it along with its own. State files are pruned after 30 days and digests after 7, and both are readable only by your user account.
Project resolution decides which vault project a session belongs to, in this order:
A
# PKM: 01-Projects/<name>line inCLAUDE.local.md,CLAUDE.mdor.claude/CLAUDE.mdin the repo (the nearest one wins, and the main checkout's files count too in a linked worktree).A
repos:list in a project's_index.mdthat contains one of the repo's git remotes (normalised, sogit@github.com:Acme/App.gitandhttps://github.com/acme/appmatch).The folder name of the main checkout, matched against
01-Projects/case-insensitively. Linked git worktrees resolve through the main checkout, not their own folder name.
Session start shows the full project path and how it was found (via repos: …, via # PKM in …, via folder name: …). In a git repo that matches nothing it adds a hint to run /vault-pkm:init-project; an ambiguous remote (listed by two projects) says so. npx obsidian-pkm doctor prints the same resolution for the folder you run it in. Git lookups time out after 2 seconds, so a slow git never blocks a session.
Server instructions carry the vault rules the plugin used to ask each repo's CLAUDE.md to repeat: how to link notes, always create notes from a template, where each kind of note goes, when capture runs, and that session start already loads the index, open tasks and recent devlog, so there's no need to read them just to get oriented. Claude Code delivers them to every session that has the server connected, so a repo needs no ## PKM Integration section any more (an existing one is harmless and can be deleted). Subagents may not receive server instructions, so pkm-write keeps its own copy of the routing table. The vault_semantic_search description explains the score scale: embeddings compress hard, so even a verbatim title scores about 0.55-0.65 and absolute scores can't separate relevant from tangential hits.
Session context is loaded by a SessionStart hook. It injects the project's _index.md (Overview and Current Status first, up to 2,500 characters), up to 10 open tasks, and the 10 newest devlog items (session notes, migrated day notes, or the entries of an unmigrated devlog.md), newest first, about 9,500 characters in all; unused room goes to the items that need it, and long ones end with a vault_read pointer. Open tasks are the active and pending notes in <project>/tasks/, listed by file name with status, priority and due date: active first, then by priority and earliest due date, with a +N more line naming the vault_query that lists the rest. After a compaction only the project path, the open tasks and the names of the 10 newest devlog items are injected. Activity entries are kept for 90 days by default (VAULT_PKM_ACTIVITY_RETENTION_DAYS), and long arguments such as note bodies are stored as <N chars>. The path filter of vault_activity matches the stored argument exactly (full vault-relative paths, case-sensitive; a folder matches everything under it), so a short name or partial folder finds nothing.
Devlog lives in <project>/development/devlog/: each session gets its own note, YYYY-MM-DD HHmm <Title>.md, and each capture adds one section to it. development/devlog.md is the hub: a table of that folder, newest first, built with an embedded Obsidian Bases view.
Migrating an existing devlog. Projects with a single-file devlog.md keep working: session start still shows the newest entries, and new sessions write their notes beside the old file. To split the old file into one note per day, first upgrade the plugin on every device that uses the vault, because an older version would write old-style entries into the hub. Then run /vault-pkm:migrate-devlog <project> (or npx obsidian-pkm migrate-devlog <project>). It previews by default and writes nothing; add --apply (the command asks first) to write one note per day, move the original to .trash/, and turn devlog.md into the hub. Text in the old file that is not an entry is kept under ## Kept from the old devlog. If a step fails, the vault is put back as it was.
Finishing the upgrade. You don't need to remember these steps. When a session starts, the plugin checks for what an older setup left behind:
an old
05-Templates/devlog.md;a
devlog.mdthat still holds old-style entries;a
## PKM Integrationsection in the repo'sCLAUDE.md;an activity log from before 4.0 that holds entries older than 90 days. They are deleted only if you agree, by
npx obsidian-pkm trim-activity; "never" keeps them.
Anything it finds goes into Claude's context only, with the exact commands. Claude mentions it once, after your first request, and asks before running anything. Say "not now" and it comes back next session. Say "never" and Claude runs npx obsidian-pkm upgrade dismiss, which remembers the answer on that device; npx obsidian-pkm upgrade reset brings every dismissed step back. npx obsidian-pkm doctor lists each step as done, left or dismissed.
Fuzzy path resolution lets read-only tools accept short names instead of full vault paths. vault_read({ path: "devlog" }) resolves to 01-Projects/MyApp/development/devlog.md automatically (.md extension optional). Folder-scoped tools like vault_list, vault_search, and vault_query accept partial folder names — folder: "MyApp" resolves to 01-Projects/MyApp. A short name containing / must match the end of the real path (development/devlog finds 01-Projects/MyApp/development/devlog.md). Ambiguous matches return an error listing candidates; pass the full path. Write/destructive tools always require exact paths and only accept .md notes outside dot-folders.
Troubleshooting
better-sqlite3 build fails during install
npm fell back to compiling better-sqlite3 because no prebuilt binary matched your Node version and platform, and compiling needs C++ build tools: on macOS run xcode-select --install; on Debian/Ubuntu sudo apt install build-essential python3; on Windows install Visual Studio Build Tools with the "Desktop development with C++" workload. Then reinstall.
Server starts but all tool calls fail with ENOENT
Your VAULT_PATH is wrong or missing. The server validates this at startup and exits with a clear error. Run /vault-pkm:setup to reconfigure the vault path.
vault_write says "no templates available"
Run npx obsidian-pkm init to install templates, or copy the templates/ files from this repo into your vault's 05-Templates/ directory. The server loads templates from there at startup.
Semantic search not appearing in tool list
Set VAULT_PKM_OPENAI_KEY in ~/.claude/settings.json. See Enable Semantic Search. Without a key, vault_semantic_search and vault_suggest_links are hidden entirely. With a key they stay listed even while the index is disabled (for example after a quota error), so a call can re-check the API.
Server not showing up in Claude Code after install
Run claude mcp list to check. If vault-pkm is missing, reinstall the plugin: claude plugin install vault-pkm@claude-community. Then run /vault-pkm:setup to configure it.
Semantic index not updating after file changes
Notes written through the vault tools are reindexed right away. Other changes are picked up by a file watcher (fs.watch({ recursive: true }), Node.js >= 20), which restarts itself up to five times after an error, and every server start catches up on anything missed. Run npx obsidian-pkm doctor to see the index status and how many notes are stale.
Semantic search says "disabled since …"
OpenAI rejected the key (HTTP 401/403) or the account has no credits left (HTTP 429 insufficient_quota). Fix the key or add credits. The next semantic tool call retries once; when it succeeds the index re-enables and catches up on its own.
Hidden .lock / .tmp files next to notes, or sync conflicts on them
Every note write briefly creates hidden files beside the note: a lock (.<hash>.lock, plus .<hash>.takeover.lock while a stale lock is being taken over) and a staging file (.<hash>.<pid>.<rand>.tmp). They are removed within moments, but a sync or version-control tool that does not skip dotfiles can pick them up. Ignore the patterns .*.lock and .*.tmp there (for example (?d).*.lock and (?d).*.tmp in Syncthing's .stignore, or .*.lock and .*.tmp in the .gitignore used by obsidian-git). The server lets the note writes already under way finish before it shuts down. A write killed mid-way (a crash, or a forced exit) can leave one behind: it is safe to delete, the plugin treats a lock older than 10 seconds as stale, and taking over that lock removes the note's leftover staging files.
Not sure if everything is set up correctly?
Run npx obsidian-pkm doctor for a diagnostic checklist that validates your Node version, vault path, templates, API keys, and native dependencies, and lists which upgrade steps are left. It reads VAULT_PATH and the OpenAI key from your shell environment or, failing that, from the env block of ~/.claude/settings.json, and says which source it used.
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for development setup, code style guidelines, and the pull request process before submitting changes.
See CHANGELOG.md for release history, SECURITY.md to report vulnerabilities, and PRIVACY.md for how the plugin handles your data.
License
MIT
Available Tools
18 toolsvault_activityB
Query or clear the activity log. Shows tool calls made across sessions with timestamps and arguments. Use action 'query' to retrieve entries, 'clear' to delete entries.
Inputs: path, tool, limit, since, +3 more.
vault_add_linksA
Add annotated wikilinks to a note's section (default: ## Related). Skips targets the note already links to (links are resolved like Obsidian: path, path suffix, then basename). Creates the section if missing. Requires exact path. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), links (required), section, create_section.
vault_appendA
Append content to an existing file, optionally under a specific heading. When 'position' is specified, heading is required and must exist in the file. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), content (required), heading, position.
vault_editA
Edit a file by replacing an exact string match. The old_string must appear exactly once in the file for safety. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), new_string (required), old_string (required).
vault_link_healthA
Graph health report — finds orphan notes, broken wikilinks, weakly connected notes, and ambiguous links. Scans all markdown files (or a specific folder). Use to audit link quality and find notes that need better connections. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: limit, checks, folder.
vault_linksA
Get incoming and outgoing links for a note. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), direction.
vault_listA
List files and folders in the vault. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path, pattern, recursive.
vault_moveA
Move or rename a markdown note (or a folder) within the vault. Moving a note automatically updates wikilinks in all files that reference it; moving a folder does not rewrite links that pointed at the notes inside it. Both paths must be exact. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: new_path (required), old_path (required), update_links.
vault_neighborhoodA
Explore the graph neighborhood around a note by traversing wikilinks. Returns notes grouped by hop distance from the starting note, with frontmatter metadata for each node. Useful for understanding clusters, finding related context, and discovering connections. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), depth, direction, max_nodes, +2 more.
vault_peekA
Inspect a file's metadata and structure without reading full content. Returns file size, frontmatter, a heading outline with each heading's line number and section size, and a brief preview. The outline lists 50 headings at a time; a longer one ends with the outline_offset of the next page. Use this to plan which sections to read from large files. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), outline_offset.
vault_queryA
Query notes by YAML frontmatter metadata (type, status, tags, dates, custom fields, sorting). Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: tags, type, limit, folder, +7 more.
vault_readA
Read the contents of a markdown file from the vault. Supports pagination: read a single section by heading, last N lines, last N heading-level sections, chunk number, or line range. Files exceeding ~80k characters auto-redirect to peek data (file structure/outline) unless a pagination param or force=true is specified. Every pagination mode's output is capped at ~80k characters (~400k with force), cut at a line boundary with a note naming the next 'lines' range to read. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), tail, chunk, force, +4 more.
vault_recentA
Get recently modified files. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: limit, folder.
vault_searchA
Search for text across all markdown files in the vault. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: query (required), limit, folder.
vault_tagsA
Discover all tags used across the vault with per-note occurrence counts. Useful for exploring tag conventions, finding hierarchical tag trees, and understanding vault organization.
Inputs: folder, pattern, include_inline.
vault_trashA
Soft-delete a note by moving it to .trash/ (Obsidian convention). Only .md notes outside dot-folders can be trashed; folders are refused (trash the notes inside one by one). Reports files with broken incoming links as warnings. Use vault_move to relocate files instead. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required).
vault_update_frontmatterA
Update YAML frontmatter fields in an existing note. Parses existing frontmatter, updates specified fields, preserves everything else. Set a field to null to remove it. Protected fields (type, created, tags) cannot be removed. Field values are validated against the note's type (e.g. task status must be: pending, active, done, cancelled; task priority must be: low, normal, high, urgent). Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), fields (required).
vault_writeA
Create a new note from a template. Notes must be created from templates to ensure proper frontmatter. The path must be a .md file outside dot-folders (not .obsidian/, .git/ or .trash/), and an existing note is never overwritten.
Available templates:
adr: ADR-XXX: {title}
daily-note: {title}
devlog-session: Template for devlog-session
devlog: Development Log
fleeting-note: {title}
literature-note: {title}
meeting-notes: Meeting: {title}
moc: {title}
note: {title}
permanent-note: {title}
project-index: {title}
research-note: {title}
task: {title}
troubleshooting-log: {title}
Built-in variables (auto-substituted):
<% tp.date.now("YYYY-MM-DD") %> - Current date
<% tp.file.title %> - Derived from output path filename
Required: frontmatter.tags - provide at least one tag for the note.
Optional: frontmatter.session, frontmatter.status, frontmatter.priority, frontmatter.project, frontmatter.deciders, frontmatter.due, frontmatter.source (depending on template type).
Pass custom <%...%> variables via the 'variables' parameter. Paths in this tool's output are formatted as markdown links [vault-relative-path.md](obsidian://...) so users can Cmd/Ctrl-click to open in Obsidian. Preserve the link form when relaying paths to the user; pass only the bracket text (e.g. 01-Projects/Foo/note.md) to other vault tools' path arguments, never the full markdown link.
Inputs: path (required), template (required), variables, createDirs, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool targets a clearly distinct operation: read vs peek (content vs structure), write vs append vs edit (create vs add vs replace), and list vs search vs query vs recent vs tags are all separate retrieval modes. The link tools (links, add_links, neighborhood, link_health) are similarly well-separated by intent. An agent can reliably select the right tool.
All tools use a consistent vault_ prefix with snake_case, and most are verb-led (vault_read, vault_write, vault_move, vault_update_frontmatter). A few are noun-style (vault_links, vault_tags, vault_neighborhood, vault_link_health), which is readable and conventional but slightly breaks the verb_<noun> pattern.
18 tools is slightly heavy but justified for a full PKM surface spanning read/write/graph/frontmatter/search operations. Each tool earns its place with no obvious redundancy, though it is at the upper edge of a comfortable set.
Coverage is broad: content lifecycle (write/append/edit/trash/move), retrieval (list/search/query/tags/recent/peek/read), graph (links/neighborhood/health), and metadata (frontmatter). Minor gaps exist around folder management—no folder-create tool and vault_trash refuses folders—but core workflows are well covered.
Maintenance
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
Notes and memory assistant: one Markdown vault that Claude, ChatGPT and any MCP client can share.
MCP server that gives every AI tool the same memory. Save once in Claude, use it in ChatGPT, Cursor or any MCP client: your knowledge, preferences and decisions go with you, and it learns how you work.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceBuilt on Obsidian Vault, this MCP server integrates with Claude Code to provide personal knowledge management including note saving, full-text search, code graph extraction, and context resumption.1-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives Claude AI direct access to your Obsidian vault, enabling natural language search, note creation, file management, and automated workflows.10MIT
- FlicenseNot gradedqualityCmaintenanceA Python MCP server that gives Claude long-term memory and full context of everything by connecting to an Obsidian vault, enabling context retrieval, note management, and automatic graph linking.-
- AlicenseNot gradedqualityDmaintenanceBidirectional MCP server that connects Claude with an Obsidian vault, enabling note management, full-text search, graph traversal, and daily notes operations.MIT