Obsidian MCP (pgvector + Ollama, self-hosted)
Use it as a self-hosted MCP server that turns an Obsidian vault into persistent, searchable, writable memory for agents and humans.
Search notes by exact keyword (PostgreSQL tsvector), meaning (pgvector embeddings via Ollama/OpenAI/TEI), or hybrid reciprocal-rank fusion, with folder/tag/frontmatter filters and optional reranking.
Read, list, and inspect notes with structured content, sections, offsets, truncation data, tags, frontmatter, and whole-file content hashes.
Create, edit, append to, find/replace in, section-edit, move, and delete notes atomically, with dry-run diffs, no-clobber defaults, soft-delete to
.trash/, andexpected_hashstale-read protection.Set or remove YAML frontmatter without changing the note body.
Browse, read, write, list, and delete non-markdown vault files, including images, PDFs, and binaries.
Mint short-lived upload/download links, check upload status, and import public HTTPS files directly into the vault.
Traverse the wikilink graph: backlinks, outgoing links, neighborhoods, orphans, and semantically related notes.
Manage checkbox tasks: list tasks, get an agenda, add/update/complete/move tasks, handle recurrence, and use optional Obsidian Tasks plugin emoji fields.
Discover vault-specific conventions through
get_vault_guide, which serves the Obsidian primer plus the vault'sCLAUDE.md.Track recent changes and a cursor-based change feed, including who or what made each change.
Expose all 33 tools remotely to Claude, ChatGPT, Claude Code, n8n, and other MCP clients via OAuth 2.0 PKCE or API keys, with read/readwrite scopes, multi-user vault roots, audit logs, rate limits, concurrency controls, and a control panel.
Provides tools to search, read, write, and manage an Obsidian vault, enabling AI agents to interact with notes, wikilinks, tags, and frontmatter.
Obsidian MCP Server
Your agents' memory, in the vault you already have, reachable from claude.ai, ChatGPT, Claude Code and your phone.
A self-hosted Model Context Protocol server that turns an Obsidian vault into long-term memory for every agent you use. Agents search it by meaning or by exact words, follow its wikilinks, see what changed since their last session and who changed it, keep their to-dos in it, and write back through guarded, atomic edits. 33 tools over plain markdown files that you can open, edit and grep.
What sets it apart:
Your existing vault, served in place. No imposed note format, no sidecar syntax, no "memory" folder you have to adopt. Agents read what you read, follow your wikilinks, and pick up your folder layout, frontmatter schema and tag conventions from the vault itself.
Remote and multi-user. OAuth 2.0 PKCE and API keys, so claude.ai, Claude Desktop, Claude mobile, ChatGPT, Claude Code and n8n all read and write the same files, each user confined to their own vault root.
Writes are guarded. An edit that carries
expected_hashis refused when the note changed since it was read, and a deployment can require the hash on every edit (Guarding edits against stale reads). Every publish is atomic, a create refuses a path that is already taken, deletes go to.trash/, anddry_runreturns the diff before anything lands.
Connect from Claude Code:
claude mcp add obsidian --transport http \
--url "https://obsidian-mcp.<your-domain>/mcp" \
--header "Authorization: Bearer omcp_..."In claude.ai, Claude Desktop or ChatGPT, add a custom connector at
https://obsidian-mcp.<your-domain>/mcp and sign in through the OAuth
consent page. Connect a client has the rest.
Stack: Python 3.12, FastAPI, PostgreSQL with pgvector, and an embedding backend of your choice (Ollama, OpenAI or Hugging Face TEI; see Pick an embedding backend).

Contents
Related MCP server: obsidian-mcp-search
Why this exists
There are three things going on here, and they're more interesting together than apart.
1. Agent memory that you can actually read
If you let an agent run for a while, it needs memory. Most setups solve this with an opaque vector store, a SQLite blob, or a managed "memory" service that you can't see into. That works until you want to know what the agent thinks it knows about you, or you need to correct something, or you want to understand why it just made a weird suggestion.
This server gives you a different deal. Agent memory lives as markdown files in your vault. Folder structure, file names, frontmatter, all visible. You can open the file in Obsidian and read it. You can edit it. You can delete it. You can grep it. The agent's "memory" is a human-auditable artifact that sits in the same place as your own notes, with the same tools available.
The home lab is the use case that sold me on this. My vault has notes on the rack, the network, and every Home Assistant integration. I can say "set up a night-light mode in the master bathroom, 1% after 11pm" and a sysadmin agent finds the right config, makes the change, and updates the doc in the same pass. Six months later when I've forgotten how it works, the answer is in the vault, not buried in some chat history I can't search.
The semantic search and wikilink graph still work over that material, so retrieval is fast and conceptual. But the substrate is files you own, not a black box.
To be precise about the scope: what the server supplies is MCP-accessible storage, keyword and semantic search, and graph operations over markdown notes, for whatever MCP clients you connect. The agents direct their own reads and writes. There is no extraction or decay pipeline running behind them, and nothing rewrites a note because a model judged it stale: an agent remembers something because it wrote a note, and forgets it because someone deleted one. By late 2026 that is less of a contrarian position than it sounds. Every vendor's consolidation step (the "dreaming" or "sleep-time" job) has turned into a separate process you can inspect, rather than silent extraction inside the write path. This server keeps the agent as the author. The consolidation help it will grow is a hygiene report that proposes merges and flags duplicates, and never writes (#359), not a pipeline that edits your notes while you are not looking.
2. A shared memory layer between you and your agents
The other half runs the other way: the vault isn't only the agents' memory, it's mine. I think of my Obsidian vault as my exocortex. The "big me" that includes notes, calendars, scripts, search, and AI assistants is substantially more capable than the "small me" of the biological brain alone. It's also where I do most of my thinking, because writing something down is itself a form of thought.
The problem is that until recently, the vault was passive. I had to go find things. Agents that wanted to help me had to be briefed from scratch every session, and they had no way to see what I'd already written about a topic.
This server fixes that. Now the same vault feeds my own daily writing and any agent I plug into it. The agent reads what I read, links what I link, follows the same wikilinks, sees the same frontmatter. When I write a project note on Sunday, my Monday-morning briefing agent already knows about it. When the agent leaves notes from a research session, they show up in my normal Obsidian search.
A concrete version of this: I'll spend a session in Claude Code on a project, wrap up, push the commits, and then just say "update Obsidian." The agent reads the vault guide, figures out where project notes live in my structure, picks the right format and frontmatter, and leaves a session log I can later roll into a status report. No path-passing, no telling it what to write — the conventions are already in the vault, and it follows them.
The same goes for commitments. My to-dos are checkbox lines in those notes, and the task tools let an agent read the same list I do: what is overdue, what is due this week, what I am waiting on from someone else. It can add a follow-up from a conversation or tick one off when the work is done, and the change is one line in a file I can see. That part is optional. Plenty of vaults hold no tasks at all, and nothing else depends on it.
That's the exocortex idea made concrete: one place that holds context, and both the human and the agents reading and writing into it on the same terms.
3. The vault follows you
The thing that still surprises me is that this is internet-facing. Same vault, same notes, reachable from anywhere I happen to be talking to an agent — Claude in a browser tab, Claude on my phone on the train, an n8n workflow firing on a schedule, a Claude Code session on whatever laptop is in front of me. All behind OAuth or a bearer key, all hitting the same source of truth.
So when I hear an interesting podcast on a commute and want to think out loud about it with Claude on my phone, the agent isn't starting cold. It can pull up what I've already written on adjacent topics, surface a note I half-finished six months ago, and at the end of the conversation suggest updates and write them in. The vault doesn't have to be near me to be the thing I'm working in. (A session away from the keyboard walks through exactly one of these.)
A session at the keyboard
To make the abstract concrete, a short transcript from a real session. Tool calls inline; the user types in plain English and the agent picks the right tool.
you > find anything I've written about why retrieval-augmented
chat is hard
claude
→ semantic_search(query="why retrieval-augmented chat is hard")
• 2025-12-03 - RAG failure modes.md
• 2025-10-18 - Chunking tradeoffs.md
• 2024-06-22 - Vector recall vs precision.md
the closest hit is your December note on RAG failure modes. let
me see what it's connected to.
→ get_neighborhood(path="2025-12-03 - RAG failure modes.md",
depth=1)
8 connected notes. notable ones:
• "Hybrid search" — a re-ranking design you sketched but
didn't ship
• "Out-of-distribution queries" — a half-finished draft from
October
• "Embedding model choice" — links to bge-m3, your current
model
you have three connected pieces here: a failure-modes catalog,
an unshipped hybrid-search sketch, and an abandoned O-O-D draft.
want me to summarize all three together, or pull up the draft
so you can decide whether to finish it?
you > pull up the draft, and tag it #revisit-2026 in frontmatter
while you're there
claude
→ read_note(path="2025-10-18 - OOD queries (draft).md")
→ set_frontmatter(
path="2025-10-18 - OOD queries (draft).md",
updates={"tags": ["draft", "rag", "revisit-2026"]}
)
here's the draft, and the tag is on. you stopped right before
the section on confidence thresholds; the open question you
left yourself was…Two things to notice. First, the agent didn't need to be told what
folder to look in or what tools to use — it picked them. Second, the
write at the end is structured (set_frontmatter mutating YAML, not
a regex over the file body), so the note round-trips cleanly. The
self-describing vault and the wikilink graph are doing the work that
makes this feel natural.
A session away from the keyboard
The transcript above is the easy case: I'm at a desk, I can see what the agent is doing, and Obsidian is one alt-tab away. The session that actually changed how I think about this server had none of that.
I was out walking with a health podcast in my ears — a long one, two people who clearly disagreed with each other, an hour of it. I had my phone and no intention of going home to a laptop. So I pulled the episode's transcript, handed it to Claude on my phone, and we talked it through while I kept walking: what the actual claim was, which parts I already had notes on, where it cut against something I'd decided months ago and written down at the time.
The agent had the vault the whole way. It surfaced what I'd already written on the topic, flagged that two dates in an older note were wrong, and asked whether a decision I'd recorded last year still stood given what the episode argued. By the time I got back it had written all of it in: the health-related decisions I'd actually landed on during the walk, the date corrections in the old note, a couple of new notes on the episode itself — and, because the conversation kept circling back to it, a durable note on how I decide which experts to trust on medical questions in the first place. That last one is the artifact I keep returning to. It wasn't about the episode at all; it was the reasoning underneath a whole class of decisions, and it now sits in the vault where the next agent will find it.
I never opened Obsidian. Not on the walk, not when I got home. The whole session — retrieval, argument, correction, and the writing that came out of it — went through an agent, and the vault is simply where it landed. Obsidian is how I check the work afterwards, not how the work gets done. That inversion is most of the reason this project looks the way it does.
What's in the box
The server exposes 33 MCP tools across six families, plus the auth and ops layer around them.
Every tool is published with a title and MCP ToolAnnotations, all
four hints set explicitly: readOnlyHint on the nineteen tools that only
read (search, read, list, graph, list_tasks, task_agenda, get_changes, check_upload), destructiveHint on
the eleven that can replace or remove something (edit_note,
move_note, delete_note, set_frontmatter, write_file,
delete_file, import_from_url, complete_task, update_task,
move_task, and request_upload, whose link can overwrite on
redemption),
openWorldHint on import_from_url only. create_note, add_task
and request_download are additive. Clients that honour
annotations run read-only tools without a per-call confirmation (Claude
Code also runs them in parallel) and keep prompting on destructive ones.
They are hints: the server enforces read-only credentials itself,
regardless of what a client does with them. The initialize result also
carries a short instructions paragraph — what the vault is, which tool
to reach for, and the write-safety rules — for clients that load only
tool names at session start. No description exceeds 4,000 characters on
the wire, so none is cut off by a client's description limit.
Search and discovery
keyword_search(query, folder?, tags?, frontmatter?, limit=20), full-text via PostgreSQLtsvector. A note's title and frontmatteraliasesrank above its body, so a query that is a note's title finds that note first; its tags (frontmatter and inline#tags, a nested#a/balso asaandb) are indexed below the title and above the body, andmatched_innames which oftitle,tagsandbodymatched; bare terms are ANDed, and when the full matches do not fill the page, partial matches follow taggedmatch: any; every row carries asnippet:with the matches highlighted (orhead:, the note's opening words, for a title or tags match). The text-search config(s) are configurable viaFTS_CONFIGS(see Full-text search language(s))semantic_search(query, folder?, tags?, frontmatter?, limit=15, rerank=false), vector similarity via pgvector, one one-line preview chunk per note. Notes are chunked at their headings, and each chunk is embedded under aTitle > Heading > Subheadingcontext prefix. A fresh row names the section it matched:§ "Plan/Risks" (#7)or§ (top of note), andread_note(path, section="#7")reads exactly that section. Previews start on a word; a section too short to stand alone (under 200 characters) is grouped with its neighbour, so a preview can include an inner heading line and its§names the enclosing section. Stale rows, and rows not yet re-embedded since the upgrade to heading-aware chunks, carry no locator. While any of your notes is still on the old chunking, each response says so on anindex_transition:line under its headerhybrid_search(query, limit=10, folder?, tags?, frontmatter?, rerank=false), both of the above fused by reciprocal rank fusion over each arm's top 50, one line per note with its fused score, each arm's rank and the1/(k+rank)terms behind the score. The three are peers, and every description carries the same routing sentence: exact identifiers, code symbols, titles or known phrases go tokeyword_search; conceptual or paraphrased questions tosemantic_search; unsure which,hybrid_search. A single arm can beat the fusion on its own kind of query. If the embedding provider is down,hybrid_searchreturns the keyword ranking markedarms: keyword-only (semantic unavailable: …), never silently degraded: the marker is on every return path, so a keyword-only page cannot pass for a fused one.Every page of
semantic_searchandhybrid_searchcarries aconfidence: ok | lowheader token.lowmeans no keyword note matched all the terms and the closest semantic candidate is underSEARCH_LOW_CONFIDENCE_SIMILARITY, with a one-line hint to trykeyword_searchorget_neighborhoodwhen it costs no row. Nothing is filtered. The threshold ships at 0 (off: alwaysok) until you calibrate it.rerank=trueon either of the last two asks an optional, operator-configured reranker (RERANK_URL) to reorder the candidates the call already fetched (at most 50 notes). Each note is scored on the best of up to four of its fetched chunks, sent as the same text they were embedded from (title, heading path and tags, then the chunk); a reranked row's preview and§locator show the chunk that scored. The response is either fully reranked (reranked: true (candidates: N), arerank_scoreper row) or the unreranked page markedreranked: false (<reason>); without a reranker it answersreranked: false (not_configured). Its rows are one-line quoted objects, likehybrid_search'slist_notes(folder?, limit=50, since?, until?, order_by?, cursor?), sorted by modified timeget_recent(folder?, limit=20, since?, until?, order_by?, cursor?), recently changed, with each modification time in UTC (YYYY-MM-DD HH:MM UTC). On both,order_by="content_changed"withsincelists notes whose content changed (a touch or a re-sync that keeps the bytes does not count);sinceis inclusive anduntilexclusive, each a UTC date (YYYY-MM-DD, the whole day) or an ISO 8601 datetime with an explicit offset. Any of the four switches to keyset paging with amore: cursor=…footer; a call with none of them is unchangedget_changes(since, folder?, kinds?, by="any", limit=50), the change feed: one line per note created, modified, moved or deleted after a cursor, oldest first, each attributed to the API key or OAuth client that made it ((you)for your own credential) orhuman/syncfor an edit the index discovered (Obsidian, a sync client, git). It returnsnext_since, an exactev:<n>cursor an agent stores in its own notes for the next session;byisany | me | agents | human. Deletions say why (removed,not_indexable,quarantined);gapandresetlines say when the view is incompleteget_tags(limit=50), tag and countlist_tasksandtask_agendalist checkbox tasks across the vault from the index; see Tasks (optional)get_vault_guide(), the Obsidian primer plus this vault'sCLAUDE.md, served liveRetrieval changes are measured with
make search-evalagainst judgments mined from the operator's own usage log (a search followed by a read of one of its results); see the search evaluation harness
Read and write
read_note(path, section?, offset=0, limit?)returns a structured result —path,title,tags,frontmatter_yamland a JSONfrontmatterview,heading(section reads),content, and truncation as data (truncated,offset,next_offset,total_chars,outline,notice). Bounded byMAX_READ_RESPONSE_CHARS(default 40,000) — see Response size limits.section=<heading>returns one section's body instead of the whole note;offsetcontinues a truncated read.create_note(path, content), atomic write, refuses overwriteedit_note(path, …)with four mutually exclusive modes: full replace (default),append=True,find=…(with optionalreplace_all), orsection=<heading>(ATX headings, supportsParent/Childpath-style and#Nordinal disambiguation).dry_run=Truereturns a unified diff without writing. Legacy clients may useoperation="append";operation="replace"explicitly selects full replace.move_note(from_path, to_path, rewrite_links=False), relocates and optionally rewrites incoming[[Old]],[[Old|alias]],[[Old#anchor]],![[Old]], and[[folder/Old]]references in source notesdelete_note(path, permanent=False), soft-delete to.trash/<YYYYMMDD-HHMMSS>-<basename>-<8 hex>by default, via a single non-replacing rename, so it never overwrites an existing trash entry (a filesystem that cannot do that rename makes the soft delete refuse with a named error rather than fall back).permanent=Trueunlinks.set_frontmatter(path, updates, remove?), structured YAML mutation. Body is byte-identical when only frontmatter changes.
Tasks (optional)
An agent that keeps notes usually also keeps commitments: a follow-up it promised, a next action, something to check again on Friday. These five tools let it keep them as checkbox lines in the same vault as its notes, and find, add and close them without reading files. Nobody has to use them. A vault without checkboxes behaves exactly as before, and no other tool depends on them.
What counts as a task. By default, any markdown checkbox list item:
- [ ] Renew the certificate, * [x] …, 1. [/] …, including one inside
a blockquote or callout, or indented under another item. A plain checkbox
is a complete task, and Obsidian does not have to be installed. A vault
whose checkboxes are not all tasks can narrow this with a task rule; see
Which checkboxes are tasks. The optional
fields use the Obsidian Tasks plugin's
emoji format, so the same notes also work in Obsidian, with or without
that plugin:
Field | Written as |
due |
|
scheduled |
|
start |
|
priority |
|
recurrence |
|
done |
|
cancelled |
|
created |
|
[ ], [/] and every other marker are open, [x] and [X] are done,
and [-] is cancelled. A checkbox inside a code block is not a task, and
a Tasks-plugin query block (```tasks) is text the server does
not evaluate. The server supplies the mechanics (listing, one-line
edits, moving a task between notes, and recurrence for the rules listed
below) and no policy: where
tasks live, what a tag means and what is due when are up to you, your
agents and your vault guide.
Which checkboxes are tasks. A checkbox is not always a task. People use checkboxes for checklists, runbooks, verification steps, acceptance criteria, packing lists, meeting agendas and the step lists inside work tickets. None of those is a commitment someone has to act on, but a tool that treats every unchecked box as an open task reports them all.
This matters more in a vault that AI agents write into. Agents produce
checkbox lists freely: a plan, a step-by-step procedure, the "done when"
criteria of a ticket, a status note. Each list adds open "tasks". An
agent that asks "what is on my plate" then gets an answer made mostly of
procedure steps; a text search for a task also matches the same words
in a runbook; and add_task's duplicate check refuses a new task, or
lists "similar tasks", because of a checklist line that was never a task.
In one real vault, 1,868 checkboxes were open: 314 were tasks and 1,554
(83%) were not. In that vault's dedicated task lists, every open checkbox
carried a date, a priority, a recurrence rule or a workflow tag. The
plain checkboxes sat in the same folders and often the same notes as the
tasks, so excluding folders or note tags could not separate them.
So each user (in single-user mode, the server) has a task rule that says which checkboxes count as tasks:
Rule | A checkbox is a task when | Choose it when |
| always | Your checkboxes are your tasks, for example a small agent-memory vault. |
| it carries a task field (a due, scheduled, start, created, done or cancelled date, a priority or a recurrence rule) or one of your task tags | Your real tasks carry a date, a priority or a tag such as |
| its text contains your global filter text, such as | You mark every task with one marker, or you already use the Tasks plugin's "Global task filter". |
Task tags match the way list_tasks(tags=…) does: ignoring case and by
/ segment, so the task tag waiting matches #Waiting/bob but not
#waitingroom. The global filter is the Tasks plugin's own mechanism: a
plain text match that respects case, anywhere on the line. #Task does
not satisfy #task, while #tasks and a #task inside inline code do;
the filter does not have to be a tag (TODO works).
The default stays all for three reasons: plain checkboxes keep working
for a vault whose checkboxes are its tasks; it is what the Tasks plugin
does when no global filter is set; and an existing deployment sees no
change until someone picks another rule (under all every response is
byte for byte what it was before). A vault that agents write into
should choose fields or filter, and say in its vault guide (the
vault's CLAUDE.md, served by get_vault_guide) how a task is
written, for example "every task has a 📅 due date or the #waiting
tag" or "every task line contains #task". Agents then create tasks the
rule recognises. add_task helps: under filter it adds the filter text
itself, and under fields it says when the line it wrote is not a task.
The rule is chosen on the panel's Tasks card, or for
everyone without a choice of their own by TASKS_RULE,
TASKS_RULE_TAGS and TASKS_GLOBAL_FILTER (see
Configuration). It applies to the default scope only:
default listings from list_tasks and task_agenda, and add_task's
duplicate check across the index. Nothing is hidden silently. While
fields or filter is in force, a default-scope response carries one
more header line, for example:
Rule — task rule: filter "#task" — excluded by rule: 2 tasks — kept though unsure (text cut): 1 tasks — pass scope="all" to list every checkboxIt names the rule, counts the checkboxes the rule left out (excluded by rule, apart from excluded by scope, which counts the folder and
note-tag exclusions), and counts the ones kept only because the server
could not judge them: a line whose stored text was cut at 1,000
characters before the filter text appeared, or whose tags were cut past
64. Those are listed rather than hidden. scope="all" lists every
checkbox, whatever the rule. Under fields, while rows still await
the first index pass after an upgrade, the line also says the rule is
approximate for them. A stored rule the server cannot apply (only a
manual database edit can produce one) is treated as all, and the line
says so.
Writes under a rule. The rule never blocks a write: complete_task
and update_task address any checkbox by path and id, including one
that only scope="all" lists.
Under
filter,add_taskputs the filter text at the start of the new task's text when the line does not already contain it, as the Tasks plugin's own task dialog does, and the response addsglobal filter added: "#task". A text that would pass 1,000 characters with the filter added is refused, with nothing written.Under
fields,add_taskwrites a line with no field and no task tag as asked, and the response addsnote: not a task under your task rule "fields" …: default listings will not show it.update_taskadds the same note, underfieldsorfilter, when its edit leaves a line that is not a task by the rule, for example after removing the last date or the filter text.update_tasknever adds the filter text back.add_task's check against the note it writes into still compares every open checkbox in that note: the same words in the same note are most likely the same thing (update_taskcan give that line a date;allow_duplicate=trueadds anyway).Under
filter, the duplicate check recognises an existing task whether its filter text sits in front (where the server puts it) or as a trailing tag (where people usually put one):add_task(text="Renew passport")is refused as a duplicate ofRenew passport #task.
A list_tasks cursor is refused (invalid_argument) once the rule
changes in a way that changes the rows (another rule, other task tags
under fields, another filter text under filter); list again.
Tool | What it does |
| Lists tasks from the index without reading a note. Filters: status, folder, path, tags and excluded tags, due / scheduled / done date ranges, undated, priority, words in the text, recurring. Ordered by due date, priority, scheduled date, done date or path, and paged with a cursor. Every row carries the task's id. |
| A dated overview from the index: overdue, due today, scheduled and now due, and due in the next |
| Marks one task done ( |
| Changes one task's dates, priority, tags, recurrence, status (open, in progress, cancelled) or description, or adds one context line under it. |
| Inserts one new |
| Moves one top-level task, with every line indented under it, to another note or section, byte for byte. The destination is written before the source, so an interrupted move leaves the task in both notes, and |
The four write tools need write permission, like every other write.
list_tasks and task_agenda read the same index as the search tools,
and the header of every response counts what the index could not show
(notes not yet scanned, tasks that could not be indexed, notes over the
5,000-task cap), so an empty list never silently means "nothing open".
Task ids. Every listing row prints the task's id, a 12-character
key computed from the task's text. To change a task, pass the note's
path and that id. The server finds the line by recomputing the ids
from the note's current text, never from a stored line number, and
because a write changes the line's text, the response returns the task's
new id. Nothing is ever written into a note to identify a task. Pass the
path as it is on disk: a row escapes unusual characters in a path (a tab
as \t, a backtick as \u0060, a backslash doubled), so undo those
escapes if the row shows any. When a
note holds several identical task lines, their ids carry an occurrence
suffix (3f9a0c1b2d4e.2of3), and a write with such an id also needs
the note's content_hash from read_note as expected_hash.
What a write guarantees.
One line changes. Only the characters of the field being changed are touched. The rest of the line (indentation, list marker, field order, spacing) and every other line stay byte for byte. The only extra lines are the ones the call asks for: a recurring task's next occurrence, the new line from
add_task, or one context line. Each planned edit is re-parsed and checked before it is written.Refused rather than guessed. Each of these is refused with nothing written, and the refusal ends with one
MCP-REFUSALline carrying its code: an id that no longer matches any line (task_not_found: list again), a bare id that matches several lines (task_ambiguous), a field the call changes that appears twice on the line (task_malformed), an unsupported recurrence rule (recurrence_unsupported), and onadd_taskan open task with the same description (duplicate_task;allow_duplicate=trueadds it anyway).add_taskalso lists up to five similar open tasks, which never block.dry_run=truereturns the diff and the new line(s), and writes nothing.expected_hashis optional and binds the whole note, as onedit_note. Without it, a change made by someone else during the call is retried from a fresh read, at most 3 attempts in total.Listings see the write at once. A successful write refreshes that note's task rows in the index (
index: refreshed). If the refresh cannot run, the write still stands and the response saysindex: may lag (<reason>)until the next index pass.edit_note,set_frontmatterandwrite_filealso try to refresh the task rows of a note they change, anddelete_noteremoves a deleted note's tasks; their output does not say whether that worked. A new note created bycreate_note,write_file, an import or an upload, links rewritten bymove_note, and any refresh that could not run show up after the next pass (every 300 s by default).
Recurrence: the supported rules. N is a whole number from 2 to
999, weekday and month names are written out in full English, and any
rule may end in when done, which counts the next date from the
completion date instead of the task's own date:
every day,every N daysevery weekday(Monday to Friday)every week,every N weeksevery week on Monday, Thursdayorevery Monday, Thursdayevery month,every N months(a day the month lacks becomes its last day: January 31 → February 28)every month on the 15th(for the 29th to 31st, a month without that day is skipped),every month on the lastevery year,every N yearsevery March on the 3rd
Every other rule is refused with recurrence_unsupported and
nothing written, wherever it appears: completing the task,
update_task(recurrence=…) or add_task(recurrence=…). That includes
every weekend, every 2 weeks on Monday, every month on the last Friday, every 1 day, abbreviated names, until …, for N times, and
a yearly rule on a task dated February 29. A recurring task is never
completed without its next occurrence. To complete one whose rule is
refused, clear the rule first (update_task(clear=["recurrence"])).
The next occurrence keeps the task's text, tags and priority. Its due
date (or scheduled, or start date, if it has no due date) moves by the
rule, and its other dates keep their distance from it. As in the Tasks
plugin, missed occurrences are not skipped: a weekly task completed
three weeks late gets its old date plus 7 days, which may already be
past.
Dates and the timezone. Every date argument accepts YYYY-MM-DD and
relative forms such as today, tomorrow, yesterday, +7d or -1d
(up to 3,660 days either way). "Today" is the current date in the
caller's task timezone: TASKS_DEFAULT_TIMEZONE (default UTC), or the
timezone saved on the panel's Tasks card. Every response that resolved a
relative date states the timezone and the dates it used. A list_tasks
cursor from a relative-date query is refused after midnight in that
timezone, because the dates moved; list again.
The default scope. list_tasks, task_agenda and add_task's
duplicate check across other notes work in the caller's default scope: the whole vault
minus the excluded folders and excluded note tags saved on the panel's
Tasks card, and only the checkboxes that are tasks under the caller's
task rule. With nothing saved, which is
the default, nothing is excluded. scope="all" ignores the exclusions
and the rule, and every listing states its scope and how many tasks the
scope and the rule left out, so an exclusion is never silent.
Not modelled: custom status cycles (completing a task with any open
marker writes [x]), task dependencies, the plugin's "remove scheduled
date on recurrence" setting, and its "remove global filter from
description" display option (the filter text stays part of the task's
text and, when it is a tag, of its tags, so with #task as the filter
list_tasks(tags=["task"]) matches every task). A task with
🏁 delete is refused on completion (on_completion_unsupported)
rather than deleted. The settings are under
Configuration and the panel card under
Tasks settings.
File access (non-markdown)
Raw read/write/browse of arbitrary vault files (PDFs, images, skill assets, data files) — distinct peers to the note tools, which stay markdown-only. Pure byte transport: no server-side PDF/text extraction, no embedding or indexing of non-markdown files.
read_file(path, encoding="auto", offset=0, limit?), returns text-like files as text, images as an inline image block that renders in-client, and other binaries as a base64 string.text/base64force the form. Refuses files overMAX_FILE_READ_BYTES(default 10 MB); text results are additionally bounded byMAX_READ_RESPONSE_CHARSand continue viaoffset.hash_only=Truereturns the whole file'scontent_hashwithout content; base64 results include that hash in their header. Text results remain plain text.write_file(path, content, encoding="base64", overwrite=False), lands a file in the vault; base64 for binary,textfor UTF-8. No-clobber by default, auto-creates parent dirs, atomic write. Capped atMAX_FILE_WRITE_BYTES(default 25 MB).list_files(folder=".", pattern="*", recursive=False, limit=200),ls-style browse of files and subdirectories with size and mtime, glob-filterable and result-capped.delete_file(path, permanent=False), soft-deletes a non-markdown file to.trash/<YYYYMMDD-HHMMSS>-<basename>-<8 hex>with a single atomic rename. Refuses markdown (that isdelete_note), directories, and symlinks.
All four reuse the path-traversal guard and exclude any path with a
component starting with . (dot-directories and dot-files)
(.obsidian, .git, .trash, …), matching the indexer's visibility
rule.
Guarding edits against stale reads
Pass a read's content_hash as expected_hash when editing, updating
frontmatter, moving or deleting a note, overwriting a raw file, or deleting
a raw file. The canonical token is sha256:<64 lowercase hex>, computed
over the complete raw file bytes; a section or truncated read_note still
returns the whole-file hash. For raw files, use read_file(hash_only=True)
or the base64 header. Do not hash the returned text yourself.
A stale token refuses the operation before mutation, with a final
MCP-REFUSAL JSON line naming stale_precondition and the current hash.
Re-read and reconsider the edit before retrying. Moves bind the source
note only; moves and deletes still allow an in-place edit after their
preflight comparison. Overwrites retain their separate in-call byte check.
Successful publishing writes report a new hash when available.
The argument is optional by default. WRITE_PRECONDITION_REQUIRED=true
requires it on the supported destructive calls; enable this only after
clients supply tokens. Creation is exempt and refuses a supplied token
as no_incumbent. Files above their read cap cannot be guarded.
The task write tools take the same optional expected_hash. In required
mode, complete_task and update_task with a plain task id need no
hash: the id names exactly one line in the bytes the write replaces,
and the rest of the note is spliced from the current file, so the write
cannot carry a stale copy of the note back. add_task removes nothing
and is exempt. An id with an occurrence suffix (<key>.2of3) needs
expected_hash in every mode. move_task binds each note separately:
expected_hash the source (a plain id satisfies required mode there) and
to_expected_hash the destination, which is exempt like add_task.
File transfer
No MCP client can hand a tool the bytes of a file the user is looking
at, so write_file is only usable when the agent already has the
content. These tools close that gap with short-lived capability links,
redeemed over the public /transfer/* routes.
request_upload(path, overwrite=False, expires_in?), mints a single-use link bound to exactly one destination path. The human opens it, picks a file, and it lands atpath— nothing else can be written with it.check_upload(upload_id), reportspending/uploading/completed(with path, size, sha256 and MIME) /unknown(a stream started and the server never recorded how it ended — read the path before re-minting) /revoked(the credential or vault root changed under the link) /expired, scoped to the identity that minted it.request_download(path, expires_in?), mints a link the human can save one vault file from. Usable more than once until it expires, and bound to the file's exact bytes at mint time.import_from_url(url, path, overwrite=False), fetches a public https asset straight into the vault under an explicit outbound deny policy (no private, loopback, link-local, metadata or tunnelled addresses, in any spelling, re-checked at every redirect).
The token travels in the URL fragment, which browsers never send, so
no server-generated request target or access log contains it. Uploads
are claimed before a body byte is read, published atomically with
no-clobber semantics, and bound at mint time to the file state they
were minted against — a link cannot silently undo an edit made while it
was waiting. MCP_HOSTNAME or BASE_URL must be set; without a public
origin the mint tools refuse rather than emit a localhost link.
Wikilink graph
get_backlinks(path, limit=50), notes linking TOpathget_links(path), outgoing links, both resolved and danglingget_neighborhood(path, depth=1, limit=50), undirected BFS over the resolved-link graph, capped at depth ≤ 5 and limit ≤ 200find_related(path, limit=10), semantic neighbors via averaged chunk embeddings and pgvector cosine distance, deduped per note, with the same section locator andindex_transition:line assemantic_searchfind_orphans(folder?, limit=50), notes with zero in or out resolved links
Auth and ops
API keys with the
omcp_prefix, stored as SHA-256 hashes, withreadandreadwritepermission scopes. Write tools refuse on read-only keys.OAuth 2.0 PKCE (S256) flow for public and confidential clients, including ChatGPT, Claude Desktop, and claude.ai. Dynamic registration defaults to both vault permission levels; the user chooses the actual grant on the consent screen. A read-only grant lists 20 tools — the thirteen write tools are left out of
tools/list(and still refused if called by name); choose read + write at consent for all 33, and reconnect the client after changing a grant's scope.Control panel (Jinja2, hand-written CSS, vendored Chart.js, nonce-based CSP) for keys, usage logs, indexer status, embedding-provider info, and a danger-zone reset.
Every tool call is logged to
usage_logswith name, params (truncated to 200 chars), duration, response size, and the calling credential's name — recorded at call time, so the audit trail survives deleting the key or OAuth client it describes./healthis unauthenticated and returnsstatusplus two capability fields:transfer_mount_check_available(the kernel supports the mount check transfer writes need) andvault_named_staging_fallback_active(a write has actually staged under a name on this process)./healthalso carries anindexerobject (status,task_running,failing_scopes,embedding_failing_scopes,max_consecutive_failures,quarantined_notes,last_success_at), and the top-levelstatusbecomes"degraded"when the indexer task has died, any index, embedding or enumeration failure counter — or a scope's run of incomplete re-derives — reachesINDEXER_DEGRADED_AFTER_FAILURES, or a note is quarantined. The HTTP code stays 200 — a restart cannot repair vault content or a provider outage, and Kubernetes uses/healthfor liveness — so monitor thestatusfield (a keyword or JSON check for"status":"ok"), not the status code. Counts only: no path, error text or user id.
Every write — note tools, write_file, uploads and imports — stages
the new bytes in a temporary inode, fsyncs them, and only then
publishes. Creation publishes with a kernel-atomic hard link that
refuses to clobber; move_note and the soft delete publish with a
single non-replacing rename; an overwrite is a same-directory rename
onto the destination. The destination directory (and any directory the
call created) is fsynced afterwards, so a crash mid-write can neither
truncate a note nor lose one the server reported as written.
Staging happens in an unnamed inode wherever the filesystem supports
one, so no temporary name is ever visible in the vault. On a mount that
refuses that (some NFS exports do), those writes refuse with an error
naming VAULT_ALLOW_NAMED_STAGING_FALLBACK; setting that flag takes
named staging back on both write paths as a declared, weaker guarantee.
See System requirements.
vs. other Obsidian MCP servers
The field has sorted itself into two shapes since this README was first written, and the axis that matters is not "lightweight versus heavy" but where the agent runs relative to the Obsidian app.
Desktop-local. The tool talks to a running Obsidian. The Local
REST API plugin has shipped its own Streamable HTTP MCP server
since 4.0.0 (2026-05-15), and 5.5.0 (2026-10-17) added If-Match
conditional writes and result caps, so it is no longer "glue" but a
real local MCP endpoint. The official Obsidian CLI (1.12)
reads, writes, searches and walks backlinks, and requires the app to
be running. In-app agent plugins sit in the same group. All of these
get the app's own metadata cache for free; none of them work on a
headless box, and none give claude.ai or a phone a way in without you
exposing your desktop.
Headless and remote. The server works on the vault files directly,
wherever they are mounted, with no Obsidian process. This server is one. Vault Cortex (aliasunder,
September 2026) is a single container with OAuth 2.1, SQLite FTS5 plus
sqlite-vec fused by RRF and a local reranker, tasks and daily-note
helpers, and a bundled Obsidian Headless Sync client; one vault per
container, no multi-user. StevenStavrakis/obsidian-mcp v2
(2026-08) is a stdio server with journaled atomic writes,
etag/if_match preconditions and 30-day recovery snapshots, and no
semantic search. jacksteamdev/obsidian-mcp-tools was archived on
2026-05-13 and is dropped from the table.
If Obsidian is open on the machine the agent runs on and you need no remote access, the official CLI or the REST plugin is the lighter choice. This server is for the headless, remote, multi-client and semantic case: nothing on the box but a container and Postgres, and every client you own hitting the same vault.
As of 2026-10-28:
This server | |||||
Runs without Obsidian | ✅ | — | — | ✅ | ✅ |
Semantic search | ✅ pgvector | — | — | ✅ sqlite-vec + RRF + reranker | — |
Wikilink graph | ✅ backlinks, neighborhood, orphans, related | backlinks | backlinks, orphans, dead ends | backlinks, outgoing, orphans | — |
Atomic / journaled writes | ✅ staged, fsync, no-clobber publish | ? | ? | ✅ temp + rename | ✅ journaled, rollback, snapshots |
Write preconditions (hash / etag) | ✅ | ✅ | — | — | ✅ |
Dry-run diff | ✅ | — | — | — | — |
Soft-delete to trash | ✅ | ? | ✅ | ✅ | ✅ 30-day snapshots |
Multi-user vault roots | ✅ | — | — | — | — (multi-vault, one user) |
OAuth for claude.ai / ChatGPT | ✅ 2.0 PKCE + API keys | — (API key) | n/a | ✅ 2.1 PKCE + DCR | n/a (stdio) |
Audit log | ✅ per call, in the panel | ? | — | server logs | transaction journal |
Setup tax | Postgres + Docker | Obsidian + plugin | Obsidian 1.12 | one container (Sync subscription for the remote image) | Node 22 |
The table reflects each project's documented features on that date,
read from their READMEs and release notes; a ? means I could not
confirm it either way. Verify the specifics before betting on them.
vs. hosted memory systems
The comparison that matters more, now that most of my vault traffic is agents rather than me, is against memory as a service: your agent calls an API, the service stores what it's told, and it hands back what it judges relevant later. mem0, Zep and Letta are the names people usually reach for. What follows is about that architecture — memory behind a service boundary — not about any one product's current feature list, which moves faster than a README can track.
One thing has changed since that paragraph was first true: files
plus search is now the mainstream substrate, not the odd one out.
Letta's MemFS is git-backed markdown; Claude Code's auto-memory is a
MEMORY.md index plus topic files; Anthropic's memory tool is a file
directory; OpenClaw and Hermes keep markdown workspaces. "Readable
markdown memory" on its own no longer sets this server apart. The
closest comparables are Basic Memory (markdown plus a SQLite or
Postgres index, hybrid search, an optional reranker, structured
frontmatter filters; its own folder and note format, AGPL, with a paid
cloud) and doobidoo/mcp-memory-service (self-hosted, remote MCP
over OAuth, opaque memory records rather than files). Against those,
the differences are five, and plain:
The existing vault, served in place, with no imposed folder or note format.
Remote and multi-user over OAuth, one vault root per user.
Destructive-write guards:
expected_hash, atomic no-clobber publish,.trash/, dry-run diffs.MIT.
No hosted tier, and none planned.
The difference from memory-as-a-service is where the memory lives and who can open it.
Readability. When memory sits behind a service API, reading it means whatever endpoint or console the service exposes, in whatever shape it stores. Here the memory is the artifact:
Health/2026-08 - Trusting expertise.md, in a folder, in your editor, ingrep. There's no gap between what the agent stored and what you can look at.Shared with you, and between agents. A memory service is generally scoped to an application and its users; the human's own writing is a different system. Here it's one corpus. I write into it by hand, and every connected client — Claude Desktop, Claude Code, Claude on the phone, an n8n workflow — reads and writes the same files on the same terms. A note I type on Sunday is context for an agent on Monday with no import step.
Portability. The exit path from a folder of markdown is
cp -r. No export format, no migration script, no question about what you'd be left holding if a project stopped being maintained. That's a property of files, not something this server does for you.Self-description. The rules live in the corpus rather than in client config.
CLAUDE.mdat the vault root tells every agent, on its first call, where things go and what frontmatter they carry, so conventions are versioned next to the notes they govern.
What the hosted shape buys you in exchange is real, and worth saying plainly. There's no Postgres to run, no pgvector version to keep current, no container to babysit — you get a memory layer by adding a dependency, which is a genuinely better trade for most people. And systems in that class typically do work this server deliberately doesn't attempt: pulling facts out of a conversation automatically, reconciling ones that contradict each other, and scoring relevance or decaying old memories so they stop crowding out new ones. Here an agent remembers something because it decided to write a note, and the judgment about what's worth keeping is the agent's, not the server's. The consolidation help planned here is a report that proposes and never writes (#359). If you want memory that curates itself, that's a fair reason to pick the other shape.
vs. an agent with raw file access
The other baseline isn't an MCP server at all: point Claude Code, a
generic filesystem MCP, or any agent with file tools straight at the
vault folder. That works — until a write goes wrong. An agent
rewriting a whole file from its memory of an earlier read will
eventually clobber a note, follow a symlink somewhere it shouldn't,
or "tidy up" your .obsidian config. Nothing in a raw file API
pushes back. This server's write path is shaped by exactly that kind
of incident, and it assumes the caller will eventually do something
wrong:
Targeted edits instead of rewrites.
edit_notecan address a find-string or a single section rather than replacing the file, anddry_run=Truereturns the unified diff before anything lands.set_frontmattermutates YAML structurally and leaves the body byte-identical.No-clobber defaults.
create_noteandwrite_filerefuse to overwrite an existing file; replacing one is an explicit opt-in.Atomic writes. Content is staged and renamed into place against a descriptor opened at validation time — a note is never left half-written, and the file that gets replaced is the file that was checked.
Reversible deletes.
delete_noteanddelete_filesoft-delete into.trash/with a non-replacing rename;permanent=Trueis the explicit escape hatch, not the default.Kernel-proved containment. Paths resolve under the vault root via
openat2(RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS | RESOLVE_NO_MAGICLINKS), writes refuse a symlink as the final component, and dot-directories (.obsidian,.git,.trash) are out of reach of every tool.Bounded responses. Reads are capped and truncation is data (
truncated,next_offset, an outline) rather than silent loss, so one huge note can't flood an agent's context into a bad edit.An audit trail. Every call is attributed to a key and logged; the control panel shows who touched what, and when.
When an agent misbehaves through this server you get a refused call,
a diff, a trash entry, and a usage-log line. When it misbehaves with
raw file access you get whatever git diff can recover — if the
vault was in git at all.
Who this is for
Homelab folks who already run Postgres and Docker, or are happy to spin them up. The setup tax is the price of admission for the semantic and graph layers.
People who keep an opinionated vault — task placement logic, frontmatter schemas, tag taxonomy — and want agents to follow those conventions on the first call instead of being briefed every session.
Anyone running more than one MCP client (Claude Desktop, Claude Code, Claude in a browser, n8n) against the same notes and tired of re-explaining the vault to each.
Folks who want agent memory to live as plain markdown files they can read, edit, grep, and version-control, not in an opaque vector store or a managed memory service.
People who keep their to-dos as checkboxes in their notes and want agents to work from that one list (see what is due, add a follow-up, close what is done) instead of keeping a second one somewhere else.
Who this isn't for
"I just want Claude to read my notes" with the lightest possible setup. Use one of the desktop-local tools above; you don't need this.
Obsidian is open on the machine the agent runs on and you need no remote access. The official CLI or the Local REST API plugin's MCP server is the lighter choice.
Anyone unwilling to run a database. There is no SQLite fallback; pgvector is doing real work, and a managed Postgres with pgvector support is part of the stack.
People who want a turnkey hosted product. This is a self-hosted server you run yourself.
Control panel
The server ships with a built-in admin UI for the parts of operations that are easier to look at than to query: minting keys, watching the indexer, eyeballing tool-call traffic, and resetting embeddings when you switch providers.
Usage
Per-tool-call audit log with a 14-day request histogram. Every MCP call is recorded with the calling key, tool name, duration, and response size — useful for noticing a misbehaving agent burning tokens on something it shouldn't.

API keys and OAuth clients
Bearer keys with read / readwrite scopes for API clients, and a
separate OAuth 2.0 PKCE flow for clients like ChatGPT, Claude Desktop,
and claude.ai that expect a proper authorization-code dance. The OAuth
server supports public (none) and confidential (client_secret_post)
token-endpoint authentication plus refresh tokens, and, for metadata-document
clients only, private_key_jwt (RFC 7523 signed client assertions).
Clients identify themselves in one of two ways:
A Client ID Metadata Document (CIMD, the MCP 2026-07-28 default). The client's
client_idis anhttpsURL to a JSON document it publishes, and the server fetches it through the same hardened, SSRF-guarded client asimport_from_url. Claude (claude.ai, Desktop, mobile), Claude Code and ChatGPT use this whenever the server advertises it, which it does by default. Claude Code's loopback callback (http://localhost:<any port>/callback) works this way. Claude and Claude Code are public (none) clients. ChatGPT's document declaresprivate_key_jwt: the server also fetches the document's same-originjwks_uri, stores the validated public keys with the client, and ChatGPT then signs a short-lived, single-use assertion for every token exchange and refresh (and revocation). The server refetches the key set from the same pinned URL when an assertion names a key it does not hold, and before a token request once the stored set is more than a day old.Dynamic Client Registration (
/register, RFC 7591, deprecated by MCP but kept) remains the fallback for any client that sends no URL.
The consent page names a CIMD client by the host its document was fetched
from, never by the name the document gives itself. Every authorization
response carries the RFC 9207 iss parameter.
Each client's page lists its grants — one row per /authorize approval,
not per token — with a Revoke control and a permission select per grant,
so revoking really ends the session instead of leaving a refresh token
to mint a replacement. Revoked and expired rows stay listed, dimmed, for
a week.

Vault browser
A read-only file tree of the mounted vault, mostly for sanity-checking that the container sees what you think it sees.

Settings
Indexer status, current embedding provider and model, vault path, and the danger zone: Reset embeddings (drops and recreates the embeddings column at the configured dimension — use it when switching providers) and Force re-embed (keeps the column, clears every note's embedded-content hash so the next pass re-embeds the vault). Both pause the indexer while they run.
The dashboard separates two things that used to be conflated: Last
run is the indexer's own heartbeat — the last pass that completed,
whether or not anything had changed — and Last change detected is
the newest indexed_at on any note. A quiet vault makes the second one
old while the indexer is perfectly healthy.

Tasks settings
A Tasks card holds the settings of the task tools. In multi-user mode it is on each user's Account page and applies to that user's own calls only. In single-user mode it is on the Settings page and applies to every MCP caller of the server. Nothing is stored until the card is saved, and an unsaved card means the server defaults from Configuration.
Which checkboxes are tasks (first on the card; see Which checkboxes are tasks). A choice of Server default (which shows the server's rule in words), Every checkbox is a task (
all), Only checkboxes with task details or a task tag (fields) or Only checkboxes that contain the global filter text (filter); a Task tags list, one per line, at most 32; and a Global filter text field, at most 64 characters on one line. An "In use now" line shows the rule in effect and whether it is the server default or set here. Server default takes the server's whole rule as one unit (rule, task tags and filter text together) and ignores the card's two fields, so what the card says is in use is exactly what is used. Tags or a filter text the chosen rule does not use are kept, so switching rules to compare loses nothing. Thefilterrule without a filter text is refused, with nothing saved.Timezone. What "today" means for task dates: relative dates such as
todayor+3d, and the date written when a task is completed, cancelled or added. Any IANA timezone name (the field suggests common ones); blank usesTASKS_DEFAULT_TIMEZONE. The card shows the zone in use. A saved zone this server cannot load falls back to UTC, and both the card and every task response say so.Excluded folders and excluded note tags, one per line, at most 32 of each. Tasks in those folders (and their subfolders), or in notes carrying one of those tags or a tag nested under it (
ticket/opsunderticket), are left out of the default scope: listings, the agenda andadd_task's duplicate check. A caller can still passscope="all", and every listing counts what was excluded.Four write behaviours, each a choice of Server default (which shows the current default), On or Off: add a done date when a task is completed, add a cancelled date when it is cancelled, add a created date to new tasks (and to a recurring task's next occurrence), and put a recurring task's next occurrence below it instead of above. Each names the Tasks plugin setting it matches, so a vault that also uses the plugin can keep the two in step.
Quick start
Deploying on a VPS from scratch? See
DEPLOYMENT.mdfor the full walkthrough: Postgres setup, Caddy and TLS, vault sync via Nextcloud, and the gotchas that bite first-time deploys. Running Kubernetes? Seedocs/deployment-kubernetes.mdand the kustomize manifests indeploy/kubernetes/.
The bundled Caddy configuration fails closed on /admin, /api, and
/authorize; replace its placeholder basic-auth hash before starting it.
Prerequisites
Docker and Docker Compose
A PostgreSQL 16 instance reachable from the container, with
pgvector0.8.0 or newer installedEither an Ollama instance running an embedding model (
bge-m3, the default, orqwen3-embedding:0.6b, which the reference deployment runs; see Embedding model choice), or an OpenAI API key. Anything that speaks the OpenAI embeddings protocol works (Azure OpenAI, OpenRouter, Together, etc.).Linux, kernel 5.6 or newer (see below)
System requirements
The server checks these at startup and tells you which one failed rather than misbehaving later.
Linux kernel ≥ 5.6. Every directory below the vault root is opened
with a single openat2(RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS | RESOLVE_NO_MAGICLINKS), which is what makes the kernel — not the
application — prove that a write stayed inside the vault. There is no
fallback: on an older kernel, or under a container seccomp profile that
blocks openat2, the server logs the reason and exits non-zero.
Kernel ≥ 5.8 for file transfer. statx()'s STATX_MNT_ID is how a
publication refuses a destination that sits on a different mount than
the staging directory (a nested bind mount under the vault root would
otherwise fail only after a whole upload body had streamed). Below 5.8
the server logs one warning and starts: request_upload,
import_from_url and PUT /transfer/upload refuse, and everything else
— reads, note writes, search, downloads, the panel, OAuth — is
unaffected. /health reports it as transfer_mount_check_available.
pgvector ≥ 0.8.0. Filtered semantic search needs
hnsw.iterative_scan, which landed in 0.8.0. An older extension accepts
the setting as an unknown placeholder and silently runs a plan that
drops post-filter candidates — silently worse search results — so the
server exits instead. Fix with ALTER EXTENSION vector UPDATE or a
newer database image.
Filesystem. Case-sensitive and non-normalising (ext4, xfs, and the
usual bind mounts). It must support hard links within the vault root and
renameat2(RENAME_NOREPLACE); without those, note creation, move_note
and the soft delete refuse with a named error rather than degrading to a
publish that can clobber. O_TMPFILE is wanted but optional: where it
is unavailable, set VAULT_ALLOW_NAMED_STAGING_FALLBACK=true to accept
named staging instead (see Configuration). macOS and
Windows hosts are out of scope; run the container on a Linux VM.
1. Clone, configure, point at your vault
git clone https://github.com/maxkuminov/obsidian-mcp.git
cd obsidian-mcp
cp .env.example .env
$EDITOR .envUsing a bundled stack (docker-compose.simple.yml or
docker-compose.proxy.yml)? It runs PostgreSQL with two identities: set
OBSIDIAN_DB_PASSWORD in .env (the app's non-superuser role, from
which the compose file builds DATABASE_URL) and copy
postgres.env.example to postgres.env with its own
POSTGRES_PASSWORD (the database superuser, which only the postgres
container sees). make init generates both. See
DEPLOYMENT.md.
In docker-compose.yml, point the /obsidian volume at your vault:
volumes:
- /path/to/your/vault:/obsidian2. Pick an embedding backend
Option A, OpenAI (zero local infra):
EMBEDDING_PROVIDER=openai
OPENAI_API_KEY=sk-...
EMBEDDING_DIMENSIONS=1024
OPENAI_EMBEDDING_MODEL=text-embedding-3-smallThe server validates OPENAI_API_KEY at startup and refuses to boot
if it's missing.
Option B, Ollama (self-hosted, GPU recommended):
EMBEDDING_PROVIDER=ollama
OLLAMA_URL=http://your-ollama-host:11434
EMBEDDING_ALLOW_PLAINTEXT=true
EMBEDDING_MODEL=bge-m3
EMBEDDING_DIMENSIONS=1024This is the default. Omitting EMBEDDING_PROVIDER falls back to
Ollama. On a new install, consider qwen3-embedding:0.6b (also 1024
dimensions) with a query instruction, which is what the reference
deployment runs; read Embedding model choice
before the first index pass, because changing the model later means a
full re-embed.
Option C, Hugging Face Text Embeddings Inference (TEI, self-hosted):
EMBEDDING_PROVIDER=tei
TEI_URL=http://your-tei-host:80
TEI_EMBEDDING_MODEL=BAAI/bge-m3
EMBEDDING_DIMENSIONS=1024TEI is the server of Hugging Face's text-embeddings-inference image. The
tei provider uses its native POST /embed API, for servers that do not
expose the OpenAI-compatible route. If your TEI build does serve
/v1/embeddings, you can use the openai provider
instead with OPENAI_BASE_URL=http://your-tei-host:80/v1 and any non-empty
OPENAI_API_KEY. A change of provider
or model needs make reset-embeddings, exactly as for the other options.
TEI_EMBEDDING_MODEL must equal the model_id your server reports at
GET /info, exactly, including for a local path such as /data/model.
The server checks this at startup: a different model_id, or a
TEI_EMBED_BATCH_SIZE above the server's max_client_batch_size, refuses
startup. If TEI is unreachable at startup the server still starts, and no
vector is requested until a check passes (one re-check every 30 s), so
semantic search and indexing fail per call during that window while keyword
search, reads and writes keep working. The check compares the name only;
replaced weights behind one name are not detected.
If your TEI server was started with --api-key (or sits behind a gateway
that wants a bearer token), set TEI_API_KEY. The server sends it as
Authorization: Bearer <key> on /embed, the /info check and the panel's
/health probe, and to no other host. Without it, such a server answers
/info and /embed with 401:
the startup check logs GET /info answered HTTP 401; TEI_API_KEY is not set
(or the server rejected TEI_API_KEY when the key is wrong), the process
keeps serving with embedding withheld, and it never exits over it. TEI
leaves /health public (as of v1.8.3), so the panel can show the server
as reachable even with a wrong key. The key is never logged or shown. The openai provider against TEI's /v1 route
already sends OPENAI_API_KEY as its bearer token.
The provider sends truncate: true, so a chunk or query longer than the
model's limit is embedded from its leading tokens, the rest is not
represented in the vector, and the note is still marked as embedded. Ollama
truncates the same way; CHUNK_SIZE is the control.
The embedding URL must be https, or http to a loopback host
(localhost, 127.x, ::1). Plaintext http to any other host —
another container such as http://ollama:11434 included — refuses to
start unless EMBEDDING_ALLOW_PLAINTEXT=true acknowledges that chunks
and queries cross that hop unencrypted. .env.example ships with it
set for that reason; drop it once the endpoint is https (use
EMBEDDING_CA_FILE for an internal CA). Inside a container, localhost
is the container itself, so an Ollama on the Docker host still needs
the override.
3. Deploy
make init # data dirs and .env from template (skip if you've already edited)
make db-init # create database, user, and pgvector extension
make deploy # build, push to local registry, run migrations, recreate containerThe first deploy backfills the index, the wikilink graph, and the
embeddings. For a 2 to 3k-note vault on Ollama with a GPU this takes
a few minutes. On text-embedding-3-small it's seconds.
Prebuilt images are public at ghcr.io/maxkuminov/obsidian-mcp
(:v<release> per release tag, :main for the tip), built and scanned
by CI; a release tag is the image CI proved for that commit, retagged,
never rebuilt. docker pull ghcr.io/maxkuminov/obsidian-mcp:v<release>
needs no token. Or build locally as above.
4. Connect a client
Mint an API key in the control panel, then point your MCP client at:
URL: https://obsidian-mcp.<your-domain>/mcp
Auth: Bearer omcp_...For Claude Desktop, add to claude_desktop_config.json:
{
"mcpServers": {
"obsidian": {
"url": "https://obsidian-mcp.<your-domain>/mcp",
"headers": { "Authorization": "Bearer omcp_..." }
}
}
}For Claude Code:
claude mcp add obsidian --transport http \
--url "https://obsidian-mcp.<your-domain>/mcp" \
--header "Authorization: Bearer omcp_..."The first thing any agent should do in a new session is call
get_vault_guide(). That's how it learns your folder structure,
naming conventions, and YAML schema before it writes anything.
Versioning and compatibility
From 1.0 the version number is a promise about the MCP tool contract:
the tools' names (28 at 1.0, 32 since the task tools, 33 since
move_task), their argument
schemas, the shape of their result lines, and the MCP-REFUSAL codes.
An agent written against 1.0 keeps working against every 1.x.
The wire form is pinned.
tests/fixtures/tools_list_full_v3.jsonis the completetools/listresult an API key or areadwriteOAuth grant sees (every field of all 33 tools), andtests/fixtures/tools_list_readonly_oauth.jsonpins the 20 names a read-only OAuth grant lists.tools_list_full_v2.jsonkeeps the 1.3 surface, and a test derives it from v3 (move_taskremoved, every other entry byte for byte);tools_list_full_v1.jsonkeeps the 1.0 surface, and a test derives it from v2: the four task tools removed, andlist_tasksdiffering only by its description and its added optional arguments. CI fails on any drift; a deliberate change regenerates the fixture and says so in its spec. Result line shapes are specified inopenspec/specs/and pinned by each tool's tests, not by one fixture.Refusal codes are a closed set. Every code an
MCP-REFUSALline can carry is declared insrc/services/refusals.py(CODES), and a refusal with any other code cannot be constructed. That module is the catalogue; there is no separate list. The transport 429s (failed authentication, transfer redemption,body_memory) are outside that line by design.Within 1.x, additions only: new tools, new optional arguments whose default leaves the old result byte-identical, new header tokens or trailing fields, new refusal codes. Never a rename, a removal, a changed default that alters an existing result, or a changed meaning of an existing field or code. A change of that kind is 2.0, announced one minor release earlier in the release notes. Unknown arguments are refused, so a client that sends a newer argument to an older server gets a refusal, not a silently ignored filter.
Settings. A new setting ships with a default that keeps the previous behaviour. Every setting change is in the release's upgrade notes, in the Configuration table and in
.env.example.Schema. Every release names its migrations and says whether they refuse startup or need a rebuild or re-embed, and
DEPLOYMENT.mddocuments each one's downgrade (it does so for every migration from 033 on).
Not part of the contract: the control panel and its /api/* endpoints,
log fields, the search-evaluation harness (scripts/search_eval/), the
internal MCP SDK version, and ranking quality. Which notes come back, and
in what order, moves with the index, the embedding model and the
reranker; the harness measures it
(docs/architecture/search.md).
MCP_SANDBOX_MODE, the registry-evaluation switch, is outside the promise
too.
Upgrading
Pull, then make deploy (or rebuild your compose stack); migrations
run on start.
Across the task-move release (#430):
One new tool,
move_task, moves a top-level task with the lines indented under it to another note or section (see Tasks). The tool list grows to 33; a read-only OAuth grant still lists 20 (the new tool needs write permission and is hidden from it). Connectors pick it up when they next list. No existing tool's name, schema or description changes; the server instructions gain one clause after their lead.The write bucket covers twelve tools.
move_tasktakes one write token per call, though it publishes two notes.A new concurrency-readiness epoch.
move_taskjoins thewriteclass, soCLASS_MAPPING_VERSIONmoves to 7 andmake concurrency-reportevidence gathered before the upgrade does not carry over.New refusal codes:
task_move_incomplete(a partial outcome: the destination was written and the source was not, with the exact call that completes the move),resume_unmatchedandblock_id_conflict.No migration, no new setting, nothing re-derived or re-embedded.
Across the file-permissions release (1.5.1, #447):
Files the server writes keep their permissions on edit and follow their folder on create. Before 1.5.1 every file the server wrote, through any tool, upload or import, got mode
0o666 & ~umask. Under a folder default ACL that cut a group's access to read-only (mask::r--), and every edit turned a 0600 file into 0644. Now an edit keeps the file's permission bits, POSIX access ACL and group, and a new file gets exactly what any other program creating it in that folder would get: the folder's default ACL where it has one, otherwise0o666 & ~umask(one exception: on a filesystem without POSIX ACLs, an upload into a setgid folder whose group the server is not in keeps the server's group, so that group gets only the "other" access, as before 1.5.1). A new note follows its folder's default ACL exactly, so in a folder whose default ACL grants write to "other" the note is world-writable, like any other file created there; tighten that folder's default ACL if you do not want that.New folders under a default ACL follow it too (they were created with
mask::r-x, so the group could not create files in them). Folders outside a default ACL are unchanged (0755).With umask 022 and no ACLs (the published image), new files and folders look exactly as before; only an edit of a file whose mode or group differs from what a new file would get behaves differently.
When the server cannot give a file its group (a group it is not a member of), the file keeps the server's group and the original group's permissions move to a named entry:
getfaclshowsgroup::---andgroup:<group>:rw-. On a filesystem without ACLs the group bits are cleared instead and the "other" bits capped by them. Nobody gains access by this.A permission step that fails for any reason other than "no ACLs on this filesystem" now refuses the write (
io_failure, "nothing was written"; an upload answers 500 and the link can be retried) and logs one ERROR line,file permissions not applied; nothing was written, naming the step and the error. An unguardedwrite_file(overwrite=True)whose target's permissions change during the call now answersconcurrent_write.Files earlier versions already narrowed or widened are not repaired. To find files and folders whose ACL mask lost write, and review the list before changing anything:
find <vault> \( -type f -o -type d \) -exec sh -c \ 'getfacl -cp "$1" 2>/dev/null | grep -Eqx "mask::r-[-x]" && echo "$1"' _ {} \;Restore write on one you confirm (
rwfor a file,rwxfor a folder):setfacl -m m::rw <file>,setfacl -m m::rwx <folder>. A file that was private before an edit cannot be told apart from one created readable;find <vault> -type f -perm -o=rlists the world-readable ones, andchmod 600 <file>(orchmod 640) restores one you know should be private. No setting, no migration.
Across the task-rule release (migration 040, #434):
Nothing changes until a rule is chosen. The default rule,
all, keeps every checkbox a task: every response, write and outstandinglist_taskscursor stays exactly as it was. See Which checkboxes are tasks.Migration 040 adds three columns (
task_rule,task_tags,global_filter) and two CHECKs totask_settings. It writes no row, rewrites no table, re-derives and re-embeds nothing, and runs as the database's non-superuser owner.New boot refusals, only for a value you set: an invalid
TASKS_RULE,TASKS_RULE_TAGSorTASKS_GLOBAL_FILTER, orTASKS_RULE=filterwithout a filter text, stops the app and the migration step, since both load the same settings. Set them wherever the settings are loaded (on Kubernetes, the ConfigMap themigrateinitContainer also reads), and quote a filter text that starts with a hash sign (see Configuration).No tool or argument is added. The descriptions of
list_tasks,task_agendaandadd_tasknow mention the rule; the tool count and every schema are unchanged.task_agendaneeds a slightly larger response cap while a rule is in force: 3,121 characters instead of 2,800 (MAX_READ_RESPONSE_CHARS, default 40,000, so this binds only on a deployment that lowered it).Backups. The new columns are part of
task_settings, which is already dumped with its rows.Rollback is roll-forward. A server process of the previous image that is already running keeps working against 040, but a previous image that starts anew cannot: its migration step does not know revision 040. To run the previous image, first run
alembic downgrade 039with the new image. That drops the three columns and both CHECKs, and with them every saved task rule, task tag and filter text; the previous image then lists every checkbox again. Details inDEPLOYMENT.md.
Across the task-tools release (migration 039, #428):
New boot refusal:
TASKS_DEFAULT_TIMEZONE. Unset, it isUTCand nothing changes. If you set it, it must be an IANA timezone this build knows (Europe/Berlin,America/New_York); a misspelt name, or a host-only name such aslocaltime, stops the app and the migration step, since both load the same settings. On Kubernetes, put it in the ConfigMap that themigrateinitContainer also loads, not on the app container alone.Migration 039 adds nullable columns to
note_tasksandnotes_metadata, a constraint, two indexes and one new table,task_settings. It writes no row and rewrites no table, and runs as the database's non-superuser owner.One re-derive pass, nothing re-embedded. The extraction version moves to 5, so the first index pass after the upgrade parses every note once to give each task its id. No embedding provider call is made. Until that pass finishes,
list_tasksrows showid pendingand the header countstask ids pending, thetextandrecurringfilters are approximate and say so, andmove_note(rewrite_links=True)answersindex_not_ready. The task write tools work throughout: they read the note itself, not the index.What an existing
list_taskscaller now sees. Rows gain— id <id>;tags=matches nested tags and ignores case (worknow also matches#Work/admin; everything that matched before still does), and the header'stags:echo is lower-cased; atagsvalue outside the tag grammar (["2024"],["a.b"], a non-ASCII tag), which used to return an empty page, is now refusedinvalid_argument;due_byandscheduled_byalso accept relative dates, so the wording of the malformed-date refusal changed; a path containing a backtick is now shown with the backtick escaped as\u0060(it was printed raw); and the header gainstask ids pending. Alist_taskscursor issued before the upgrade is refused once (invalid_argument): list again without it.Four new tools and the counts that follow.
task_agenda,complete_task,update_taskandadd_taskbring the tool list to 32. A read-only OAuth grant now lists 20 (the three task write tools are hidden from it). Connectors pick the new tools up when they next list.A new concurrency-readiness epoch. The three write tools join the
writeclass andtask_agendathescanclass, soCLASS_MAPPING_VERSIONmoves to 6 andmake concurrency-reportevidence gathered before the upgrade does not carry over.Five new settings, all with defaults that match the Tasks plugin's own:
TASKS_DEFAULT_TIMEZONE,TASKS_SET_DONE_DATE,TASKS_SET_CANCELLED_DATE,TASKS_SET_CREATED_DATE,TASKS_NEXT_RECURRENCE_BELOW(see Configuration). Per-user values are saved on the panel's Tasks card. The image gains a pinnedtzdatapackage, so timezone names no longer depend on the operating system's zone files.Backups.
task_settingsis durable and is dumped with its rows;note_tasksstays derived (schema only).Rollback is roll-forward. The previous image runs against the 039 schema: it ignores the new columns and table and writes NULL into the new task columns. It also re-derives every note once (it does not know extraction version 5) and, as after #350's rollback, re-chunks every note while reusing every stored vector, with no provider calls.
alembic downgrade 038drops 039's objects, including every saved task setting. Details inDEPLOYMENT.md.
Across the ChatGPT private_key_jwt release (migration 038, #420):
Migration 038 adds four nullable columns to
oauth_clientsand replaces or adds three CHECKs, with no backfill, and takes seconds. Existing DCR and CIMD clients and their grants are untouched. Its downgrade refuses while anyprivate_key_jwtclient exists (delete it in the panel first; its grants go with it).ChatGPT connects through CIMD. It was refused
invalid_clientat/authorizebefore this release, because its document declaresprivate_key_jwt. Nothing to configure; there are no new settings.Re-add an existing ChatGPT connector, don't just reconnect it. ChatGPT reads the server's OAuth metadata once, when a connector is created, and picks its token authentication method from that copy. A connector created before this release still works from the old metadata, which had no
private_key_jwt. It authenticates as a public client, and the token request is refused (oauth_token_refused reason=invalid_client.assertion_missing). Delete the connector in ChatGPT and add it again with the same URL. Nothing needs changing on the server. The same applies after any future change totoken_endpoint_auth_methods_supported.Outbound access. Besides each client's document, the server now fetches a
private_key_jwtclient's key set (jwks_uri, same origin as the document) at consent and, when keys rotate or the stored set is a day old, before a token request. The same SSRF-guarded client and egress rules apply.The AS metadata gains
private_key_jwtintoken_endpoint_auth_methods_supportedandtoken_endpoint_auth_signing_alg_values_supported, only whileOAUTH_CIMD_ENABLEDis true./registerstill does not acceptprivate_key_jwt.
Across the OIDC account-linking release (migration 037, #416):
Migration 037 adds six nullable link columns and five constraints to
users, with no backfill, and takes seconds. With SSO off nothing else changes. Its downgrade drops every link.OIDC_SUBJECT_USER_IDSis retired. A deployment that still sets it refuses to start. If yours did, do this in order (it is also in the startup message): (1) on the old release, confirm a local admin password works; (2) setLOCAL_LOGIN_ENABLED=true; (3) copy the map's subject-to-user pairs, then remove theOIDC_SUBJECT_USER_IDSline (delete it; an emptyOIDC_SUBJECT_USER_IDS=fails to parse at startup); (4) deploy and start; (5) sign in with the password and, on each user's edit page, Single sign-on → Bind subject with their former subject; (6) verify an SSO sign-in per user and one MCP client's/authorizeconsent; (7) optionally setLOCAL_LOGIN_ENABLED=falseagain, once the startup log shows no CRITICAL lockout line. Details: docs/native-oidc.md, "Upgrading from OIDC_SUBJECT_USER_IDS".Wider provider profile. RS256, PS256 and ES256 ID tokens (as advertised by discovery),
client_secret_postviaOIDC_TOKEN_AUTH_METHOD,OIDC_EXTRA_SCOPES,OIDC_DISPLAY_NAMEandOIDC_CA_FILEare new.OIDC_REQUIRED_GROUPis now optional; set, it works as before. The requested scopes becomeopenid email profile. A provider that advertises RFC 9207 must now returnisson the callback.SSO logins now stamp the user's last-login time.
Across the reranker-documents release (#402):
No migration, nothing re-derived or re-embedded.
rerank=truenow sends each candidate note's embedding input (title, heading path, tags, then the chunk) for its cosine-best chunk and up to three more of its already-fetched chunks, at mostRERANK_MAX_DOCUMENTSper call (new, default 100, 50–200;50restores the previous count); a note scores the best of its documents.rerank=falseis byte-identical. The usage row gainsrerank_documents.RERANK_TIMEOUT_MSaccepts 100–30000; the default stays 1,500. Size it with the document budget:RERANK_TIMEOUT_MS ≥ RERANK_MAX_DOCUMENTS × average characters × per-character cost, doubled when the GPU is shared with the embedding model. The reference deployment runs20000(DEPLOYMENT.md, "Reranker (optional)"). UnderMCP_CONCURRENCY_MODEqueueorenforce, keep it at or belowMCP_CONCURRENCY_WAIT_SECONDS × 1000unlessmake concurrency-reportpasses withrerank=truetraffic.Rollback is a redeploy of the previous image. Set
RERANK_TIMEOUT_MSto 10000 or less first: the previous image's range ends there and refuses to start above it.
Across the Client ID Metadata Documents release (migration 036, #357):
Migration 036 adds one nullable column and one CHECK to
oauth_clients, with no backfill, and takes seconds. Its downgrade refuses while CIMD clients exist (delete them in the panel first).Connectors switch to CIMD on their next connection. Existing DCR grants keep working. claude.ai, Claude Code and ChatGPT stop calling
/register.OAUTH_CIMD_ENABLED=falseis the rollback lever.Every authorization redirect now carries
iss(RFC 9207). A client that compares it does so against the metadataissuer, which is unchanged.resource(RFC 8707) is logged, not enforced. Each/authorizeand/tokenrequest is classified (resource_class) in the security log. Refusing a foreignresourceis a later change, gated on 14 days of these logs (DEPLOYMENT.md).The consent page's CSP gains
form-action http://localhost:* http://127.0.0.1:*for native loopback callbacks.
Across the scoped tools/list release (#358):
No migration and no setting. An OAuth grant without
readwritenow lists 19 tools: the nine write-required tools (create_note,edit_note,move_note,delete_note,set_frontmatter,write_file,delete_file,import_from_url,request_upload) are left out. API keys of either permission andreadwritegrants still list all 28, byte-identical to before. A read-only client that cached the 28 and calls a hidden tool getspermission_denied, as before.No
list_changedis sent. After a grant's scope is changed in the panel, the connector sees the new list when it reconnects.One refusal changes for read-only callers. The refusals
write_file/delete_filemade before their permission check (a malformedexpected_hash,no_incumbentforwrite_file(overwrite=false)) are nowpermission_denied; areadwritecaller's refusals are unchanged.
Across the keyword-tags release (migration 035, #391):
Tags become searchable at once. Migration 035 adds each note's tags to its keyword vector in place, in SQL, under the index generation lock (tens of seconds on a few thousand notes); nothing is re-embedded or re-derived and no setting is new.
make deploystops the app before the migration; on a hand-driven compose stack: stop →alembic upgrade head→ start.Run the read-only check first. 035 aborts with nothing written if a tagged vector would cross PostgreSQL's 1 MiB tsvector limit; under Kubernetes
Recreatethat is downtime until the digest is reverted. DEPLOYMENT.md, "Upgrading across migration 035" has the statement to run against the live database before merging and the remedy.Rollback:
alembic downgrade 034with the new image strips the tags part, then deploy the previous image.
Across the chunk-minimum release (CHUNKING_VERSION 2, #390):
No migration and no new setting, but a second gradual re-embed. Chunks shorter than 200 characters are no longer stored (a short section is grouped with its neighbours), windows are cut at a line or word start, and long whitespace runs are sent collapsed. Startup does not refuse; every note is selected again in the background under the per-tenant embed budgets.
Until your notes drain, the
index_transition: N notes not yet re-chunked; …line returns onsemantic_search,find_relatedandhybrid_search, and/healthreadsindexer.rechunk: "in_progress", then"complete". A section that did not change keeps its vector; each pass logsEmbedding complete: N notes, X chunks (S submitted, R reused).Rollback is a redeploy of the previous image, which re-embeds every note stamped 2 in full (DEPLOYMENT.md).
Across the search-confidence release (#389):
No migration. Every
semantic_searchandhybrid_searchpage gains one header token:— confidence: ok(at the default threshold 0 that is the only byte that changes). A parser that matched the old header exactly needs to allow it. Usage rows gainconfidence,top_similarityand (hybrid)keyword_all. One optional setting,SEARCH_LOW_CONFIDENCE_SIMILARITY(default 0 = off); leave it at 0 until the calibration recipe inDEPLOYMENT.mdpasses for both tools.The search-eval harness reports recall@20 and recall@50, runs at
--depth50 by default and writesreport.jsonschema_version2; arunfile:baseline staged at depth 20 scores a null recall@50, so re-run it for a delta. It gains aconfidencesubcommand.Rollback is a redeploy of the previous image; the new usage keys stay and are ignored.
Across the reranker release (#367):
No migration, nothing re-derived or re-embedded.
semantic_searchandhybrid_searchgain an optionalrerankargument (default false, output unchanged), and four optional settings (RERANK_URL,RERANK_MODEL,RERANK_TIMEOUT_MS,RERANK_ALLOW_PLAINTEXT). Nothing changes until you setRERANK_URL. The concurrency class mapping is unchanged, so readiness evidence carries over. A reference setup is in Reranker reference setup.Rollback is a redeploy of the previous image. A client that keeps sending
rerankis then refused by the unknown-argument rule, which is the normal cost of rolling back a new argument.
Across the hybrid-search release (#354):
No migration, nothing re-derived or re-embedded. A new tool,
hybrid_search, and one optional setting,HYBRID_RRF_K(default 60).A new concurrency-readiness epoch.
hybrid_searchshares theembeddingclass withsemantic_search, soCLASS_MAPPING_VERSIONmoves to 5 andmake concurrency-reportevidence gathered before the upgrade does not carry over.Rollback is a redeploy of the previous image; the tool's usage rows stay and are ignored.
Across the change-feed release (migration 033, #351):
One migration, no re-derive. 033 adds
notes_metadata.content_changed_at(backfilled from each note's modification time) and three change-feed tables. Nothing is re-parsed or re-embedded. The feed starts with the first pass after the upgrade; nothing before 033 has events.The feed tables are durable.
make db-backupand the Kubernetes backup Job dump their rows (history, cursors and retention watermarks cannot be rebuilt from the vault). A restore rolls the feed back to the dump, so a cursor taken after it is refused and the agent restarts from a date.A new concurrency-readiness epoch.
get_changesjoins thescanclass, soCLASS_MAPPING_VERSIONmoves to 4 andmake concurrency-reportevidence gathered before the upgrade does not carry over.Four new settings, all with working defaults:
CHANGE_FEED_RETENTION_DAYS,CHANGE_FEED_MAX_EVENTS_PER_SCOPE,CHANGE_FEED_MAX_EVENTS_PER_PASS,CHANGE_FEED_LOCK_TIMEOUT_MS(see Configuration).Rollback: the previous image neither reads nor writes any of these objects;
alembic downgrade 032drops them and loses only the feed's history.
Across the task-listing release (migration 032, #350):
One full re-derive pass after the upgrade, and no re-embedding. The extraction version moves to 4, so the first pass re-parses every note once and stores its checkbox tasks for the new
list_taskstool — the same cost as the earlier extraction-version bumps. Version 4 shares version 3's embedding cleaner, so nothing is re-embedded and no provider call is made. Until that pass finishes,list_tasksreports the notes it has not scanned yet in its header, andmove_note(rewrite_links=True)refuses withindex_not_readyas it does after every bump.A new concurrency-readiness epoch.
list_tasksjoins thescanclass, soCLASS_MAPPING_VERSIONmoves to 3 andmake concurrency-reportevidence gathered before the upgrade does not carry over.Rollback is roll-forward. A bare redeploy of the previous image re-extracts every note once, and because it has no version-4 cleaner it also clears every note's embedding certification; the embed pass then re-chunks every note and reuses every stored vector (no provider calls), with
semantic_searchmarking those notes stale until it catches up. Rolling forward again is one more re-derive pass.No new setting.
Read this first when upgrading across the keyword-ranking release (migration 031, #344):
Keyword ranking changes at once; snippets need one rebuild. Migration 031 rewrites every keyword vector in place so titles and aliases rank above bodies — no operator step, and
make deploynow stops the app before a pending migration and recreates it after (on a hand-driven compose stack: stop →alembic upgrade head→ start; Kubernetes alreadyRecreates). Snippets come from an excerpt that only a write stores, so notes indexed before 031 show no snippet (the header counts them and startup logs the count) until they are edited or you runmake rebuild-tsvectorsonce (on Kubernetes,deploy/kubernetes/base/rebuild-tsvectors-job.example.yamlwith the app scaled to zero). No embeddings are touched, no API calls are made.New optional settings:
RANK_WEIGHTS,KEYWORD_EXCERPT_CHARS,KEYWORD_SNIPPET_ROWS. See Configuration.
And across the internal-transport and panel-CSP release:
Breaking: the server refuses to run as a PostgreSQL superuser (#324). A Compose install created from
docker-compose.simple.ymlordocker-compose.proxy.ymlbefore this release connects as the cluster superuser and must run the one-time conversion in DEPLOYMENT.md, "Upgrading: split database roles" (a backup, a newpostgres.env,OBSIDIAN_DB_PASSWORDin.env, one script); the new compose files will not serve on an unconverted volume. Any other deployment whoseDATABASE_URLnames a superuser is refused at startup with a message; switch it to a non-superuser owner of the database, or setDATABASE_ALLOW_SUPERUSER=trueas a stop-gap. The Kubernetes bundle is unaffected. ADATABASE_URLpassword ofchangeme/CHANGE_MEis now refused, and the built-in default URL carries no password.Breaking: plaintext embedding endpoints must be acknowledged. If the active embedding URL (
OLLAMA_URL,TEI_URLwith the TEI provider, orOPENAI_BASE_URLwith the OpenAI provider) ishttp://to a non-loopback host — thehttp://ollama:11434default included — addEMBEDDING_ALLOW_PLAINTEXT=trueto.envbefore deploying, or the server refuses to start with a message naming the setting.Database TLS has one source. A TLS parameter in
DATABASE_URL(?ssl=…,?sslmode=…) or anyPGSSL*environment variable is refused at startup; move it toDATABASE_SSL_MODE. The default,prefer, is the behaviour you had before.Embedding clients ignore the environment's network settings.
HTTP(S)_PROXY,SSL_CERT_FILE/SSL_CERT_DIRand.netrcno longer apply to the embedding hop. UseEMBEDDING_CA_FILEfor an internal CA.The panel now sends a nonce-based Content-Security-Policy (
PANEL_CSP=enforce), and htmx is gone from it. If a panel control misbehaves, setPANEL_CSP=report-only(oroff) and recreate the container; no rebuild.New optional settings:
DATABASE_SSL_MODE,DATABASE_SSL_CA_FILE,DATABASE_SSL_CERT_FILE,DATABASE_SSL_KEY_FILE,EMBEDDING_ALLOW_PLAINTEXT,EMBEDDING_CA_FILE,PANEL_CSP. See Configuration, andDEPLOYMENT.mdfor moving both hops to verified TLS.
Cost expectations
If you go the OpenAI route (the realistic path on a CPU-only VPS), the first-index spend is small and the steady state is nearly free. Rough numbers assuming an average note around 1,500 tokens (three 512-token chunks), at OpenAI's published rate at time of writing:
Model | $/1M tokens | 1k notes | 10k notes | 100k notes |
| $0.02 | ~$0.05 | ~$0.50 | ~$5.00 |
| $0.13 | ~$0.30 | ~$3.00 | ~$30.00 |
After the first index, only changed notes are re-embedded. Ongoing cost is proportional to edits — pennies a month for a typical vault.
If you self-host Ollama with a GPU, embedding cost is whatever your power bill is. Ollama on CPU works but is too slow to be usable on a vault of more than a few hundred notes.
The self-describing vault
This is the part most "MCP for Obsidian" projects miss. They stop at read, write, and list. The interesting question isn't "can the agent reach the files," it's "does the agent know the rules?"
If you have an opinionated vault — task placement logic, folder conventions, required frontmatter, tag taxonomy — an agent with write access can do real damage without that context. Tasks land in the wrong folder. Bare-date filenames collide with templates. Wrong tags break Dataview queries. The data layer works fine; the context layer is where the failures show up.
The fix is small. Keep a machine-readable instruction file
(CLAUDE.md at the vault root) that describes the system's own rules.
Expose it as a dedicated tool. Every connecting agent calls it once at
the start of a session and immediately knows how the vault works.
Update the file, every agent sees the change on the next call. No
client-side config. No system-prompt injection. The vault is
authoritative about its own rules.
get_vault_guide() does exactly this. It returns a generic Obsidian
primer (wikilink syntax, embed syntax, tag conventions, common plugin
literals) plus the vault's CLAUDE.md live. The write-tool
descriptions and the server's instructions both point at it — as a
description of where the vault's conventions live, not as an order —
so the agent gets pulled into the right behavior even without
prompting.
Multi-user mode
Single-user mode is the default and works exactly as described above — one vault, one set of API keys, no in-app user concept. Multi-user mode is an opt-in flag that turns the same container into a small multi-tenant deployment: in-app username/password login, per-user vault scoping, an admin role for troubleshooting, and a regular-user role that sees only its own keys/OAuth clients/usage. One container, one Postgres, strict isolation between users.
Enable it on an existing deployment with no data loss — your current vault and keys carry over to the bootstrap admin.
Enabling
Set
MULTI_USER_MODE=trueand a strongSECRET_KEYin.env(openssl rand -hex 32is fine). The app refuses to start with a placeholderSECRET_KEYunconditionally — single-user mode included — so this is not something the flag turns on.make deploy(ordocker compose up -d --force-recreate).Visit the panel. Because the
userstable is empty, you're routed to/admin/register— the one-time bootstrap form. It's still behind Traefik'schain-oauth@filemiddleware, so only people Traefik already trusts can claim admin.Register with a chosen username and password. The bootstrap form pre-fills
vault_pathwith whateverVAULT_PATHwas set to, so your existing notes immediately belong to this new admin. No re-index, no re-embed, no data loss — every previously indexed note, API key, OAuth client, and usage log row gets backfilled to the bootstrap user in a single transaction.
Inviting users
Edit
docker-compose.ymlto add a volume mount for the new user's vault under/vaults/<username>. Host paths with spaces must be quoted as a single YAML string:volumes: - "/storage/vaults/alice:/vaults/alice" - "/storage/shared/bob/Obsidian:/vaults/bob"make deployto apply.In the panel,
/admin/users/create— pick a username and set an initial password./admin/users/{id}/edit— set the user'svault_pathto the container path you just mounted (e.g./vaults/bob). The form shows a dropdown of unassigned/vaults/*directories that exist on disk.Share the credentials out-of-band. The user logs in at
/admin/auth/login, gets their own keys/OAuth/usage views, and cannot see other users' notes.
What admins see
Admins see API keys, OAuth clients, and usage logs for all users; they
own the Settings page (embedding provider, indexer trigger, danger
zone) and the Users page. Admins do not browse other users' vault
contents through the panel — that's intentional. Troubleshooting
another user's vault means either inspecting it via docker exec or
temporarily reassigning their vault_path, not UI snooping.
Rolling back
Set MULTI_USER_MODE=false, restart. Existing API keys keep working
(per-user filters skip when no user context is set), the login UI and
session cookies disappear, and the panel falls back to its
Traefik-OAuth-only mode. The schema stays in place, so flipping back
to multi-user later resumes where you left off without re-bootstrapping
(the users table is non-empty, so /admin/register is closed).
Single sign-on (optional)
Multi-user deployments can add "Sign in with SSO" through any
standards-compliant OpenID Connect provider (Keycloak, Authentik,
Authelia, Zitadel, Kanidm, Okta, Entra ID, …). It is off by default
(OIDC_ENABLED=false), and with it off nothing changes.
It signs in existing accounts only. An admin links each account on its edit page, Single sign-on card: Expect email (the first sign-in within 7 days whose provider-verified email matches links the account, once) or Bind subject (paste the provider's
sub, linked immediately). After that only the provider's issuer and subject identify the user; a renamed or re-addressed provider account changes nothing. An identity that is not linked is refused with a page that does not say why.No provisioning, no role mapping. Signing in never creates a user, changes the admin flag or assigns a vault, and
/admin/registeris closed while SSO is on. Create users first.The server stays the OAuth server for MCP clients. SSO only changes how the panel session is made; that session also covers the consent page, so connecting a client can go through SSO. API keys, grants and tokens are unchanged.
Password login stays unless you set
LOCAL_LOGIN_ENABLED=false. While it is off, the panel refuses any change that would leave no active admin linked to SSO, and startup logs a CRITICAL line if there is none. Re-enabling it and restarting is the recovery path.Unlinking clears the link and signs that user out everywhere. Removing someone at the provider stops new logins but does not end their existing sessions, keys or grants: deactivate the local account for that.
docs/native-oidc.md has the provider requirements, every setting, a click-by-click Keycloak walkthrough, the setup order, break-glass recovery and troubleshooting by refusal reason.
Constraints and known limits
The indexer iterates active users sequentially each cycle. Fine for tens of users; hundreds would need parallelization.
Password recovery is admin-driven — there's no email-based reset. A signed-in user can rotate their own password at
/admin/account(current password, new password, confirmation; minimum 12 characters), which signs their other browsers out and keeps the one they changed it from signed in. The admin reset stays the recovery path for somebody who cannot sign in at all, and it also ends every live session of the account it resets./admin/auth/loginand/admin/account/passwordare rate-limited at 5 requests per minute; the login limit is keyed on the client address, and the password change carries two independent limits — one per account, one per address. The limiter's storage is in-memory and per-process, so counters reset on restart. The Traefik OAuth gate in front of the panel is still the main brute-force defense; if you expose/admin/auth/loginto the open internet, put a rate-limit middleware in front of it as well.Panel sessions are server-side rows (
user_sessions), so logging out, changing a password, a deactivation or a delete really ends them. The trade-off: the first deploy of the build that introduced the registry signs every live panel session out once, because a cookie issued before it carries no session id and is refused rather than grandfathered. Everyone signs in again; nothing else changes.The
vault_pathvalidator does not resolve symlinks, so an admin can technically point a user at host files via a symlinked/vaults/<name>. Treat/vaults/as an admin-trust boundary. What is checked, since the vault-root overlap guard: two active users' roots may not name overlapping directories. Each root is opened once and compared by inode identity —(st_dev, st_ino), which catches a symlink alias or a bind mount naming one directory twice — and by a component-wise containment test over the two canonical real paths in both directions, which catches an ancestor/descendant pair like/vaults/teamand/vaults/team/private. A conflicting assignment is refused in the panel naming the other user, and the same checks re-run before every index pass, so an alias created after the assignment quarantines both accounts: their MCP tools, index passes and transfer redemptions are refused until an administrator corrects it, and no index rows are deleted. A root that cannot be opened at all quarantines only its own account. What is still not detected, and the consequence: a bind mount that grafts one user's vault — or any mount nested inside it — to a path inside another user's root.mount --bind /vaults/b /vaults/a/innerleaves both root inodes distinct and both canonical paths outside each other, so neither check sees it, and user A can then read, overwrite and delete every note in user B's vault through the ordinary write tools, while A's index pass files B's notes under A's account so A's searches return B's content. The same gap covers an accessible alias of a root that could not be examined: that peer keeps serving. Neither condition is reported anywhere. Both require an administrator to write a bind mount into the deploy configuration — which is why/vaults/and the compose file's mounts are the admin-trust boundary, not just the path strings. This is a permanent, stated limit rather than a pending fix: mount detection was specified, failed on a new topology in each of three review rounds, and was dropped. The operator rule: never mount one user's directory, or anything nested in it, inside another user's root.
Configuration
Variable | Default | Purpose |
| — |
|
|
| The server refuses to start when its database role is a PostgreSQL superuser. |
|
| Database TLS: |
| — | CA bundle (PEM) for |
| — | Client certificate (PEM). Strict modes ( |
| — | Client private key for |
|
| In-container vault mount |
| — | itsdangerous signer key |
|
| Periodic reindex cadence |
|
| Leave sync-conflict copies (Syncthing |
|
| How long |
|
| The most change-feed events kept per user (minimum 1,000). Always applies, even with the age limit off, so the table stays bounded; a scope's newest event is never pruned. |
|
| Events one index pass itemises per user (100–50,000); the rest become one |
|
| How long an event write waits for the user's feed lock (100–30,000). A timeout never fails a pass or a tool: a pass records a durable |
|
| Consecutive failures of any indexer counter (a scope's index passes, its embed passes, its incomplete re-derives, or the tick's own user enumeration) at which |
|
| How many times one index pass may roll back and re-run a scope after quarantining a note the database refuses (a data-exception or program-limit error on its row, keyword vector, move or links). Beyond it the pass fails as an ordinary failure; the notes already found stay quarantined for the next tick. |
|
| In-app login, per-user vaults. See Multi-user mode. |
|
| How long the vault-root overlap check waits on one root before giving up on it. Expiry quarantines that one account ( |
| — | Public hostname. Derives |
| derived | Explicit public origin. HTTPS except on loopback. |
| derived | CORS origins, JSON list |
| derived | Accepted |
|
| Panel session lifetime, seconds (multi-user mode). Absolute — the server-side row is never extended, so a session used daily still expires |
|
| Panel session cookie name |
|
| The panel's password form (multi-user mode). |
|
| Browser SSO through an OpenID Connect provider (Single sign-on). Requires multi-user mode and an HTTPS |
| — | Required with SSO. HTTPS issuer URL exactly as the provider's discovery |
| — | Required with SSO. The confidential client registered at the provider, redirect URI |
|
|
|
| — | Optional. When set (at most 512 characters), the ID token's |
| — | Extra scopes requested after |
|
| The login button reads "Sign in with {name}". 1–40 printable characters. |
| — | PEM CA file trusted for the provider requests only, for an issuer behind a private CA; when set, only this file is trusted for them. Unset, empty or |
| — | Retired. Any non-empty value refuses startup; links are made in the panel. See Upgrading and docs/native-oidc.md. |
|
| Content-Security-Policy on the panel, login and consent pages: |
|
| How stale a session's |
|
| How long a dead panel session row is kept, measured from the later of its expiry and its revocation, so a revocation stays visible for the full window. Must be ≥ 1. |
|
| Redirect hosts the consent screen badges as known connector destinations. JSON or CSV. Matched by exact host equality — no wildcards, no suffixes; entries containing |
|
| Accept OAuth Client ID Metadata Documents (an |
|
| Ceiling on how long a fetched client metadata document is cached (its |
|
| Client metadata document fetches one client address may start per minute (1–120). Cache hits and requests joining an in-progress fetch spend nothing. Fetches are also capped at one in flight per address and eight per server. |
|
| Absolute lifetime of an OAuth grant, in whole days (1–365), counted from when the application first receives its tokens. Refresh never extends it; after it the user must approve again. Stated on the consent page. No off value — empty, |
|
|
|
|
|
|
|
|
|
|
| Keyword-search text-search config(s). JSON or CSV. See Full-text search language(s). |
|
|
|
|
| Leading characters of each note's indexed text stored for |
|
| Rows per |
|
| Where |
|
|
|
|
| Default life of a transfer link. Per-call |
|
| How long one claimed upload may stream before the token is spent |
|
| Simultaneous upload streams |
|
| Let |
|
| Accept named staging on filesystems without |
|
| Require |
|
| The timezone in which the task tools resolve |
|
|
|
|
|
|
|
|
|
|
| Where a recurring task's next occurrence goes: |
|
| Which checkboxes count as tasks for every caller who has not chosen a rule on the panel's Tasks card: |
| empty | Comma-separated task tags for |
| empty | The filter text for |
|
|
|
|
| pgvector column width |
|
| Used when provider is Ollama. Must be |
|
| Ollama model name. |
| empty | Prepended verbatim, with no separator, to every search query sent to the embedding provider, and never to a note. For instruction-tuned embedders such as Qwen3-Embedding, e.g. |
|
| How long Ollama keeps the model resident. |
| — | Required when provider is OpenAI |
|
| Override for Azure, proxies, or any OpenAI-compatible embeddings server (including TEI's |
|
| TEI endpoint, used when the provider is |
|
| Must equal the |
| — | Secret. Bearer token for a TEI started with |
|
| Inputs per native |
|
| Permit |
| — | Trust anchor (PEM) for an |
| — | Full URL of an optional reranker speaking the Jina-compatible |
| — | Sent as |
|
| One deadline per rerank call (100–30000), covering connect, write and read; past it the page falls back unreranked with |
|
| The most documents one rerank call sends (50–200). Every candidate note (at most 50) is sent its best chunk first, then up to three more of its already-fetched chunks in distance order; a note scores the best of its documents. Rerank latency multiplies with it and |
|
| Permit |
|
| OpenAI model. Changing it post-deploy requires |
|
| Approx tokens per chunk (4-char heuristic) |
|
| Token overlap between chunks |
|
| Globs skipped by the embedder. Excluded files stay keyword-searchable. |
|
| Failed |
|
| The window that budget is counted over. |
|
| Counter slots in the fixed-size, per-process-salted address table. Memory is O(size); collisions only make the control stricter. |
|
| Sustained tool calls per minute per principal (an API key, or an OAuth grant). Null — with the burst — disables the general bucket. |
|
| Capacity of the general bucket. Must be set together with its rate or nulled together with it. |
|
| Sustained vault-mutating calls per minute per principal — the twelve write tools, plus |
|
| Capacity of the write bucket. |
|
| Principals holding their own limiter entry before further ones share one overflow entry. |
|
| How long one rate/slot-refusal coalescing window stays open. Inside it a refusal writes nothing; the row that lands stands for |
|
|
|
|
| Tool admission wait in enforce mode, 0–5 seconds. Shadow requires zero. |
|
| Global tool ceiling in enforce mode, also subject to class, tenant (3), and principal (2) ceilings. |
|
| Full MCP request ceiling, including open streams; per bearer fingerprint ceiling defaults to 4. |
|
| Authentication database-session ceiling. Released before response delivery or downstream work. |
|
| Usage-log writer ceiling; includes fallback inserts. Defaults: 64 pending writers and a 0.25-second enforce-mode wait. |
| unset | The |
|
| The derivation: limit × fraction ÷ multiplier = raw body bytes in flight. Fraction 0.1–0.5, multiplier 8–32. |
|
| How long a body that does not fit waits before its 429, and how many may wait at once. |
|
| Daily quota a newly created API key receives when the caller names none (an omitted JSON field or a blank panel field). Existing keys are untouched. Only an administrator can create or restore an unlimited key, with the panel's Unlimited box or an explicit JSON |
|
| API keys one account may create per window, across |
|
| API keys created from one client address per window, across both routes and all accounts. Null disables. |
|
| The fixed window both key-creation limits are counted over. |
|
| Active API keys a non-admin account may hold; beyond it, creation is refused until a key is revoked. Admins exempt. Null disables. |
|
| Refuse a tool call carrying an argument the tool does not declare (a tool error naming it), and publish |
|
| Registry-eval only. Skips DB, indexer, embedding provider, and |
See .env.example for the full set with comments. For first-index
spend on OpenAI, see Cost expectations above.
The MCP transport's request-body limit is derived, not configured:
max(2 × MAX_FILE_WRITE_BYTES, 6 × 10 MB) + 1 MiB, which is 61 MiB with
the defaults. It has to track the write caps so that every supported
write is refused by the tool — with an actionable message — rather than
by the transport with a bare HTTP 413. Raise MAX_FILE_WRITE_BYTES and
the transport limit follows.
That limit is per request. The sum of request bodies in flight is
bounded too, always (#322): each /mcp POST reserves its declared size
against a budget derived from the container's memory limit (half of it,
÷ 8 for the parsing overhead — 128 MiB of raw body on a 2 GiB container),
waits up to 15 s if it does not fit, and otherwise gets HTTP 429 with
code: body_memory and Retry-After: 2. The server refuses to start in a
container too small to admit one maximum-size body (about 1.1 GiB with the
defaults). The MCP_BODY_* settings in .env.example only allow the safe
direction.
Embedding model choice
Two local models are documented here. Both are multilingual and produce
1024-dimensional vectors, so EMBEDDING_DIMENSIONS=1024 fits either.
bge-m3is the code default (EMBEDDING_MODEL=bge-m3) and stays a fully supported choice. It needs no query instruction (EMBEDDING_QUERY_INSTRUCTIONempty). The default is not changing: the stored-fingerprint guard refuses to start a deployment whose model changed, so a new default would stop every existing install that relies on it.qwen3-embedding:0.6bis what the reference deployment has run since 2026-10-31, with a query instruction. The instruction is applied to queries only (notes are embedded without one) and is outside the stored fingerprint:EMBEDDING_PROVIDER=ollama EMBEDDING_MODEL=qwen3-embedding:0.6b EMBEDDING_DIMENSIONS=1024 EMBEDDING_QUERY_INSTRUCTION="Instruct: Given a question, retrieve the notes that answer it\nQuery: "
What was observed after the switch, on one user's vault (not a
benchmark): cross-language recall between English and Russian queries and
notes was strong, and hybrid_search became the day-to-day default. No
harness A/B was run for the switch, so no quality gain is claimed. To
measure it on your own vault, use the search-evaluation recipe in
DEPLOYMENT.md.
Switching an existing install is a full re-embed (the procedure is
below). For scale: on an 8 GiB Quadro
P4000 shared by Ollama and the reranker, ~4,200 notes re-embedded in about
84 minutes. SEARCH_LOW_CONFIDENCE_SIMILARITY is model-dependent: its
0.50 candidate was measured on bge-m3, so re-calibrate after a switch.
Reranker reference setup
rerank=true is opt-in. Before #402
the reranker scored one heading-less chunk per note, which demoted some
notes both search arms ranked first; it now scores each note on the
embedded text (title, heading path, tags, chunk) of up to four of its
fetched chunks (RERANK_MAX_DOCUMENTS). The #402 real-data gate ran on
2026-10-31 against the previous reranker documents and passed 4 of 6
reports (the owner waived one near-miss cell). Measured against
rerank=false on the reference vault (2026-11-01, 196 queries), it
improves semantic_search (overall recall@10 0.505 → 0.582, nDCG@10
0.389 → 0.442) and makes hybrid_search worse (MRR 0.533 → 0.465,
nDCG@10 0.519 → 0.474), because plain hybrid is already the strongest
ranking there. Keep rerank=false as the default, use rerank=true
with semantic_search when the top few rows matter, and call
hybrid_search without it. The intervals and the method are in
DEPLOYMENT.md; measure on your
own judgments after a model or reranker change.
Ollama has no rerank endpoint
(ollama/ollama#3368), so
the reference deployment runs llama.cpp's llama-server (image
ghcr.io/ggml-org/llama.cpp:server-cuda12-*, pinned to a build) serving
bge-reranker-v2-m3 as a Q8_0 GGUF with --reranking, behind TLS:
RERANK_URL=https://<host>:<port>/v1/rerank
RERANK_TIMEOUT_MS=20000Measured on the same P4000 with nothing else running: 50 documents of ~410
characters in 1.6 s, 50 documents of 2,000 characters in 7.3 s. Candidates
are cut to 2,048 characters, so the 1,500 ms default deadline is too short
for this card. A hybrid rerank=true call sends 67–68 documents on the
reference vault and takes about 9–10 s uncontended (68 documents of 2,000
characters measured 9.1 s), so the reference runs 20,000 ms since
2026-11-01; the setting accepts 100–30000. Details, the sizing table and
the startup checks are in DEPLOYMENT.md.
Switching providers or models
Different models produce vectors in different spaces, and cosine distance between two spaces is meaningless. So any change to what produced the stored vectors requires a full re-embed — not only a provider switch. That is every one of:
EMBEDDING_PROVIDEREMBEDDING_MODEL(Ollama),OPENAI_EMBEDDING_MODEL(OpenAI), orTEI_EMBEDDING_MODEL(TEI) — including a swap between two models of the same dimension, which the dimension guard cannot seeEMBEDDING_DIMENSIONSCHUNK_SIZEandCHUNK_OVERLAP
Two things are deliberately not on that list. EMBEDDING_QUERY_INSTRUCTION
touches only queries, so no stored vector depends on it. And the chunking
format itself (heading-aware sections, the context prefix, and the
200-character minimum chunk length, which is a constant tied to the chunking
version rather than a setting) is versioned per note: when it changes, the
indexer re-embeds notes in the background over several passes, without a
refused startup or a reset.
The server stores a fingerprint of that configuration and compares it at startup. On a mismatch it logs both fingerprints and the fields that differ, names the repair, and exits non-zero — so a model swap that used to mix two vector spaces in one column silently, for ever, now stops the process instead.
The steps, in this order:
Update
.env.make deploy(ordocker compose up -d --force-recreate). The new container will refuse to start — at the fingerprint guard, or at the dimension guard if the width changed — and that refusal is the point: a container that will not start embeds nothing while the reset runs.make reset-embeddingswhile it is down. The target isdocker compose run --rm, so it starts a one-off container that reads your edited.env: it recreates the column at the new dimension, clears everyembedded_content_hash, and records the new fingerprint in the same transaction.Restart the service. It starts silently, because the stored rows really were produced under the configuration it is now running, and the next indexer pass re-embeds the vault.
This inverts the older reset-before-recreate advice. That ordering
was safe only while nothing depended on a stored claim about the
configuration; now the reset is what writes that claim, so it has to
run with the new .env in place and with no old-configuration container
able to embed against it. Skipping a step costs time rather than
correctness — a database-level generation lock makes an
old-configuration container's certifications refuse rather than land —
but the ordering above is the one that never has to rely on it.
Maintenance waits for an in-flight index pass. That same generation
lock is taken at the head of the index pass's transaction and held until
it commits, so make reset-embeddings and make rebuild-tsvectors block
until the pass finishes — up to a few minutes on a large vault — rather
than interleaving with it. That wait is the required behaviour, not a
stall to work around: a reset that landed mid-pass is precisely the
interleaving that stores vectors from one configuration under a
fingerprint naming another. Neither command sets a short lock timeout,
and neither should be given one — and because the server sets a 60-second
statement_timeout on every connection, both commands (and the panel's
Danger-zone resets) lift that timeout for the acquisition itself and
restore it once the lock is theirs. Without that, a command started
against a live service was cancelled after a minute rather than waiting,
which reads as a broken command instead of a busy index.
You can also use Settings → Danger zone → Reset embeddings in the control panel, which performs the same SQL — including the fingerprint record — while the server is running (pauses the indexer, runs the SQL, resumes).
The fingerprint records the configuration, not the model artifact.
bge-m3is a mutable Ollama tag (so isqwen3-embedding:0.6b), soollama pullcan replace the weights behind it, andOLLAMA_URL/OPENAI_BASE_URL/TEI_URLare deliberately excluded from the fingerprint — repointing at another host or proxy is usually an infrastructure move that serves the identical artifact, and including it would demand a full re-embed for one. The consequence is an accepted limitation: replacing the artifact behind an unchanged model name — re-pulling a tag, or pointing at a host serving different weights under the same name — mixes vector spaces undetected. It requiresmake reset-embeddings, and no startup check will catch it if you skip that. No value available to the server distinguishes the two cases, and a probe would have to trust the endpoint it is checking.
Full-text search language(s)
keyword_search runs over a PostgreSQL tsvector. The text-search
configuration it uses — the stemmer and stop-word dictionary — is
controlled by FTS_CONFIGS. It defaults to english, which reproduces
the historical behavior exactly, so existing deployments need no action.
The vector holds the note's title and frontmatter aliases at weight
A, its tags at weight B (frontmatter tags and inline #tags;
a nested tag also as each /-segment, so #ctx/phone is found by
phone) and its body at weight D, per configured config, and ranking
uses RANK_WEIGHTS — so a query that is a note's title ranks that note
first, where it used to lose to a long note repeating the words, and a
note tagged with a word ranks above one that only mentions it. Bare
terms are ANDed; when the full matches do not fill the page, the same
terms OR-ed fill the rest, tagged match: any. Each row carries a
snippet: built from a stored excerpt of the indexed text
(KEYWORD_EXCERPT_CHARS), computed for the first KEYWORD_SNIPPET_ROWS
rows. The excerpt is written with the vector; make rebuild-tsvectors
also stores it for notes indexed before it existed.
FTS_CONFIGS is a list, settable as JSON
(FTS_CONFIGS=["simple","norwegian"]) or comma-separated
(FTS_CONFIGS=simple,norwegian). Each note is indexed under every
listed config, and a query matches if any listed config's parse hits.
This is what makes a mixed-language vault work:
| Behavior |
| English Snowball stemmer (default; |
| Language-agnostic. No stemming or stop-words — matches exact word forms. A principled default for mixed-language vaults: keyword search is the exact-match arm, while |
| Both stemmers applied — keyword-side morphology for two languages at once. |
| Verbatim lexemes plus Norwegian stems. |
The setting is global — applied to every vault (consistent with
EMBEDDING_MODEL, CHUNK_SIZE, etc., which are global too). For a
mixed-language multi-user instance, set a superset (e.g.
["english","norwegian"], or ["simple"]). Per-user FTS config is a
clean future extension but is not implemented.
A typo'd or uninstalled config name fails fast at startup with a message listing the configs available in your Postgres instance, rather than producing silent zero-result searches.
Changing FTS_CONFIGS requires a rebuild, and the server refuses to
start until it has run. Stored tsvectors are computed at index time,
so they go stale when the config list changes — and a stale stemmer is
not merely incomplete. Under english the token running is stored as
the lexeme run, so a query under simple for run matches a note
that does not contain the word — a false positive, indistinguishable
from a real hit. Keyword vectors therefore fail closed exactly as
embeddings do: the server stores a fingerprint of FTS_CONFIGS, compares
it at startup, and on a membership change logs both lists and the
differing entries, names the rebuild, and exits non-zero. (Reordering the
same names is not a change: a note is indexed under every config and a
query matches if any hits, so order changes nothing and is not compared.)
The runbook:
Edit
FTS_CONFIGSin.env.make deploy. The new container refuses at the keyword fingerprint guard and stays down.make rebuild-tsvectors. It rebuilds every scope that holds rows — every owner, including rows with no owner in single-user mode — in one transaction, and records the new fingerprint only if every one of them reported a completed rebuild. It is all-or-nothing: one scope it cannot rebuild rolls the whole thing back, names the scope and the reason, and writes no fingerprint, because the fingerprint is a single claim about every retained row.Restart. It starts silently.
If step 3 names a scope it could not rebuild — a user whose vault is not assigned, a tenant still re-deriving its provenance, or ownerless rows under multi-user mode — there are three recourses, in order of preference:
Settle the scope: assign or delete the user, or let the re-derive finish, then re-run the rebuild.
Delete or reassign the ownerless rows, then re-run the rebuild.
Put
FTS_CONFIGSback to its previous value. That clears the refusal immediately, with no rebuild at all — a configuration edit is always reversible, which is what keeps this refusal from being an outage.
The rebuild re-reads each note and recomputes its content_tsvector
under the new config(s). It rebuilds the keyword index only — it does
not touch embeddings/vectors and makes no API calls, so it
finishes in seconds for a few thousand notes. (Do not confuse it with the
expensive make reset-embeddings flow.)
Tokenization caveat: the tsvector parser still splits on punctuation and hyphens regardless of config, so
bge-m3tokenizes tobge+m3.simplepreserves word forms, not punctuation-bearing strings; exact-string-with-punctuation matching would need a trigram index and is out of scope.
Response size limits
A tool result is model input. Whatever read_note returns is fed
straight back into the caller's next request, so an unbounded read is
an unbounded prompt — and the caller usually finds out only when its
inference provider rejects the request.
MAX_READ_RESPONSE_CHARS (default 40,000, roughly 10K tokens) bounds
what read_note and the text results of read_file return. It is a
different limit from MAX_FILE_READ_BYTES, which bounds what the
server reads off disk. A 3 MB note is comfortably within the 10 MB read
cap and will still destroy a context window; both caps are needed and
they have different correct values.
It applies per component, not once to the whole response: the
content window gets the cap, the heading outline gets it
independently, and the metadata fields (title, tags,
frontmatter_yaml and its JSON view, heading) share a third. A
truncated read can carry all three, so budget for a worst case of
roughly 3 × MAX_READ_RESPONSE_CHARS plus fixed prose — doubled again
because the MCP result carries both structured content and a JSON text
block, and multiplied by JSON escaping for content that is mostly
control characters.
When a note exceeds the cap you get the first window plus truncation as
data — truncated, the next_offset to continue from, total_chars —
and, for a whole-note read, an outline of the note's sections:
{"entries": [
{"ordinal": 1, "depth": 1, "text": "Client Records",
"size": 2855343, "exceeds_cap": true, "duplicate": false},
{"ordinal": 2, "depth": 2, "text": "Balance Sheet.xlsx",
"size": 391199, "exceeds_cap": true, "duplicate": false},
{"ordinal": 3, "depth": 2, "text": "Lease Agreement.pdf",
"size": 464, "exceeds_cap": false, "duplicate": false},
{"ordinal": 4, "depth": 2, "text": "Invoice 2025-044.pdf",
"size": 1075, "exceeds_cap": false, "duplicate": true}
], "truncated": false}Paging a multi-megabyte note 40K at a time is technically possible and
practically useless, so prefer the outline: read the one section you
want with read_note(path, section="Lease Agreement.pdf"). Sections are
addressable three ways — the #N ordinal shown in the outline, the
Parent/Child path-style form, and exact heading text. The ordinal is
the only form that separates duplicate sibling headings, which share
every ancestor and so cannot be disambiguated by path; notes generated
by bulk extraction tend to be full of them.
A bare #N always selects by position, so an ordinal we hand you in
an outline can never be shadowed by a heading that happens to be titled
#2. Such a heading stays reachable via the path form (Parent/#2) or
via its own ordinal.
The outline is itself bounded by the cap: a note with thousands of
headings gets a truncated listing that reports how many sections were
omitted (omitted) and the full ordinal range (first_ordinal,
last_ordinal), rather than an outline larger than the content window
it accompanies. Metadata that does not fit its budget is dropped whole
and reported in metadata_omissions — never cut short and never marked
inside the field itself, so nothing in a note-controlled field is ever
a prefix or server prose. frontmatter_yaml is the frontmatter block's
YAML source with the fence lines removed, LF-normalized (the same
declared terminator residual content carries); it is the authoritative
copy, and the frontmatter JSON view beside it is a convenience that is
omitted, with a reason, when YAML holds something JSON cannot say.
limit can lower the cap for a single call but never raise it. If your
clients genuinely want larger reads, raise MAX_READ_RESPONSE_CHARS —
that is an operator decision, made once, by someone who knows the
deployment.
Upgrading: three visible contract changes.
read_noteon a large note used to return the whole thing; it now truncates. The response is self-describing, so an agent needs no prior knowledge to continue, but a script that assumed whole-note reads should either passsection=or raise the cap.And
read_noteused to return one rendered string — a# <title>/**Path:**header, a\n---\nseparator, then the content. It now returns fields, because every component of that header was note-controlled: a note could forge the separator, so an agent recovering the section body by splitting the response could recover a crafted string and write it back over the section. A client that parsed the old envelope must readcontent(and, for section reads,heading) instead; clients that ignorestructuredContentstill get an unambiguous JSON text block.Panel sessions are now server-side rows, so everyone is signed out once at that upgrade. A cookie issued before it carries no session identifier, and such a cookie is refused rather than grandfathered — accepting it would keep the old replay window open for another seven days after the fix shipped. Sign in again; there is nothing to migrate.
Rate limits
The consumer of this server is an agent, and a retry-storming or prompt-injected agent is an ordinary input. Three controls bound how fast one credential can create work.
A general bucket —
MCP_RATE_LIMIT_PER_MINUTE(600) sustained,MCP_RATE_LIMIT_BURST(120) capacity — on every tool call.A write bucket — 120/min, burst 30 — that the twelve vault-mutating tools must pass in addition, and that
PUT /transfer/uploadconsumes too, charged to the principal that minted the capability so the write rate cannot be escaped by minting links and redeeming them.A per-address budget on failed
/mcpauthentication — 60 failures per 5 minutes — checked before the credential lookup, so a refused probe costs no database query.
The bucket is per principal: an API key, or an OAuth grant.
Refreshing an access token continues the same allowance rather than
minting a fresh one, and two separate /authorize approvals for the same
client hold independent allowances.
What an agent actually sees. A refusal is an ordinary tool result — never a protocol error, never a silent empty result set — and it ends with one machine-readable line:
Error: this credential exceeded its general rate limit of 600 calls per minute, so the call was refused before it ran. Nothing was read, written, or counted against the daily quota. Retry in 1 seconds, or slow the calling loop down.
MCP-REFUSAL {"code":"rate_limited","scope":"principal","limit":600,"limit_unit":"calls_per_minute","retry_after_seconds":1}The MCP-REFUSAL sentinel is line-initial and the JSON is one line, so
it survives being quoted into a transcript. A structured tool returns the
identical text in its declared error field. retry_after_seconds is
present only where waiting can actually help — a refusal for an
unassigned vault or an unencodable argument omits it rather than invite a
loop that cannot end. The same shape covers the daily quota
(over_quota), the query length cap (argument_too_long), and tool-body
refusals such as not_found, already_exists, and invalid_path. A partial
write also carries a typed outcome: read its explanation before retrying,
because some bytes may already have changed. Empty search results and
successful no-op calls remain successes.
The transport refusals are outside that contract, because there
is no tool call to answer: an over-budget unauthenticated request or an enforced MCP request/authentication
concurrency refusal gets an HTTP 429 with Retry-After, and so does an over-rate PUT /transfer/upload — which releases its claim rather than consuming
it, so the same link is still redeemable once the bucket refills.
Operational notes.
Limiter state is in-process and is not persisted, so a restart begins with every bucket full. That is sound only because the container runs
--workers 1; raising the worker count multiplies every rate above by the worker count.Refusals appear on
/admin/performanceas refusal counts, not in the latency percentiles. Repeated rate and enforced slot refusals are coalesced — one row per credential/tool/scope perMCP_REFUSAL_LOG_INTERVAL_SECONDS, each standing for1 + suppressedrefusals — so that a refusal loop cannot make writing the log the load.The velocity defaults are estimates against a small sample. Read
/admin/performancefor a week before treating any as settled, and disable one by setting it empty,nullornone(zero is refused at startup).The daily quota is the durable ceiling and it is separate: keys created from now on get
DEFAULT_DAILY_REQUEST_LIMIT(5,000) unless they name a limit — a blank panel field gets the default too — and only an administrator can make a key unlimited, explicitly. Keys that already existed keep whatever they had, and OAuth grants have no daily ceiling at all — velocity bounds only.Every new key is a new principal with full bursts, so key creation has its own budget: 10 keys per account and 20 per client address per hour, shared by the JSON API and the panel form, and a non-admin account may hold at most 25 active keys.
The rationale lives in
docs/architecture/rate-limits.md.
Concurrency admission
Concurrency admission ships with MCP_CONCURRENCY_MODE=shadow. It records
pressure under concurrency_shadow on existing usage rows and emits bounded
security events for request/authentication pressure. Calls keep their actual
outcome, quota accounting and duration. Shadow mode observes current occupancy
with zero wait; it does not predict how traffic would behave under enforcement.
In enforce mode, the server limits full MCP requests (including open SSE
streams), authentication database sessions, tools, and usage-log writers.
Tools pass velocity, vault and argument checks before acquiring slots; daily
quota is checked afterward. A rejected tool receives slot_timeout without
spending daily quota. Zero wait means immediate admission or refusal; a positive
wait uses a bounded queue and one deadline. A retry hint is not a promise that
a running call will finish by that time.
Every tool belongs to one of five classes (src/services/concurrency.py,
CLASS_MAPPING_VERSION 7), each with its own ceiling:
Class | Tools | Default ceiling |
|
| 1 |
|
| 1 |
| the twelve vault-mutating tools, including | 1 |
|
| 2 |
|
| 4 |
Global, tenant and principal ceilings default to 6, 4 and 3. OAuth refresh
keeps the same principal. Full request and per-bearer ceilings default to 64
and 20, authentication to 2, and usage writers to 1. The mapping version is
part of the readiness epoch, so a change to the classes (such as #428's) starts
a fresh window for make concurrency-report. All settings and queue limits
are listed in .env.example.
Startup validates the pool budget as auth + 2 × tools + writers + 4 ≤ 15.
The four connections of headroom are shared with panel, OAuth, indexing and
transfer work; this arithmetic cannot guarantee availability when those other
consumers exhaust it. Shadow mode does not enforce that budget. The controller
is in-process and requires the existing single-worker deployment.
Review pressure observations and long-lived stream occupancy before enabling
enforce. Choose off to disable concurrency admission; the existing velocity
limits and daily quotas still apply. Shadow requires a zero tool wait and never
adds a writer wait or drops a usage row because of its observed pressure.
Architecture
┌──────────────┐ ┌──────────────────────┐
│ MCP clients │ HTTP + Bearer key │ FastAPI app │
│ Claude Desk │ ────────────────────▶ │ ┌────────────────┐ │
│ Claude Code │ │ │ MCP server │ │
│ n8n agents │ │ │ (33 tools) │ │
│ OpenWebUI │ │ └─────┬──────────┘ │
└──────────────┘ │ ▼ │
│ ┌────────────────┐ │
│ │ Services: │ │
│ │ - vault │ │
│ │ - search │ │
│ │ - embeddings │ │
│ │ - links │ │
│ │ - indexer │ │
│ └─────┬──────────┘ │
│ ▼ │
│ ┌────────────────┐ │
│ │ Postgres + │ │
│ │ pgvector │ │
│ └────────────────┘ │
└──────────┬───────────┘
▼
┌────────────────────┐
│ Embedding │
│ provider │
│ (Ollama/OpenAI/TEI)│
└────────────────────┘Indexing pipeline
.md files in vault
↓ skip dot-dirs
parse frontmatter, extract tags (YAML + inline #hashtags)
↓ SHA-256 hash
skip if unchanged
↓
UPSERT notes_metadata (path, title, tags[], frontmatter JSONB,
content_hash, tsvector, modified_at)
↓
extract wikilinks/embeds/markdown-links → resolve targets →
note_links (source_id, target_id or NULL for dangling)
↓
chunk content (512 tokens, no overlap) → embed via provider →
note_embeddings (note_id, chunk_index, chunk_text, embedding[N])
↓
set embedded_content_hash = content_hashThe indexer runs on startup and every INDEX_INTERVAL_SECONDS (5
minutes by default). Hashes are content-only, so the change detector
ignores mtime jitter. Stale embeddings are caught by the
embedded_content_hash != content_hash mismatch.
Database schema
Table | Purpose |
| Path, title, tags, frontmatter, content hash, embedded hash, tsvector, modified time |
| One row per chunk. |
| Wikilink graph: source/target IDs, target_path, kind ( |
| One row per checkbox task, derived from the note by the index pass (and refreshed by a task write): status, dates, priority, tags, text, task id |
| One row per user (one in single-user mode) holding the panel's Tasks card: timezone, excluded folders and note tags, the four write behaviours |
| Hashed bearer tokens, prefix for display, permission, expiry |
| Per-tool-call audit |
| OAuth 2.0 PKCE state, including the grant id that ties a consent's tokens together |
| Capability rows behind the |
| Multi-user mode: login, role, per-user |
| One revocable row per live panel browser session, keyed on the SHA-256 of the cookie's session id. Cascades with the user. |
GIN indexes on content_tsvector and tags[]. B-tree indexes on the
hot foreign keys. pgvector HNSW expression index
(embedding::halfvec(N)) halfvec_cosine_ops (m=16, ef_construction=64),
built when the dimension is ≤ 2000; results are re-ranked by the
full-precision distance. Queries set
hnsw.ef_search=80 and dedupe per note in Python after a 5x overfetch.
Project layout
src/
main.py FastAPI app, lifespan, MCP mount
config.py pydantic-settings
database.py async SQLAlchemy engine/session
models/db.py ORM models
mcp_server/ MCP server, tools, auth middleware
services/ vault ops, anchored filesystem, search, FTS,
embeddings, links, indexer, transfer
transfer/ public /transfer/* capability-redemption routes
auth/ login, sessions, per-request identity context
api/ control-panel REST endpoints
control_panel/ Jinja2 templates and static assets
oauth/ OAuth 2.0 authorization-code flow
alembic/ database migrations
scripts/ one-off ops scripts (e.g. reset_embeddings.py)
tests/ pytest suite + smoke-test docs
openspec/ change proposals (spec-driven workflow)Development
pip install -r requirements-dev.txt
pytestThe unit-test suite covers the embedding-provider abstraction, OpenAI
batching and retry behavior, config validation, and the
dimension-mismatch startup check. Network-bound tests use respx to
mock httpx, so no real network access is required.
Dependencies are exact pins (==) in requirements*.txt, bumped by
Renovate; renovate.json holds mcp below 2.x (the 2.x migration is
issue #365, not a routine bump) and digest-pins the Docker base image.
To run the server outside Docker:
DATABASE_URL=... SECRET_KEY=... VAULT_PATH=... uvicorn src.main:app --reload --no-proxy-headersMake targets
make init First-time setup (data dirs, .env)
make build Build Docker image (no cache)
make build-cached Build Docker image (with cache)
make push Push the image to the configured registry
make image Build and push
make deploy Build, scan, push, backup, migrate, recreate container
make up / down / restart / shell Container lifecycle
make logs Tail container logs
make db-init Create database, user, and pgvector extension
make db-migrate Run alembic migrations
make db-check alembic check — schema vs. ORM models (must be clean)
make test-schema Schema gate: migrations vs. models on a throwaway pgvector container
make db-backup Dump database to backups dir (derived index tables schema-only; BACKUP_FULL=1 dumps their rows too)
make db-restore FILE=<path> Restore from a backup
make reindex Explain how to trigger a reindex (panel only; there is no headless trigger)
make reset-embeddings Drop and recreate embedding column at configured dim
make rebuild-tsvectors Recompute keyword index for FTS_CONFIGS (no embeddings, no API calls)
make status Show container and health status
make audit Audit Python dependencies (pip-audit)
make trivy Scan the local image for HIGH/CRITICAL CVEs (SCAN_IMAGE=obsidian-mcp:local for the bundled stacks)
make clean Remove containers and images (data preserved)make deploy runs the whole pipeline: build, image scan, push, database
backup, alembic upgrade head, then recreate the container. Run
make test-schema before any deploy that carries a migration, and
make db-check after one.
Security notes
API keys use the
omcp_prefix and are stored as SHA-256 hashes. The raw key is shown exactly once at creation.The control panel is intended to sit behind an external auth gateway. The included
docker-compose.ymluses Traefik with an OAuth chain. Don't expose/admindirectly to the internet.Panel sessions are server-side rows. The signed cookie carries a 256-bit random id; the database stores only its SHA-256, so a database dump contains no usable session. Logging out revokes that row, and a password change, an admin reset, a deactivation or a delete revokes every session of the account.
The OAuth consent screen identifies the client it is asking about: the redirect host the authorization code would be sent to (taken from the URI's hostname, never its
netloc, and shown in punycode rather than decoded), the server-generated client id, and the registration date. Every render says the application registered itself and is not verified by this server; a host outsideOAUTH_KNOWN_REDIRECT_HOSTSis called out as unrecognised.The OpenAI key is rendered on the settings page as
key[:8] + "..." + key[-4:]and never appears in full in HTML or JS sources.Path traversal is blocked at the service layer, and containment is proved by the kernel: every directory below the vault root is opened with one
openat2(RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS | RESOLVE_NO_MAGICLINKS)from an open root descriptor, and the rest of the operation acts on that descriptor rather than re-walking a name.Mutating tools act on the path as named. A final component that is a symlink is refused (naming the link's target) instead of being followed, so an in-vault alias cannot redirect a write. Reads still follow links, which is what an alias is for.
Every path guard also refuses hidden components, so
.obsidian,.git,.trashand friends are out of reach of every tool.Transfer links carry their token in the URL fragment, which browsers never send, and are redeemed only from an
Authorization: Bearerheader. Keep header logging off at your reverse proxy and APM. Unknown, expired, consumed and revoked tokens all get one identical 404 from the public routes; precise status comes from the authenticatedcheck_uploadtool.import_from_urlfetches only genuinely public addresses, under an explicit deny list re-applied at every redirect.Failed
/mcpauthentication is budgeted per client address, counted before the credential lookup so a refused probe costs no database session and no query. The address comes from the proxy headers the app trusts, never from a header read directly, and a request with no resolvable address is charged to a shared slot rather than exempted. What it bounds is the database work an unauthenticated caller can force; it is not a defence against guessing a 256-bit key. See Rate limits.Parameterized queries everywhere. No string interpolation into SQL.
Response headers include HSTS,
X-Content-Type-Options: nosniff,X-Frame-Options: DENYandReferrer-Policy: no-referrer. The panel, login and consent pages add a per-response nonce Content-Security-Policy with no inline script (PANEL_CSP).The app's own hops are checked at startup: the database follows
DATABASE_SSL_MODE, and the embedding endpoint must behttpsor loopback unlessEMBEDDING_ALLOW_PLAINTEXTsays otherwise. Each start logs one transport line per hop and aninternal_transport_plaintextsecurity event for each hop still in cleartext.
Status
Single-author, in active use as the maintainer's personal exocortex (2,500+ notes, multiple connecting agents). Public for anyone who wants to fork it. Issues and PRs welcome but expect opinionated review. This is a working system, not a generic platform.
Listed in the official MCP Registry
as io.github.maxkuminov/obsidian-mcp, published from
server.json on every release tag, and on
Glama. Both listings carry the tagline
at the top of this README: a memory system for your AI agents, stored
as plain markdown you can open in Obsidian.
License
MIT. See LICENSE.
Available Tools
33 toolsadd_taskAdd taskA
Insert one new task line (- [ ] <text>) into an existing note, next to its task list. Requires write permission (a readwrite API key or OAuth scope).
Arguments: path, text, section; the fields due, scheduled,
start, priority, tags, recurrence; context, allow_duplicate,
dry_run and the optional expected_hash precondition.
Every refusal the server raises ends with one machine-readable
MCP-REFUSAL {"code":…} line and writes nothing; an undeclared or
mistyped argument is rejected by protocol validation before the tool runs
and carries no such line.
The note must exist; this tool never creates one (use create_note).
The line is placed after the last top-level task of the region — the
section heading's body, or the whole note — and after everything
indented under that task, copying its list marker and quote prefix; with
no task there it goes after the region's last line, and in an empty
section right under the heading. Nothing else in the note changes.
Plain checkboxes work; Tasks-plugin fields are written only for the
arguments you give, in the plugin's order: #tags, priority, 🔁 rule,
➕ created (per your task settings), 🛫 start, ⏳ scheduled, 📅 due.
context adds one indented - <text> line under the new task.
Under a filter task rule your global filter text is put at the start of
text when the line lacks it; under fields, a line with no task field
or task tag is still written and the response says default listings will
not show it.
An open task with the same description (case, spacing and Unicode form
ignored; tags count) in this note, or elsewhere in your default scope, is
refused duplicate_task, naming up to 5 matches; allow_duplicate=true
adds it anyway. Up to 5 similar open tasks are listed in the response and
the dry run, and never block. The response gives the new line and its id
(for complete_task / update_task), content_hash, the timezone and
dates resolved, and index: refreshed or index: may lag (<reason>)
(the write stands).
dry_run=true returns the diff, the new line(s) and the similar tasks,
and writes nothing. expected_hash is optional, even where the deployment
requires preconditions (adding a line removes nothing); when given it
binds the whole note (refused stale_precondition if it changed).
Without it, a change made by someone else during the call is retried from
a fresh read, at most 3 attempts, then refused concurrent_write.
Codes: duplicate_task, not_found, selector_unresolved (no such section),
content_unsafe (a malformed frontmatter block or an unclosed indented
fence: the refusal names the repair), recurrence_unsupported,
stale_precondition, concurrent_write, task_malformed, size_limit,
invalid_argument, permission_denied.
Args:
path: The existing note's vault-relative path.
text: The task description: one line, 1–1,000 characters, no field
emoji (pass dates and the rest as arguments).
section: A heading, as edit_note addresses one (Parent/Child, or a
#N ordinal); omit for the whole note.
due: Due date (📅): YYYY-MM-DD, today, tomorrow, yesterday,
+Nd or -Nd, in your task timezone.
scheduled: Scheduled date (⏳), same forms.
start: Start date (🛫), same forms.
priority: highest, high, medium, low or lowest.
tags: Tags for the task, e.g. ["errand"] (at most 32).
recurrence: A 🔁 rule from the grammar complete_task lists.
context: One line of context under the task.
allow_duplicate: Add even if an identical open task exists.
dry_run: Preview the change without writing.
expected_hash: Optional; the note's content_hash from read_note.
Inputs: path (required), text (required), due, tags, +9 more. Returns: result
check_uploadCheck uploadARead-onlyIdempotent
Ask what happened to an upload link you minted with request_upload.
Returns one of pending (nothing sent yet), uploading (bytes are in
flight), completed (with the path, size, sha256 and MIME type of what
landed), unknown (a stream started and the server never recorded how it
ended), revoked (the link is dead because the credential or vault root
changed under it), or expired. Use it to confirm a transfer really
finished before you tell the user it did, and to get the sha256 if they
want to verify it.
Visibility is scoped to the principal that minted the link, not to one
credential row. For an API key that is the key itself. For OAuth it is the
whole grant family behind the access token you are calling with, so a handle
stays readable across the hourly token refresh that mints a new row. A
different API key, a different client, or a separate approval of the same
client reads as not found.
uploading names the deadline the stream has. Check again after it: past
that point the answer becomes either completed or unknown. unknown
does not mean nothing arrived — a publish can succeed and still fail to
record its completion — so read or list the path before minting another
link or telling anyone the file did not arrive.
Pass the upload_id itself — the short handle from request_upload, not
the upload URL and not the token after the #. Anything else is refused
without a lookup.
Args:
upload_id: The upload_id that request_upload returned.
Inputs: upload_id (required). Returns: result
complete_taskComplete taskADestructive
Mark one task done — [x] and ✅ <date> — and, for a recurring task, write its next occurrence in the same edit. Requires write permission (a readwrite API key or OAuth scope).
Arguments: path and id (both from a listing), done_on, dry_run and
the expected_hash precondition.
Every refusal the server raises ends with one machine-readable
MCP-REFUSAL {"code":…} line and writes nothing; an undeclared or
mistyped argument is rejected by protocol validation before the tool runs
and carries no such line.
The id, from a list_tasks or task_agenda row, is re-checked against
the note's current text, never a line number, so the call changes only
the line it names or
refuses. A task's id changes whenever its line changes; the response
returns the new one. An id shaped <key>.<i>of<n> names one of several
identical lines and is accepted only with expected_hash, the note's
content_hash from read_note; without it the call is refused
precondition_required.
Plain checkboxes work; Tasks-plugin emoji fields are optional. Any open
marker ([ ], [/], [>]…) becomes [x]. Whether ✅ is added, where
a next occurrence goes (above the task, or below its indented lines) and
whether it gets ➕ <today> follow your task settings, which default to
the Tasks plugin's. Recurrence rules supported: every day / N days /
weekday / week / N weeks / week on / / month /
N months / month on the / month on the last / year / N years /
on the , each optionally when done. Any other rule refuses
the whole completion: a recurring task is never completed without its
next occurrence.
dry_run=true returns the diff and the new line(s) and writes nothing.
expected_hash is optional otherwise and binds the whole note (refused
stale_precondition if it changed). Without it, a change made by someone
else during the call is retried from a fresh read, at most 3 attempts,
then refused concurrent_write.
The response gives the new line and id, the next occurrence's line,
position and id, content_hash, the timezone and dates resolved, and
index: refreshed (listings already show the change) or
index: may lag (<reason>) (the write stands; the next index pass
catches up).
Codes: task_not_found (the line changed since the listing: list again),
task_ambiguous (lists the suffixed ids), task_changed,
precondition_required, stale_precondition, malformed_precondition,
concurrent_write,
already_completed, task_cancelled (reopen it with
update_task(status="open") first), recurrence_unsupported,
on_completion_unsupported (🏁 delete), task_malformed (fix the line
with edit_note), content_unsafe (a malformed frontmatter block: the
refusal names the repair), size_limit, invalid_argument, not_found,
permission_denied.
Args:
path: The note's vault-relative path, unescaped (a listing shows
\-escapes).
id: The task id from a list_tasks or task_agenda row.
done_on: The completion date: YYYY-MM-DD, today (default),
yesterday, +Nd or -Nd, in your task timezone.
dry_run: Preview the change without writing.
expected_hash: The note's content_hash from read_note; required
with a suffixed id.
Inputs: id (required), path (required), done_on, dry_run, +1 more. Returns: result
create_noteCreate noteA
Create a new markdown note in the Obsidian vault. Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
See get_vault_guide for Obsidian syntax and any vault-specific conventions
(naming, folder placement, frontmatter, tags).
Refuses a path whose final component is a symlink, naming its target, so a write never lands on a note other than the one named; symlinked folders inside the vault work normally.
The note is published no-clobber: the content is staged out of sight and
linked into place in one kernel-atomic step, so an existing file at path
can never be replaced by this tool. A vault filesystem that cannot stage an
unnamed file refuses the write with an error naming
VAULT_ALLOW_NAMED_STAGING_FALLBACK rather than staging under a visible
name.
expected_hash — binding a write to the bytes you read. Optional; omit
it and nothing changes. Pass the content_hash a read returned, verbatim
and canonical (sha256:<64 lowercase hex>), and the call is refused with
nothing written if the file changed in between. It is always the whole
file's hash, never a hash of the text you received. Two windows, both
live: expected_hash covers your read → this call's read, the server's own
pre-publication compare covers this call's read → its publication, and a
match on the first does not exempt the second. Every refusal the server raises ends with one
machine-readable MCP-REFUSAL {"code":…} line (an undeclared or mistyped argument is rejected by
protocol validation before the tool runs and carries no such line) — stale_precondition (with
the file's current hash, ready to resend), concurrent_write,
no_incumbent, malformed_precondition, precondition_unavailable,
precondition_required — and each states what resolves it.
Here there are no incumbent bytes to bind: a supplied hash is answered
no_incumbent before any filesystem work, nothing is created, and the
remedy is to call again without it. A malformed hash is still reported as
malformed first. Success reports the content_hash of the note this call
published.
Args:
path: Vault-relative path for the new note (e.g. "Cards/New Topic.md"). The .md extension is added if missing.
content: Full markdown content for the note, including any frontmatter.
expected_hash: Accepted and always refused as no_incumbent, so the
refusal is a normal result rather than a protocol error.
Inputs: path (required), content (required), expected_hash. Returns: result
delete_fileDelete fileADestructive
Delete a non-markdown file from the vault. Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
Peer to delete_note, which stays markdown-only.
By default this is a soft delete: the file moves to
.trash/<YYYYMMDD-HHMMSS>-<basename>-<8 hex> inside the vault, keeping a
copy the user can recover. Two files with the same name deleted in the same
second both survive — the trash never clobbers.
With permanent=True the file is unlinked outright and this server has no
recovery path; the user's backups are the only rollback.
Refuses markdown files (use delete_note, which understands the index and
backlinks), directories, and symlinks. Non-markdown files are not indexed,
so search and embeddings are unaffected either way.
expected_hash binds the whole raw file in either mode; optional by default — omitted, the delete
proceeds — unless the deployment requires it, when an omitted hash is refused precondition_required.
Use the canonical sha256:<64 lowercase hex> from read_file's base64 header,
read_file(hash_only=True), or a write success. Malformed hashes refuse
before path checks; unavailable, required and stale preconditions refuse
before any trash entry or unlink.
This checks the caller-read-to-call window; a later concurrent replacement
remains possible, so it is not an atomic filesystem compare-and-delete.
A successful delete reports no content hash.
Args:
path: Vault-relative path to the file.
permanent: If True, unlink instead of moving to .trash/.
expected_hash: Optional whole-file raw-byte digest of the incumbent.
Inputs: path (required), permanent, expected_hash. Returns: result
delete_noteDelete noteADestructive
Delete a note from the vault. Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
By default this is a soft-delete: the file is moved to
.trash/<YYYYMMDD-HHMMSS>-<basename>-<8 hex> inside the vault root, by a
single non-replacing rename, so an existing trash entry is never
overwritten and two deletes in the same second land on distinct names. The
indexer skips dot-prefixed directories, so search and embeddings drop the
note automatically on the next reindex pass (≤ 5 minutes). Soft-deleted
files accumulate in .trash/ — emptying that directory is the user's
responsibility.
A vault filesystem that cannot perform that non-replacing rename into
.trash/ makes the soft delete refuse with an error naming the limitation
rather than fall back to a rename that could overwrite; pass
permanent=True to unlink instead.
With permanent=True, the file is unlinked directly with no recovery path
inside this server. Existing backups are the rollback story.
A path whose final component is a symlink is refused, naming its target, so a delete never removes a note other than the one named; symlinked folders inside the vault work normally.
Dangling backlinks left behind by a delete are surfaced via
get_backlinks and find_orphans. See get_vault_guide for context.
expected_hash — binding a write to the bytes you read. Optional by default — omitted, the
delete proceeds against whatever is on disk — unless the deployment requires it, when an omitted hash
is refused precondition_required. Pass the content_hash a read returned, verbatim
and canonical (sha256:<64 lowercase hex>), and the call is refused with
nothing written if the file changed in between. It is always the whole
file's hash, never a hash of the text you received. expected_hash
covers your read through this call's preflight read. The delete acts through the
pinned parent directory but does not compare the bytes again: an in-place edit after that
comparison can still be deleted. Every refusal the server raises ends with one
machine-readable MCP-REFUSAL {"code":…} line (an undeclared or mistyped argument is rejected by
protocol validation before the tool runs and carries no such line) — stale_precondition (with
the file's current hash, ready to resend), concurrent_write,
no_incumbent, malformed_precondition, precondition_unavailable,
precondition_required — and each states what resolves it.
It applies in both modes, and the comparison runs before the .trash
rename and before the unlink, so a refused delete leaves the note where it
was and creates no trash entry. A successful delete reports no
content_hash: nothing remains to hash.
Args:
path: Vault-relative path to the note.
permanent: If True, unlink instead of soft-deleting.
expected_hash: The note's content_hash as you last read it. Refuses
the delete, changing nothing, if the note has changed since.
Inputs: path (required), permanent, expected_hash. Returns: result
edit_noteEdit noteADestructive
Edit an existing note in the Obsidian vault. Requires write permission (a readwrite API key or OAuth scope).
Arguments: path, content, at most one mode flag — append, find or section (operation is a
legacy alias) — plus replace_all, dry_run, replace_frontmatter, and the expected_hash
precondition. Every refusal the server raises ends with one machine-readable MCP-REFUSAL {"code":…}
line; an undeclared or mistyped argument is rejected by protocol validation before the tool runs and
carries no such line. See get_vault_guide for vault conventions.
Modes (mutually exclusive):
Full replace (default):
contentbecomes the note's body; an existing valid line-1 YAML frontmatter block is preserved byte-identically ahead of it.replace_frontmatter=Trueoverwrites the entire file, frontmatter included. A note with no valid block is replaced wholesale. Change frontmatter withset_frontmatterorfind=; never write backread_note'sfrontmatterJSON view. The round-trip guarantee covers a complete, unwindowed whole-note read only — nosection,offset=0,truncatedfalse; page a truncated read to the end first, or full replacement replaces the whole body with the fragment. A section response belongs to section mode.Append:
append=True;contentis added at the end, after one newline.Find & replace:
find=<exact text>is replaced withcontent; it must match exactly once unlessreplace_all=True.Section:
section=<heading>replaces the whole body under the named ATX heading.Parent/Childdisambiguates repeated headings; a#Nordinal ("#7", 1-based document order) is the only form that addresses duplicate siblings. A selector resolves to the same section here as inread_noteon any write this tool admits — parity is about resolution, not admission.
dry_run=True returns a unified diff and writes nothing.
expected_hash: pass the content_hash a read returned, verbatim, and the call is refused with
nothing written if the file changed since — in every mode, dry_run included. It is the whole file's
hash, never a hash of the text you received. Optional by default — omitted, a stale edit overwrites —
unless the deployment requires it, when an omitted hash is refused precondition_required. Codes:
stale_precondition, concurrent_write, no_incumbent, malformed_precondition,
precondition_unavailable, precondition_required. Success reports the content_hash of the bytes
this call wrote, not what is on disk when you read it; dry_run reports none.
Section mode. content is the section's body: the text beginning on the line immediately after the
matched heading line; the heading line is never rewritten. The body is replaced whole — anything
content does not resend, a fenced code block under the heading included, is deleted — so a blank
line you want after the heading belongs in content. read_note(path, section=...) is the matching read:
its heading field carries the heading line and its content field the body, and this tool takes exactly
that content. Byte-identity holds for notes whose body newlines are LF: non-LF terminators inside the
selected body come back as LF. #N ordinals agree with read_note; a heading inside a fenced code block is
not a heading.
Two shapes refuse a section write outright, naming the problem and writing nothing: a malformed
frontmatter block, whose refusal names the replace_frontmatter=True repair; and a fence opener indented by
one to three spaces that nothing below it closes — close the fence or unindent it to column zero, then
reissue. Both are asymmetric with reads: read_note keeps working on such notes. A symlinked
final component is refused.
Inputs: path (required), content (required), find, append, +6 more. Returns: result
find_orphansOrphan notesARead-onlyIdempotent
Notes with zero incoming AND zero outgoing resolved links — useful for vault hygiene ("what's disconnected?") and cleanup decisions.
Args: folder: Optional vault-relative folder prefix to scope the search (e.g. "Cards/"). limit: Maximum results (default 50, hard cap 500).
Inputs: limit, folder. Returns: result
get_backlinksBacklinksARead-onlyIdempotent
Notes that link TO path. Use this to discover what references a given
note — projects citing a card, daily notes mentioning a person, etc.
Resolved links only (dangling references are not counted as backlinks).
Args: path: Vault-relative path to the target note (e.g. "Cards/Foo.md"). limit: Maximum results (default 50, hard cap 500).
Inputs: path (required), limit. Returns: result
get_changesChange feedARead-onlyIdempotent
List what changed in your vault after a cursor: one line per note created, modified, moved or deleted, oldest first.
`since` is either the `next_since` cursor a previous call returned
(`ev:<number>`, exclusive and exact) or a UTC date/datetime
(`YYYY-MM-DD`, or ISO 8601 with `Z`/`±HH:MM`). A date or datetime *starts*
a feed and is approximate; `next_since` *continues* one without losing or
repeating an event. Store `next_since` (it is in the header and the last
line) in your own notes and pass it next session. A cursor means
something only for your own vault; one above this vault's last event is
refused (`invalid_argument`).
Each line: `- ev:<n> <UTC time> <kind> "<path>"` (a move shows
`"<from>" -> "<to>"`; paths are JSON-quoted, so a newline in a name is
`
), then reason=…where it applies, then who:by api_key ""
via orby oauth "" via , marked (you)when it was your own credential, orby human/syncfor anything the index discovered — edits outside MCP (Obsidian, a sync client, git, a shell) are human/sync. createdmeans first seen at this path: a new note, one half of a rename that could not be paired, or a note that became indexable. deletedalways carriesreason=: removed(the file is gone), not_indexable(still on disk but cannot be indexed) orquarantined`.
Two meta lines are always shown, whatever the filters: `gap` (events not
itemised, with a count) and `reset` (the index was rebuilt from empty).
After either, resync with `get_recent(order_by="content_changed",
since=…)`. `history_truncated: true` in the header means events older than
the retained history (default 90 days) were removed.
Args:
since: A `next_since` cursor (`ev:<n>`) or a UTC date/datetime.
folder: Only events whose path or source path is under this prefix (a
move out of the folder counts).
kinds: Subset of `created`, `modified`, `moved`, `deleted`.
by: `any` (default); `me` (your exact credential — the same API key,
or the same OAuth grant across token refreshes); `agents` (any MCP
caller of this vault); `human` (`human/sync`, discovered by the index).
limit: Events per page (1–500, default 50). A full page says
`more: true`; pass its `next_since` to continue.
Inputs: since (required), by, kinds, limit, +1 more. Returns: result
get_linksOutgoing linksARead-onlyIdempotent
Outgoing links from path — both resolved and dangling.
Useful for "what does this note depend on?" or finding broken references that need follow-up notes.
The result carries a truncated field. truncated: true means this note
holds more links than the indexer's per-note cap and the list is the first
N in document order only — treat it as incomplete rather than as the
note's full outgoing-link set.
Links come back in document order and are capped by limit; when more rows
exist the result says how many of them were persisted, so a partial page is
never read as the whole set. limit raises the page up to a hard cap of
500 — this tool has no paging beyond that, so a note with more than 500
link rows can only be read in full from the note itself.
Each row's link text is clipped to 120 characters.
Args: path: Vault-relative path to the source note. limit: Maximum links returned (default 100, hard cap 500).
Inputs: path (required), limit. Returns: result
get_neighborhoodLink neighborhoodARead-onlyIdempotent
The connected subgraph reachable from path via links or backlinks,
up to depth hops (treated as undirected).
Use this when an agent needs the local cluster around a topic — e.g.
"summarize everything connected to this project". Prefer this over
find_related when explicit links are the signal you want; prefer
find_related when the connection is conceptual rather than linked.
Args: path: Vault-relative path to the seed note. depth: Maximum BFS depth (default 1, capped at 5). limit: Maximum distinct neighbor notes (default 50, hard cap 200).
Inputs: path (required), depth, limit. Returns: result
get_recentRecent notesARead-onlyIdempotent
Get recently modified notes, newest first.
Each line shows the note's modification time in UTC, as "YYYY-MM-DD HH:MM UTC".
Notes whose content changed since a point in time:
order_by="content_changed" with since. File mtime (the default order)
also moves when a file is touched or re-synced without a content change;
content_changed moves only when the indexed content hash changes, and each
line is then labelled changed. For an exact list of creations, edits,
moves and deletions since a stored cursor, see get_changes.
Args:
limit: Number of recent notes to return (default 20).
folder: Optional folder prefix to filter (e.g. "Projects/").
tags: Optional list of tag names; only notes carrying ALL listed tags match
(e.g. ["meeting"]).
frontmatter: Optional dict of frontmatter key/value pairs; strict type match
(e.g. {"status": "active"}).
since: Optional UTC lower bound, inclusive: YYYY-MM-DD (that whole UTC
day) or an ISO 8601 datetime with Z or ±HH:MM (no offset is refused).
until: Optional UTC upper bound, exclusive; a date includes that whole day.
order_by: "mtime" (default) or "content_changed"; the bounds apply to it.
cursor: The more: cursor=… value from the previous page of the same call.
When any of since/until/order_by/cursor is given, a full page ends with
that footer.
Inputs: tags, limit, since, until, +4 more. Returns: result
get_tagsList tagsBRead-onlyIdempotent
List all tags used across the vault with note counts.
Args: limit: Maximum number of tags to return (default 50)
Inputs: limit. Returns: result
get_vault_guideVault guideARead-onlyIdempotent
Returns a two-part guide for working with this Obsidian vault:
Obsidian primer — generic syntax (wikilinks, embeds, block refs, heading refs, tags, frontmatter, callouts, comments, highlights, math, mermaid, footnotes, tasks, plugin literals).
Vault-specific conventions — folder structure, naming rules, frontmatter requirements, and tag taxonomy as configured by the vault owner in
CLAUDE.md. IfCLAUDE.mdis absent, the response includes instructions for creating one.
Inputs: no named parameters. Returns: result
hybrid_searchHybrid searchARead-onlyIdempotent
Keyword and semantic search fused into one ranking, for a query that is not clearly an identifier or a paraphrase.
Exact identifiers, code symbols, titles or known phrases: keyword_search.
Conceptual or paraphrased questions: semantic_search. Unsure which:
hybrid_search.
Both arms run for the same query and filters in one database snapshot:
the keyword_search ranking and the semantic_search ranking, each taken
to its top 50. They are fused by reciprocal rank fusion over note paths
with equal votes: a note's score is the sum, over the arms that found it,
of 1/(k + rank) (k is the server's HYBRID_RRF_K, shown as rrf_k).
A note outside both top-50 lists is not considered; the header's
arm_depth: keyword n/50, semantic c/50 chunks says when an arm was full.
Fusion helps when the query's kind is unclear, and a single arm can rank
better than it on its own kind of query (an exact identifier, or a pure
paraphrase); use that arm's tool then.
One line per result: a JSON object of the note-controlled fields
{"title","path","tags","preview_kind","preview"} (every value a JSON
string, so note text cannot forge a field), then the server fields:
score, semantic_rank (with similarity) or -, keyword_rank (with
match and matched_in) or -, and explain (the 1/(k+rank) terms
that make the score). preview_kind is snippet (a keyword highlight in
«»), head, chunk (semantic), stale_notice or none, from the arm
that ranked the note better. stale: true and embedding_truncated: true
mean what they mean in semantic_search, and so do the semantic arm's
§ "<heading path>" (#N) / § (top of note) field (read the section
with read_note(path, section="#N")) and the index_transition: line
under the header. A long response drops whole rows
from the end and says how many; a first row that does not fit is cut and
labelled. Call read_note on a path for the full note.
The header always says arms:. arms: both is a fused answer. arms: keyword-only (semantic unavailable: provider_error | provider_input_rejected)
means the embedding provider failed or refused the query: the page is the
keyword arm alone, in keyword order, and semantic_search will fail the
same way until the provider recovers.
rerank=true asks the deployment's reranker to reorder the candidates
this call already fetched; it can add up to the configured timeout. Its
rows are one-line quoted objects followed by server fields (with
rerank_score after them when reranked). The header says
reranked: true or reranked: false (<reason>), and an unreranked page
keeps the unreranked order; reranked: false (not_configured) means
this deployment has no reranker.
Every page's header also says confidence: ok or confidence: low:
low means no note matched all the keyword terms and the closest
semantic candidate is under this deployment's similarity threshold (a
line then suggests keyword_search or get_neighborhood), and ok is
also what a deployment that set no threshold says, so it is not a
quality claim.
Args: query: What you are looking for — words, a phrase or a question. limit: Maximum number of results (default 10, at most 50). folder: Optional folder prefix (e.g. "Projects/"). tags: Optional list of tag names; only notes carrying ALL listed tags match. frontmatter: Optional dict of frontmatter key/value pairs; strict type matching — string "0" does not match integer 0 (e.g. {"status": "active"}). rerank: Reorder the first 50 fused candidates with the deployment's reranker (default false).
Inputs: query (required), tags, limit, folder, +2 more. Returns: result
import_from_urlImport from URLADestructive
Fetch a file from a public https URL straight into the vault. Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
Peer to write_file and request_upload — use this one when the bytes are
already somewhere public.
The server does the fetching, so nothing passes through your context: a 20 MB PDF costs one tool call. Returns the path, size, sha256, MIME type and the final URL after any redirects.
Only genuinely public addresses. This server sits on a private network
next to a database and other services, so the fetch is restricted: https
only — plain http is refused unless the operator has set
IMPORT_ALLOW_HTTP=true — no credentials in the URL, no
private/loopback/link-local/metadata addresses in any spelling, and the same
rules re-checked at every redirect.
A refusal names the rule that was violated — that is information about the
URL, not a hint to work around it. Rewriting the URL to evade the check is
never the right next step; ask the user for a public link instead.
Size-capped at MAX_FILE_WRITE_BYTES, with one 30-second deadline for the
whole fetch. No-clobber unless overwrite=True. Nothing is written unless
the whole body arrives intact.
This tool shares the transfer tools' preflight, so it also refuses when the
server has no public origin configured (MCP_HOSTNAME or BASE_URL), even
though it mints no link — that is an operator setting, not something to work
around.
Args:
url: Public https URL of the file, at most 8,192 characters; a longer
one is refused with argument_too_long before anything is fetched.
path: Vault-relative destination (e.g. "Attachments/paper.pdf").
overwrite: If True, allow replacing an existing file at path.
Inputs: url (required), path (required), overwrite. Returns: result
keyword_searchKeyword searchARead-onlyIdempotent
Full-text keyword search via PostgreSQL tsvector. Use this for exact identifiers, code symbols, proper nouns, titles, or known phrases — anywhere semantic noise hurts.
Exact identifiers, code symbols, titles or known phrases: keyword_search.
Conceptual or paraphrased questions: semantic_search. Unsure which:
hybrid_search.
Bare terms are ANDed: budget forecast matches only notes containing
both stems. Notes matching every term come first, tagged match: all;
when they do not fill the page, notes matching some of the terms follow,
tagged match: any, in their own rank order. The operators:
"exact phrase" (adjacent words), budget OR forecast (either), -draft
(exclude; honoured in the any block too). A note's title and frontmatter
aliases are indexed above its body, so a query that is a note's title
ranks that note first. A note's tags (frontmatter and inline #tags; a
nested #a/b also as a and b) are indexed below its title and
aliases and above its body.
Each result carries rank (a relative score: a body-only match scores in
the thousandths, a title match near 1, and an any row is scored against
the fallback query, so ranks compare only within one block of one page),
match, matched_in (the parts that alone match: title — title or
aliases — tags, body, comma-joined; or, when the terms are split
between parts, the first of title+tags, title+body, tags+body,
title+tags+body that matches), terms (k/n: how many of the query's
terms the note contains), and a second line: snippet: — the matching
body text with the matches in «» — or head: — the note's opening
words when the body alone does not match or the match is beyond the
stored excerpt (a note with no body has no second line). Snippets are
computed for the first rows of the page (the header says
snippets: first N when the page is longer). The header always carries the all/any counts and how many
rows have no stored excerpt yet (notes indexed before this version; the
footer names the one-time rebuild). Call read_note on a result's path
for the full note.
Args: query: Keywords or phrase to match (websearch tsquery syntax: "foo bar", "foo OR bar", "-bar"). folder: Optional folder prefix (e.g. "Cards/", "Projects/"). limit: Maximum number of results (default 20). tags: Optional list of tag names; only notes carrying ALL listed tags match (e.g. ["project", "active"]). frontmatter: Optional dict of frontmatter key/value pairs; only notes whose JSONB frontmatter contains every pair match. Strict type matching — string "0" does not match integer 0 (e.g. {"status": "draft"}).
Inputs: query (required), tags, limit, folder, +1 more. Returns: result
list_filesList filesARead-onlyIdempotent
Browse the vault filesystem (ls-style), including non-markdown files.
Peer to list_notes, which lists indexed markdown only; list_files reads
the filesystem directly and reports sizes so you can gauge a binary before
read_file.
By default lists the immediate children of folder — subdirectories and
files, each file with size and modification time. pattern is a glob that
filters file entries (e.g. "*.pdf"); recursive=True descends into
subfolders and returns matching files. Anything with a path component
starting with . is hidden — dot-directories (.obsidian, .git,
.trash, …) and dot-files — and a folder with such a component is
rejected.
At most limit entries are returned (default 200, hard cap 1000); the
response indicates when the listing was truncated.
Args: folder: Vault-relative folder (default "." = vault root). pattern: Glob applied to file names (default "*"). recursive: If True, descend into subfolders. Off by default. limit: Maximum entries to return (default 200, hard cap 1000).
Inputs: limit, folder, pattern, recursive. Returns: result
list_notesList notesARead-onlyIdempotent
List notes in a vault folder, sorted by most recently modified.
Results come from the index, so a note that exists on disk but has not yet been picked up by the indexer will not appear (lag is bounded by the index interval, typically up to 5 minutes).
Notes whose content changed in a window: order_by="content_changed" with
since (and optionally until). File mtime (the default order) also moves
when a file is merely touched or re-synced; content_changed moves only when
the indexed content hash changes.
Args:
folder: Vault-relative folder path (e.g. "Cards/", "Projects/"). Empty for vault root.
limit: Maximum number of results (default 50).
tags: Optional list of tag names; only notes carrying ALL listed tags match
(e.g. ["idea"]).
frontmatter: Optional dict of frontmatter key/value pairs; strict type match
(e.g. {"status": "active"}).
since: Optional UTC lower bound, inclusive: YYYY-MM-DD (that whole UTC
day) or an ISO 8601 datetime with Z or ±HH:MM (no offset is refused).
until: Optional UTC upper bound, exclusive; a date includes that whole day.
order_by: "mtime" (default) or "content_changed"; the bounds apply to it.
cursor: The more: cursor=… value from the previous page of the same call.
When any of since/until/order_by/cursor is given, a full page ends with
that footer.
Inputs: tags, limit, since, until, +4 more. Returns: result
list_tasksList tasksARead-onlyIdempotent
List checkbox tasks (- [ ] …) across the vault in one call, from the index — no note is read.
For a dated overview (overdue, due today, scheduled, upcoming) use
task_agenda; use list_tasks to filter, search and page. Plain
checkboxes work; Tasks-plugin emoji fields (📅 due, ⏳ scheduled, 🛫 start,
✅ done, 🔁 recurrence, priority) are optional and read when present. Query
blocks are text and are not evaluated; a checkbox in code is not a task.
The index follows each pass (default every 300 s); task writes refresh it
at once.
Each row: the raw marker, the path in backticks with :line, — id <id>,
the dates, priority, tags, under: heading and text: last. In a path,
whitespace and a backtick are shown as \n, \t, \uXXXX
(a backtick is \u0060) and \ as \\; the write tools take the
unescaped path.
complete_task and update_task take that id with the path; an id shaped
<key>.<i>of<n> (identical lines) also needs expected_hash, the note's
content_hash from read_note. detail="brief" prints one short line per
task; context=true adds the indented lines under each task (┆).
Status: [ ], [/] and other markers are open; [x]/[X] are done;
[-] is cancelled (only in cancelled and all). Dates accept
YYYY-MM-DD, today, tomorrow, yesterday, +Nd or -Nd, resolved in
your task timezone (the query line states it and each resolved date).
*_from / *_by are inclusive and exclude tasks without that date.
The header always states what the index could not show — notes not yet
scanned, tasks that could not be indexed, notes over the 5,000-task cap,
ids pending — and, under scope="default", how many tasks your excluded
folders, note tags and task rule removed, so "no tasks" does not mean
none exist.
When more rows match, the header says more: yes and the response ends
next: <cursor>: pass it back with the same arguments. A cursor from other
arguments, an older server version, or a relative-date query continued
after midnight is refused (invalid_argument): start again without one.
response_cap_too_small: the response cap cannot hold one row.
Args:
folder: Only notes under this path prefix (e.g. "Projects/").
status: open (default), done, cancelled or all.
due_by: Due on or before this date.
scheduled_by: Scheduled on or before this date.
tags: Tasks carrying every one of these tags on the task line, matched
by / segment and case-insensitively (a matches #a and #A/b,
not #ab). At most 32, a leading # optional.
limit: Tasks per page, 1–500 (default 100).
cursor: The next value from the previous page of the same query.
due_from: Due on or after this date.
scheduled_from: Scheduled on or after this date.
done_from: Done on or after this date.
done_by: Done on or before this date.
undated: true — neither a due nor a scheduled date; false — at least one.
has_due: true — with a due date; false — without.
text: 1–256 characters, at most 8 words; every word must occur in the
task's text, case-insensitively.
priority: Any of highest, high, medium, none, low, lowest.
recurring: true — with a 🔁 rule; false — without.
exclude_tags: Drop tasks carrying any of these tags (matched as tags).
path: Exactly this note.
order_by: due (default, undated last), priority, scheduled,
done (newest first) or path.
detail: full (default) or brief.
context: true to include each task's indented context lines.
scope: default applies your task settings: excluded folders,
excluded note tags and the task rule (which checkboxes count as
tasks); all ignores them.
Inputs: path, tags, text, limit, +18 more. Returns: result
move_noteMove noteADestructive
Move or rename a note inside the vault. Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
Arguments: from_path, to_path (must not exist; parent directories are created), rewrite_links
(default False) and the optional expected_hash precondition. The index follows the move, so backlinks
keep working without rewriting source notes. Every refusal the server raises ends with one
machine-readable MCP-REFUSAL {"code":…} line; an undeclared or mistyped argument is rejected by
protocol validation before the tool runs and carries no such line.
expected_hash binds from_path's own bytes and nothing else: pass the content_hash a read
returned, verbatim, and the move is refused with nothing written if that note
changed since. It is compared at preflight, before the rename and before any rewrite; the rename then pins
inode identity but does not compare the bytes again, so an in-place edit landing after that comparison is
still moved. The backlink sources a rewrite_links=True move rewrites are not bound, because you never
read them. Optional by default — omitted, the move proceeds — unless the deployment requires it, when
an omitted hash is refused precondition_required. Codes: stale_precondition, concurrent_write,
no_incumbent, malformed_precondition, precondition_unavailable, precondition_required.
With rewrite_links=True, every source note that links to this note is rewritten in place — wikilinks,
embeds, path-style links, and bare-href markdown links [text](Old.md), whose new href is written
relative to the linking note's own folder; angle-bracket hrefs [text](<Old.md>) are not rewritten.
Aliases and anchors survive. The moved note's own body is rewritten as well, so a self-reference
does not end up pointing at the old path. The rewrites are planned
before anything changes: if one would push a source past the note size limit, or the planning would exceed
the aggregate memory bound, the whole move is refused before any file is touched, naming the source or the
count.
The same preflight refuses the whole move, before the rename, when any source it would rewrite — the
moved note's own body included — contains a fence opener indented by one to three spaces that nothing below
it closes. The refusal names each such source and where its opener sits. Move with rewrite_links=False
(unaffected by this refusal) and fix the links yourself, or close the fences first.
A rewrite can still fail after the move has committed. The move is one rename and the rewrites follow
it, so an I/O failure or a lost vault assignment stops the remaining rewrites and the result reads partial success: …, naming the sources that still link to the old path. The move is not rolled back; treat the
link graph as agreeing with the vault bytes only on plain success, and fix the named sources with
edit_note.
Success reports the content_hash of the bytes actually published at to_path — the moved bytes for a
plain move, the post-rewrite bytes when the moved note's own body was rewritten — and that value binds a
following edit_note(to_path, …, expected_hash=…). A failed rewrite stays a partial success and never
claims nothing was written; if another writer changed to_path in between, no hash is reported and the
result says to re-read to_path first.
Writes are atomic; a symlinked final component on either path is refused. See get_vault_guide for
vault folder conventions.
Args:
from_path: Vault-relative path of the existing note.
to_path: Vault-relative path of the destination.
rewrite_links: Also rewrite incoming links in source notes (off by default).
expected_hash: from_path's content_hash as you last read it.
Inputs: to_path (required), from_path (required), expected_hash, rewrite_links. Returns: result
move_taskMove taskADestructive
Move one task, with every line indented under it, to another note or to another section of its note. Requires write permission (a readwrite API key or OAuth scope).
Arguments: path and id (the task, both from a listing), to_path (an
existing note; never created), to_section, allow_duplicate, resume,
dry_run, and the preconditions expected_hash (binds the source note)
and to_expected_hash (binds the destination).
Every refusal the server raises ends with one machine-readable
MCP-REFUSAL {"code":…} line; an undeclared or mistyped argument is
rejected by protocol validation before the tool runs and carries no such
line.
The id is re-checked against the source's current text, never a line
number. An id shaped <key>.<i>of<n> is accepted only with
expected_hash (the source's content_hash from read_note). Only a
top-level, unquoted task moves: a nested task, a task in a callout, a
block holding a quote, fence or heading line, or a destination whose
last top-level task is quoted is refused task_malformed (edit_note
can move it by hand). The lines arrive
byte for byte; only their line endings follow the destination. They go
where add_task would put a new task: after the last top-level task of
to_section (or the whole note) and everything under it.
The destination is written first. Immediately before the source is
written, in the same step, the destination is re-read and must still
hold the moved lines; otherwise the source is left alone. A stop after
the destination was written answers task_move_incomplete (partial,
never nothing_written): its destination: and source: lines state
only what was checked, its complete with: line names the exact call
that finishes the move, and the sentinel carries destination_path,
source_id, destination_id and reason. One window remains: an
outside save of an older destination while the source is being written
can lose the task.
A destination task with the same id (an identical copy included), or an
open task with the same description, is refused duplicate_task;
allow_duplicate=true keeps both. resume=true finishes an interrupted
move: it inserts nothing and removes the source copy, only when the
destination holds exactly one byte-identical copy (else
resume_unmatched); never with allow_duplicate, to_section or one
note.
dry_run=true returns both diffs and writes nothing. Each hash is
optional (where preconditions are required, a bare id satisfies them and
the destination is exempt); a change by someone else during the call is
retried from a fresh read, at most 3 attempts, unless that note's hash
was given. The response gives the moved task's new line and id (the
key is kept; .<i>of<n> suffixes may renumber), each content_hash
and index (destination): … / index (source): ….
Codes: task_move_incomplete, publication_uncertain, duplicate_task,
resume_unmatched, block_id_conflict, task_not_found,
task_ambiguous, task_changed, task_malformed, precondition_required,
stale_precondition, malformed_precondition, concurrent_write,
selector_unresolved, content_unsafe, size_limit, invalid_argument,
not_found, io_failure, permission_denied.
Args:
path: The source note, unescaped.
id: A list_tasks / task_agenda row's task id.
to_path: The destination note; it must exist.
to_section: A destination heading, as add_task takes section.
allow_duplicate: Keep both copies of a duplicate.
resume: Finish an interrupted move.
dry_run: Preview both changes without writing.
expected_hash: The source's content_hash; required with a suffixed id.
to_expected_hash: The destination's content_hash.
Inputs: id (required), path (required), to_path (required), resume, +5 more. Returns: result
read_fileRead fileARead-onlyIdempotent
Read any file in the vault — including non-markdown (PDFs, images,
skill HTML/JS, data files). Peer to read_note, which stays markdown-only.
This is pure byte transport: the server does NOT extract or parse PDFs and cannot interpret binary bytes. Non-text/non-image files come back as an opaque base64 string intended for a client-side skill to decode — not as something the model can read directly.
Encoding:
"auto"(default): text-like files (HTML, JSON, CSV, source, …) return as readable text; images (PNG/JPEG/GIF/WebP) return as an inline image block that renders in-client; everything else returns as a labeled base64 string."text": force a UTF-8 text decode; errors if the file is not valid UTF-8."base64": force a raw-bytes base64 string regardless of type.
Files larger than MAX_FILE_READ_BYTES (default 10 MB) are refused with a
size report. Base64 reads pass through the model context and inflate ~33%,
so they are token-heavy — check a file's size with list_files before
reading large binaries. Any path with a component starting with . is
rejected — dot-directories (.obsidian, .git, .trash, …) and dot-files
alike — as is path traversal.
Text results are additionally capped to a context-safe size: the cap bounds
the returned window, and a truncated read appends a short notice carrying
the offset to continue from. Base64 and image results are not windowed.
The base64 header and hash_only=True return the whole raw file's
content_hash (sha256:<64 lowercase hex>), which write/delete tools
accept as expected_hash. Their path is a quoted JSON string. Text stays
deliberately unenveloped. Use base64 for byte-exact frontmatter bytes;
read_note.frontmatter_yaml has normalized line endings.
Encoding is validated first, then hash_only/window compatibility, then
ranges. hash_only refuses offset != 0 or any non-None limit; explicitly
passing offset=0 is fine. A valid encoding has no effect in this mode.
Args: path: Vault-relative path to the file (e.g. "Reference Docs/spec.pdf"). hash_only: Return only path, byte count, MIME and hash, with no content. encoding: One of "auto" (default), "text", or "base64". offset: Character offset to start a text read from (default 0). Use the value the truncation notice reports to continue. limit: Maximum characters to return for a text read. Only lowers the server cap; it cannot raise it.
Inputs: path (required), limit, offset, encoding, +1 more.
read_noteRead noteARead-onlyIdempotent
Read a note from the Obsidian vault by its relative path.
Arguments: path, an optional section (an ATX heading), and offset / limit for paging. Returns a
structured result, not a rendered document — read the fields:
content— the selected note text. Whole-note reads: the body with a valid YAML frontmatter block stripped, which is byte-exact input foredit_note(path, content)full replacement only when the read is complete and unwindowed (offset=0andtruncatedfalse). Section reads: the section's body only, byte-exact input foredit_note(path, content, section=...)under the same condition. Pass it straight back; do not add, strip or split anything. Page a truncated read to the end before writing it back, or full replacement replaces the whole body with the fragment.heading— section reads only: the matched heading line, with no line terminator. It is not part ofcontent; a section write never rewrites the heading line.error— set when the read failed (missing note, badoffset/limit, unknown section). A normal result, not a transport error; the content-bearing fields are absent beside it.content_hash— the whole file's digest,sha256:<64 lowercase hex>, in every mode (a section or truncated read returns the value a whole-note read would), and the token the write tools take asexpected_hash. It is not a hash ofcontent: never compute it yourself, hand it back verbatim.path,title,tags— metadata as data.frontmatter_yaml— the frontmatter block's YAML source, fence lines excluded, LF-normalized (a CRLF block comes back with LF terminators — the same declared residualcontentcarries, because this tool normalises and the write tools work on raw bytes;edit_notestill reattaches the original block byte-identically). This is the authoritative copy.frontmatteris a best-effort JSON view of the same block and may be absent;metadata_omissionsthen says which fields were dropped and why. To change frontmatter useset_frontmatter, or edit the raw block withedit_note(find=...); never write back a round trip of the JSON view.truncated,offset,next_offset,total_chars— truncation as data.outline(truncated whole-note reads) lists every section with its#Nordinal so you can fetch the one you want directly, andnoticecarries the guidance in prose. Read the one section you need withsection=rather than paging a large note;content, the outline and the metadata fields each have their own budget.metadata_omissions— any metadata field this response had to drop, and why. Nothing is ever signalled by a marker inside a field.
Byte-identity holds for notes whose body newlines are LF: terminators inside the selected content come back
as LF. read_file on the same path is the byte-exact route to the file itself.
Args:
path: Vault-relative path to the note (e.g. "Cards/My Note.md")
section: Optional ATX heading to read instead of the whole note. Plain text ("Balance Sheet"), a
path-style chain ("Parent/Child") when the heading appears under different parents, or a "#N"
ordinal ("#7", 1-based document order) — the only form that can address duplicate headings
sharing the same parent; the outline of a truncated note carries the ordinal for every section.
A bare "#N" always selects by position; use "Parent/#N" to reach a heading titled "#N".
offset: Character offset to start reading from (default 0); continue from the reported next_offset.
limit: Maximum characters of content to return. Only lowers the server cap; it cannot raise it.
Inputs: path (required), limit, offset, section. Returns: What `read_note` returns. Every field is either server-controlled or a note-con…
request_downloadRequest download linkA
Get a short-lived link a person can use to save a vault file. Peer to
read_file, which returns the bytes to you — use this one when the file is
for the human, not for you.
Handy for anything read_file would waste context on or cannot render: a
PDF, a large image, an archive. Reading works with a read-only key.
The token lives in the URL's # fragment, so it never reaches an access
log. Treat the whole URL as a secret — whoever holds it can read that
one file until it expires. Never put it in a query string.
The link is bound to the file as it is now: if it is edited or replaced, the link stops working rather than serving different content than you described. Unlike an upload link it can be used more than once, so the person can preview and then save.
From a shell: `curl -H "Authorization: Bearer " -o
Args:
path: Vault-relative path of the file to share.
expires_in: Seconds until the link dies. Clamped to 60–3600; defaults
to TRANSFER_TOKEN_TTL_SECONDS (600). A link can never outlive the
credential you are calling with, so the deadline in the result may
be earlier than you asked for — it says so when that happens.
Inputs: path (required), expires_in. Returns: result
request_uploadRequest upload linkADestructive
Get a short-lived link a person can use to put a file into the vault.
Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
Peer to write_file, which takes the bytes directly — use this one when you
do not have them.
No MCP client can hand a tool the bytes of a file the user is looking at,
and your shell cannot reach their machine. This mints a link bound to
exactly one destination path: hand it to the person you are helping, they
open it and pick a file, and it lands at path. Nothing else can be
written with it.
The token lives in the URL's # fragment, which browsers never send to a
server, so it stays out of access logs. Treat the whole URL as a secret
— whoever holds it can write that one path, once, until it expires. Never
put it in a query string: that would log it.
Single use, and no-clobber unless you ask otherwise. With
overwrite=True the link also remembers what the file looked like now and
refuses to publish if it changed in the meantime, so a stale link cannot
silently undo an edit someone made while it was waiting.
From a shell you can upload without the page:
curl -H "Authorization: Bearer <token>" -T <file> <base>/transfer/upload.
Then call check_upload(upload_id) to confirm the bytes landed and get
their sha256. See get_vault_guide for how files fit into the vault.
Args:
path: Vault-relative destination (e.g. "Attachments/photo.png").
overwrite: If True, allow replacing an existing file at path.
expires_in: Seconds until the link dies. Clamped to 60–3600; defaults
to TRANSFER_TOKEN_TTL_SECONDS (600). A link can never outlive the
credential you are calling with, so the deadline in the result may
be earlier than you asked for — it says so when that happens.
Inputs: path (required), overwrite, expires_in. Returns: result
semantic_searchSemantic searchARead-onlyIdempotent
Vector similarity search over the vault's chunk embeddings. Use this for conceptual or paraphrased queries — anywhere exact word matching would miss the point.
Exact identifiers, code symbols, titles or known phrases: keyword_search.
Conceptual or paraphrased questions: semantic_search. Unsure which:
hybrid_search.
Each result is one note (deduped) with its closest-matching chunk as a ~200-character preview.
Call read_note on a result's path to get the full note content.
The header line carries a stale count and a truncated count, always — including when both are zero, so "nothing here is degraded" is distinguishable from a build that does not report it.
stale: true on a row means the note changed after it was embedded: it was
matched and ranked against its previous content, and its preview is
withheld rather than shown, because that excerpt is text the note no
longer has. Its path, title and tags are current — the indexer refreshed
them, which is how the staleness is known at all — so read_note on that
path returns the true content and is the remedy. Stale notes are never
filtered out: during an embedding outage that would empty the result set
rather than degrade it.
embedding_truncated: true means the note is longer than the indexer's
per-note chunk cap and only its head was embedded. A match against such a
note is a match against its head; its tail is not reachable by semantic
search at all, though keyword_search still covers the whole note.
Section locator. A fresh row names the section it matched on its
result line: § "<heading path>" (#N) for a heading's section, or
§ (top of note) for text before the first heading.
read_note(path, section="#N") reads exactly that section. The quoted
path is note text; the (#N) after it is the server's. The locator is
omitted on stale rows and on rows not yet re-embedded since heading-aware
chunking. While any of your notes is not yet re-chunked, the line after
the header reads index_transition: N notes not yet re-chunked; …:
ranking across the two generations is approximate, so re-run once it is
gone. Previews are one line.
The bound on the staleness signal, stated so it is not over-read: it reports what the index has committed. An edit that the indexer has not yet scanned is not marked, so a note edited in the last few minutes may come back unmarked with a superseded preview. The guarantee is "no result presents text the index knows to be superseded", not "no result is ever out of date".
rerank=true asks the deployment's reranker to reorder the candidates
this call already fetched; it can add up to the configured timeout. Its
rows are one-line quoted objects followed by server fields (with
rerank_score when reranked). The header says reranked: true or
reranked: false (<reason>), and an unreranked page keeps the unreranked
order; reranked: false (not_configured) means this deployment has no
reranker.
The header also carries confidence: ok or confidence: low (the
closest match is under the deployment's threshold; ok when none is set).
Args: query: Natural language description of what you're looking for. limit: Maximum number of distinct notes to return (default 15). folder: Optional folder prefix (e.g. "Projects/"). tags: Optional list of tag names; only notes carrying ALL listed tags match (e.g. ["product"]). frontmatter: Optional dict of frontmatter key/value pairs; strict type matching — string "0" does not match integer 0 (e.g. {"status": "active"}). rerank: Reorder the fetched candidates with the deployment's reranker (default false).
Inputs: query (required), tags, limit, folder, +2 more. Returns: result
set_frontmatterSet frontmatterADestructive
Mutate a note's YAML frontmatter without touching its body. Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
Arguments: path, updates (keys to set), remove (keys to drop) and the optional expected_hash
precondition. Parses the existing frontmatter, merges in updates (overwriting matching keys, adding new
ones), then drops the keys in remove; the body is preserved byte-for-byte. A note with no frontmatter
(no --- fence on line 1) gets a fresh block prepended ahead of the unchanged body.
expected_hash: pass the content_hash a read returned, verbatim (sha256:<64 lowercase hex>), and
the call is refused with nothing written if the file changed since. It is the whole file's hash, never
a hash of the text you received. Optional by default — omitted, a stale edit overwrites — unless the
deployment requires it, when an omitted hash is refused precondition_required. The comparison runs ahead
of the malformed-block diagnosis and ahead of the no-op check, so a stale base never yields "no changes"
or a defect report about bytes you have not seen. Every refusal the server raises ends with one
machine-readable MCP-REFUSAL {"code":…} line (an undeclared or mistyped argument is rejected by protocol
validation before the tool runs and carries no such line) — stale_precondition (with the current hash),
concurrent_write, no_incumbent, malformed_precondition, precondition_unavailable,
precondition_required — each stating what resolves it. The server also re-compares the file immediately
before publishing. A write
reports the content_hash of the bytes this call published; a no-op publishes nothing and reports none.
A malformed block is refused, never worked around. An unclosed line-1 fence, YAML that fails to parse,
and YAML that is not a mapping (null, ~, comments only, a list, a scalar) each return an error naming
the defect and pointing at edit_note(path, content, replace_frontmatter=True) as the repair. Nothing is
written — in particular no second block is prepended above the broken one — and remove= refuses
identically rather than silently doing nothing, even for a call with no updates and no remove. An
empty fenced block (--- immediately followed by ---) is valid: it is a valid empty mapping and is
updated in place.
Only an effective change writes. updates that set every named key to the value it already holds
(compared type-sensitively, so true is not 1) together with remove naming only absent keys report no
changes and leave the file byte-identical. Removing the last key removes the block entirely — no fences, no
separator, exactly the prior body.
Re-serialization goes through PyYAML, which does NOT preserve YAML comments — any # comment in the
original frontmatter is lost on the first set_frontmatter call. A path whose final component is a symlink
is refused, naming its target; symlinked folders inside the vault work normally. See get_vault_guide for
vault frontmatter conventions.
Args:
path: Vault-relative path to the note.
updates: Mapping of keys to set. Use the empty dict (or omit) to skip.
remove: List of keys to delete from the frontmatter. Missing keys are ignored (and, on their own, make
the call a no-op rather than a write).
expected_hash: The note's content_hash as you last read it. Refuses the write, changing nothing, if
the note has changed since.
Inputs: path (required), remove, updates, expected_hash. Returns: result
task_agendaTask agendaARead-onlyIdempotent
A dated overview of open tasks in one call, from the index: overdue, due today, scheduled and now due, and upcoming.
Use list_tasks to filter, search or page through tasks in general; use
task_agenda for "what is due". Plain checkboxes work; only tasks with a
Tasks-plugin date (📅 due, ⏳ scheduled) can be dated, and the emoji fields
are otherwise optional.
Sections, each counted and disjoint — every open task due on or before
date + days, or scheduled on or before date, is in exactly one:
overdue: due before
date;due today: due on
date;scheduled and now due: scheduled on or before
datewith no due date, or with a due date after the window;upcoming: due in the
daysdays afterdate, grouped by due date.
Rows are brief: marker, id, the path in backticks with :line (escaped
as in list_tasks; pass it unescaped), dates,
priority, tags and description. complete_task and update_task take
that id with the path. A section shows at most 25 rows (overdue, due
today), 15 (each scheduled part) or 50 (upcoming); one with more ends
continue: list_tasks(…) — the exact list_tasks arguments, dates
resolved, with a cursor when rows were shown — to be called with this
call's folder, tags, exclude_tags and scope.
The header states the timezone and date used, days, the scope,
excluded by scope: N, and what the index could not show (notes not yet
scanned, tasks that could not be indexed, notes over the task cap, ids
pending), so an empty section does not mean no tasks exist. Invalid
arguments are refused invalid_argument; response_cap_too_small means
the deployment's response cap is under 2,800 characters (3,121 while a
task rule is in force).
Args:
date: The day to report on: YYYY-MM-DD, today (default),
tomorrow, yesterday, +Nd or -Nd, in your task timezone.
days: The upcoming window in days, 1–31 (default 7).
folder: Only notes under this path prefix (e.g. "Projects/").
tags: Only tasks carrying every one of these tags, matched by /
segment and case-insensitively. At most 32.
exclude_tags: Drop tasks carrying any of these tags.
scope: default applies your task settings: excluded folders,
excluded note tags and the task rule (which checkboxes count as
tasks); all ignores them.
Inputs: date, days, tags, scope, +2 more. Returns: result
update_taskUpdate taskADestructive
Change one task's dates, priority, tags, recurrence, status, description or context, in place. Requires write permission (a readwrite API key or OAuth scope).
Arguments: path and id (both from a listing); the changes due,
scheduled, start, priority, add_tags, remove_tags, recurrence,
status, text, append_context and clear; dry_run and the
expected_hash precondition.
Every refusal the server raises ends with one machine-readable
MCP-REFUSAL {"code":…} line and writes nothing; an undeclared or
mistyped argument is rejected by protocol validation before the tool runs
and carries no such line.
The id, from a list_tasks or task_agenda row, is re-checked against
the note's current text, never a line number, so the call changes only
the line it names or refuses. A task's id changes whenever its line
changes; the response returns the new one. An id shaped <key>.<i>of<n>
names one of several identical lines and is accepted only with
expected_hash, the note's content_hash from read_note; without it
the call is refused precondition_required. To complete a task use
complete_task.
Only the named fields change: a value is replaced where it stands, an
added field goes into the trailing emoji fields, and every other
character of the line and the note is kept. Plain checkboxes work;
Tasks-plugin fields are added as you set them. text replaces the
description's words and keeps its tags; only remove_tags removes a tag
(whole tags, case-insensitive). status: open ([ ]) or in_progress
([/]) drop ✅/❌; cancelled ([-]) adds ❌ <today> per your task
settings and never writes a next occurrence. append_context adds one
indented - <text> line after everything already under the task.
dry_run=true returns the diff and the new line(s) and writes nothing.
expected_hash is optional otherwise and binds the whole note (refused
stale_precondition if it changed). Without it, a change made by someone
else during the call is retried from a fresh read, at most 3 attempts,
then refused concurrent_write. A call that would change nothing answers
No changes. The response names the fields changed and gives the new
line and id, content_hash, the timezone and dates resolved, and
index: refreshed or index: may lag (<reason>) (the write stands).
Codes: task_not_found (the line changed since the listing: list again),
task_ambiguous, task_changed, precondition_required,
stale_precondition, malformed_precondition, concurrent_write,
recurrence_unsupported, task_malformed (fix the line with
edit_note), content_unsafe (a malformed frontmatter block: the
refusal names the repair), size_limit, invalid_argument (also
status="done"), not_found, permission_denied.
Args:
path: The note's vault-relative path, unescaped (a listing shows
\-escapes).
id: The task id from a list_tasks or task_agenda row.
due: New due date (📅), a date form as above.
scheduled: New scheduled date (⏳), same forms.
start: New start date (🛫), same forms.
priority: highest, high, medium, low or lowest.
add_tags: Tags to add (at most 32).
remove_tags: Tags to remove.
recurrence: A 🔁 rule from the grammar complete_task lists.
status: open, in_progress or cancelled.
text: The new description: one line, 1–1,000 characters, no emoji.
append_context: One line of context to add under the task.
clear: Fields to remove: any of due, scheduled, start,
priority, recurrence.
dry_run: Preview the change without writing.
expected_hash: content_hash from read_note; needed for a suffixed id.
Inputs: id (required), path (required), due, text, +11 more. Returns: result
write_fileWrite fileADestructive
Write a file into the vault — including non-markdown (e.g. save a
generated PDF or image). Requires write permission — a readwrite API key, or an OAuth token
carrying the readwrite scope.
Peer to create_note/edit_note, which stay markdown-only.
content carries the bytes: with encoding="base64" (default) it is
base64-decoded to raw bytes; with encoding="text" it is written verbatim
as UTF-8. The write is atomic — the bytes are staged and flushed before
anything is published — missing parent folders are created, and content over
MAX_FILE_WRITE_BYTES (default 25 MB, decoded length) is refused.
No-clobber by default: writing over an existing file requires
overwrite=True. The default publishes by linking a staged, never-named
inode into place in one kernel-atomic step, so an existing file cannot be
replaced; overwrite=True publishes with a single same-directory rename
instead. A vault filesystem that cannot stage an unnamed file refuses the
no-clobber write with an error naming
VAULT_ALLOW_NAMED_STAGING_FALLBACK, rather than staging under a visible
name. Any path with a component starting with . (dot-directories and
dot-files alike) and path traversal are rejected; invalid
base64 errors without writing anything. A path whose final component is a
symlink is refused, naming its target, so overwrite=True cannot clobber a
file through an alias; symlinked folders inside the vault work normally.
The MCP transport also bounds the whole request body (sized so a base64
write at the cap always gets through). Base64 is therefore the always-safe
encoding: encoding="text" content whose JSON escaping inflates past that
bound is rejected by the transport with a bare HTTP 413 before this tool
runs — send such content as base64 instead.
expected_hash binds an existing whole file on overwrite=True; optional by default — omitted, the
overwrite replaces whatever is on disk — unless the deployment requires it, when an omitted hash on
an overwrite is refused precondition_required. Obtain its canonical sha256:<64 lowercase hex> value from read_file's
base64 header, read_file(hash_only=True), or a prior write's success.
Syntax is checked before path work; a hash with no-clobber or a missing
destination is no_incumbent. An over-cap incumbent cannot be guarded.
A stale hash refuses before publication; matching also enables the in-call
comparison, which refuses an edit arriving during this call as
concurrent_write. Without a hash, overwrite remains unconditional unless
the deployment requires preconditions. Creation is exempt.
Success reports the hash of the bytes this call published, not necessarily what remains when the response arrives. Over-cap incumbents or results omit the hash without failing an otherwise permitted unguarded write.
Args: path: Vault-relative destination path (e.g. "Outputs/report.pdf"). content: File contents — base64 string (default) or UTF-8 text. encoding: "base64" (default) or "text". overwrite: If True, replace an existing file. Off by default. expected_hash: Optional whole-file raw-byte digest of the incumbent.
Inputs: path (required), content (required), encoding, overwrite, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
The descriptions do an unusually good job of cross-referencing peers: keyword vs semantic vs hybrid search, get_neighborhood vs find_related, read_note vs read_file, and note/file write/delete pairs are explicitly distinguished. A few near-neighbor groups remain (get_recent vs list_notes vs get_changes, and task_agenda vs list_tasks), but the guidance makes them selectable in practice.
All names use snake_case and most are readable verb_noun or verb_object forms (read_note, create_note, move_task, request_upload). The main deviations are the search family using modifier_noun (keyword_search, semantic_search, hybrid_search) and task_agenda being noun_noun, but these are consistent within their groups and not confusing.
At 33 tools, the surface is heavy for an MCP server even though the domain is broad, covering notes, files, search, tasks, transfers, and imports. Many tools are justified individually, but the count is well above the 25-tool threshold and invites selection overhead; some read/write/delete/move pairs across notes and files could be consolidated or scoped.
Coverage is strong: notes have create/read/edit/move/delete/list/change tracking and frontmatter support; search spans keyword, semantic, hybrid, related, backlinks, links, neighborhood, and orphans; tasks have list/agenda/add/update/complete/move; files have read/write/delete/list/upload/download/import. Minor lifecycle gaps remain, notably no direct move for non-markdown files, no explicit delete_task, and no trash restore or reindex operation.
Maintenance
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Related MCP Servers
- AlicenseAqualityAmaintenanceStandalone MCP server for Obsidian vaults - hybrid search (FTS5 + vector + cross-encoder reranking), images and PDFs in agent-readable form, Kanban-aware tasks (Tasks-plugin + Dataview formats), structured memory with topic recall, fine-grained read/write tools for optimal token efficiency, and link graph support. Run locally, self-host, or one-click deploy for remote access. OAuth 2.1.163338MIT
- AlicenseNot gradedqualityDmaintenanceSelf-hosted MCP server that provides embedding-powered semantic search with graph context over Obsidian vaults, supporting multiple vaults, local embeddings, and a web dashboard.MIT
- AlicenseNot gradedqualityBmaintenanceLocal-first MCP server for retrieval over markdown wikilink vaults, offering hybrid vector+lexical search, note reading, neighbor expansion, and recent activity tracking with fully local embeddings and no network egress.MIT
- AlicenseNot gradedqualityDmaintenanceSelf-hosted MCP server for private Obsidian vaults on GitHub, exposing tools to search, read, write, and analyze Markdown notes and their link graph.MIT