Skip to main content
Glama
mdvault-mcp
by 0xmortuex

mdvault-mcp

Let your AI work with a folder of markdown notes the way you do: search it, follow the links, query the properties, and refactor it without breaking anything.

mdvault-mcp is an MCP server for an Obsidian-style vault, a Logseq pages folder, or any directory of .md files. It does not need Obsidian running and talks to the files directly.

Why another notes server? Several Obsidian MCP servers exist already (for example StevenStavrakis/obsidian-mcp, laurentiudanielgi-coder/obsidian-mcp, farmerajf/obsidian-mcp-server), and some of them already update links on rename. This one is built around not damaging your notes, and says so with tests:

  • Rename is a reviewable refactor. rename_note defaults to a dry run that lists every file and every link line it would change, then reports broken links before and after. Its tests re-parse the whole vault in a fresh index after each rename and check that every link still resolves to the same note.

  • Ambiguity is reported, never guessed. Two notes called Meeting Notes in different folders make [[Meeting Notes]] ambiguous. You get both candidate paths, and ambiguous links are left alone by renames.

  • Byte-exact edits. Line endings (CRLF stays CRLF), BOM, frontmatter comments and formatting are preserved. Edits are text splices, never a re-serialised file.

  • Confined, atomic, no surprise overwrites. Symlink and Windows junction escapes are blocked (tested), dot-folders like .git and .obsidian are never touched, files are written via temp file + os.replace, and nothing is overwritten without overwrite=true.

  • Fast on big vaults. In-process BM25 search; parsed notes are cached in SQLite (outside your vault) keyed by mtime. Tested on a generated 5,000-note vault.

  • Turkish-friendly. seker finds Şeker; links are case-insensitive and Unicode-normalised.

Python, one dependency (mcp), runs with uvx.

What it looks like

Real output from the test vault:

> rename_note "Beta Plan" -> "Beta Roadmap"          (dry_run defaults to true)
DRY RUN, nothing written.
Rename: Projects/Beta/Beta Plan.md -> Projects/Beta/Beta Roadmap.md
3 link(s) in 2 file(s) would be updated:
  Home.md  (1 link)
      L8: Welcome. See [[Projects/Alpha/Plan]] and [[Beta Plan|the beta]].
       -> Welcome. See [[Projects/Alpha/Plan]] and [[Beta Roadmap|the beta]].
  Projects/Alpha/Alpha Plan.md  (2 links)
      L14: Links: [[Home]], [[Alpha Plan#Goal]], [[Beta Plan#^b1|beta block]], [[Meeting Notes]].
       -> Links: [[Home]], [[Alpha Plan#Goal]], [[Beta Roadmap#^b1|beta block]], [[Meeting Notes]].
      L15: Markdown: [home](../../Home.md), [beta](../Beta/Beta%20Plan.md#top), ...
       -> Markdown: [home](../../Home.md), [beta](../Beta/Beta%20Roadmap.md#top), ...
Call again with dry_run=false to apply.

> read_note "Meeting Notes"
'Meeting Notes' is ambiguous: 2 notes match. Pass the full path of one of them:
  - Areas/Meeting Notes.md
  - Projects/Meeting Notes.md

> note_links "Alpha Plan" direction=in
Backlinks to Projects/Alpha/Alpha Plan.md: 3 links from 2 notes
  Home.md:10  (embed) Embed: ![[diagram.png]] and ![[Alpha Plan]].
  Projects/Beta/Beta Plan.md:8 [2 links]  Back to [[Alpha Plan]] and [alpha](../Alpha/Alpha%20Plan.md).

Related MCP server: Obsidian MCP

Install

You need uv. Point the server at your notes folder.

Claude Code

claude mcp add notes -- uvx mdvault-mcp --vault "C:\Users\you\Documents\Notes"

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "notes": {
      "command": "uvx",
      "args": ["mdvault-mcp", "--vault", "C:\\Users\\you\\Documents\\Notes"]
    }
  }
}

Add "--read-only" to the args to disable every writing tool. MDVAULT_PATH and MDVAULT_READ_ONLY=1 work instead of the flags. MDVAULT_CACHE_DIR moves the index cache (default: %LOCALAPPDATA%\mdvault-mcp, ~/Library/Caches/mdvault-mcp or ~/.cache/mdvault-mcp).

Tools

Tool

What it does

vault_overview

Note count, top tags, most linked notes, orphans, broken and ambiguous links, notes with bad frontmatter.

search_notes

BM25-ranked full text with a snippet and line number. Optional folder, tag, all_terms.

read_note

By path, name or [[wikilink]]: parsed frontmatter, tags, link counts, body (or raw=true).

note_links

Backlinks (with the surrounding line) and/or outgoing links with where each resolves.

query_notes

Tag (nested tags included) and frontmatter queries: status=draft AND tags contains project.

broken_links

Broken links with did-you-mean, and ambiguous links with all candidates.

create_note

New note with optional frontmatter; refuses to overwrite; warns about duplicate names.

append_to_note

Append to a note, or to today's daily note (daily=true, created if missing).

edit_note

Exact-text replace that must match once; dry_run shows a diff.

rename_note

Rename or move and update every link; dry run by default.

Links understood: [[Note]], [[Note#Heading]], [[Note#^block]], [[Note|alias]], ![[embed]], [[Folder/Note]], [text](path/Note.md#h) (relative, /rooted, %20-encoded, <angle>). Links inside code fences and inline code are ignored.

Try asking

  • "Give me an overview of my vault. What is broken or orphaned?"

  • "Search my notes for kernel scheduler and show me the best match."

  • "Which notes link to my Roadmap note, and what do they say around the link?"

  • "List every note with status=draft and the tag project, due before December."

  • "Rename 'Q3 Plan' to 'Q4 Plan'. Show me the dry run first."

  • "Add '- call the dentist' to today's daily note."

  • "In the 'Alpha Plan' note, change the owner line to 'owner: fadi'."

  • "Are there two notes with the same name? Which links are ambiguous?"

Security

The server reads and writes files, so the limits are deliberate:

  • One folder. Every path is resolved against the vault root. .., absolute paths, drive letters, and any component starting with . (.git, .obsidian, .trash) are refused. Symlinks and Windows junctions are never followed when scanning, and any write path that passes through one is refused, even when it points back inside the vault.

  • No silent overwrite. create_note needs overwrite=true; rename_note never overwrites; edit_note needs the old text to match exactly once.

  • Atomic. Each file is written to a temp file in its folder, fsynced, then moved into place with os.replace. A rename stages every changed file first, re-checks that none changed while planning, and only then moves anything.

  • Not UTF-8? Untouched. A note that is not valid UTF-8 is reported and never rewritten.

  • File names stay portable. New names with characters Windows rejects (: ? * | " < >), reserved device names or trailing dots are refused.

  • --read-only removes the ability to write at all.

The index cache lives outside the vault and holds parsed note text (words and link positions), so treat it like your notes.

Limitations

  • Reference-style links ([x]: path), raw HTML links, Logseq key:: value properties and ((block-uuid)) references are not parsed.

  • Frontmatter is a practical YAML subset: maps, lists, flow collections, quoted strings, numbers, booleans, | and > blocks. Anchors, tags and multi-line plain scalars are reported as errors on that note (it is still searchable and linkable).

  • Frontmatter aliases are not used to resolve links (Obsidian does not resolve them either).

  • A rename rewrites the link target only. If a link's visible text was the old name ([[Old]]), it now shows the new name, as in Obsidian; use [[Old|text]] to keep the display.

  • Renames apply to notes, not attachments.

  • If the vault changes on disk between tool calls (Obsidian sync, your editor), the next call re-scans it. There is no file watcher.

  • Cold indexing is CPU-cheap (about 0.6 ms per note to parse) but reads every file once; on a Windows machine with real-time antivirus scanning, 5,000 freshly written notes took about 25 s on the first run. A restart reads the cache in about 0.2 s.

Development

uv sync --extra test
uv run pytest -m "not perf"     # fast suite
uv run pytest tests/test_perf.py -s   # 5,000-note vault
uv run ruff check src tests && uv run mypy --strict src

Companion tutorial that builds a minimal version from scratch: mdvault-mcp-the-hard-way.

License

MIT

Available Tools

10 tools
append_to_noteA

Append text to the end of a note, keeping the file's line endings. Either note names an existing note, or daily=true appends to today's daily note (created if missing) at '<daily_folder>/<date_format>.md', by default 'Daily/YYYY-MM-DD.md'. date="YYYY-MM-DD" picks another day. Good for logging ideas, tasks and meeting notes without rewriting anything.

Inputs: text (required), date, note, daily, +2 more. Returns: result

create_noteA

Create a note. path is relative to the vault root ('Projects/New Idea.md'; .md is added if missing; missing folders are created). Fails if the file exists unless overwrite=true. frontmatter is an optional object written as a YAML block at the top, e.g. {"status": "draft", "tags": ["project"]}. Warns when another note already has the same name, because plain [[links]] to that name become ambiguous. Paths that leave the vault, pass through symlinks, or touch dot-folders (.git, .obsidian) are refused.

Inputs: path (required), content, overwrite, frontmatter. Returns: result

edit_noteA

Replace exact text in a note. old_text must match exactly once (whitespace included), or the edit is refused with the line numbers of the matches; add surrounding text to make it unique. new_text="" deletes. Line endings of the file are preserved and an edit that would make the frontmatter unparseable is refused. dry_run=true shows a diff and writes nothing.

Inputs: note (required), new_text (required), old_text (required), dry_run. Returns: result

query_notesA

Find notes by tag and/or frontmatter properties.

tag="project" matches notes tagged #project (frontmatter or inline) and nested tags such as project/alpha. where is a small query language over the frontmatter: status=draft, due < 2026-12-01, tags contains project, owner exists, owner missing, joined with AND / OR (AND binds tighter), with an optional NOT in front of a clause. Example: status=draft AND tags contains project. Quote values with spaces. Comparison ignores case; on a list, = and contains mean "any element". Notes whose frontmatter fails to parse are skipped (vault_overview lists them).

Inputs: tag, limit, where, folder. Returns: result

read_noteA

Read one note. note is a vault path ('Projects/Plan.md'), a name ('Plan') or a [[wikilink]]; a name shared by several notes returns an error listing the full paths.

Returns the path, title, tags, link counts, the parsed frontmatter as JSON, and the body. raw=true returns the exact file text including the frontmatter block (use it before edit_note when you need to change the frontmatter itself). Long notes are truncated at max_chars with a visible notice.

Inputs: note (required), raw, max_chars. Returns: result

rename_noteA

Rename or move a note and update every link to it across the vault: [[wikilinks]] (keeping #headings, ^blocks and |aliases), ![[embeds]] and relative markdown. new_name is a bare name ('New Title', stays in the same folder) or a vault path ('Archive/New Title.md', moves it). A moved note's own relative links are fixed too.

dry_run defaults to TRUE: it lists every file and link that would change and writes nothing; review it, then call again with dry_run=false. Never overwrites an existing note. Links that are ambiguous (several notes share the name) cannot be attributed safely and are reported rather than rewritten. The result reports broken links before and after.

Inputs: note (required), new_name (required), dry_run. Returns: result

search_notesA

Full-text search over note titles, body text and tags, ranked best first (BM25), with a snippet showing the best-matching line and its line number.

Matching ignores case and diacritics ("seker" finds "Seker" and "Şeker") and uses whole words, no stemming. Words in the title count more than words in the body. By default a note matches if it contains any query word, and notes containing more of them rank higher; all_terms=true requires every word. folder="Projects" limits to that folder (and below); tag="project" limits to notes with that tag or a nested tag like project/alpha.

Inputs: query (required), tag, limit, folder, +1 more. Returns: result

vault_overviewA

Summarise the vault: note and file counts, top tags, most linked-to notes, orphan notes (no links in or out), broken links, ambiguous links, and notes whose frontmatter does not parse. Call this first to learn what is in the vault. Re-scans changed files on every call.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool has a clearly stated role, and the potentially confusable pairs are explicitly distinguished in their descriptions (search_notes is full-text/BM25 while query_notes is frontmatter/tag filtering; read_note returns content while note_links returns the link graph). The one real overlap is vault_overview, which already aggregates broken and ambiguous links that broken_links exposes as a dedicated tool, so an agent may pick either.

    Naming Consistency4/5

    The mutation tools follow a clean verb_noun snake_case pattern (create_note, append_to_note, edit_note, rename_note) and read tools mostly do too (search_notes, read_note, query_notes). A few read-only tools deviate to noun-first or adjective-first forms (vault_overview, note_links, broken_links), but the convention is still readable and predictable overall.

    Tool Count5/5

    Ten tools is a well-scoped set for an Obsidian-style vault: read/inspect (overview, search, read, links, query, broken links) plus the mutation subset (create, append, edit, rename). Nothing feels padded and no operation is duplicated for the sake of count.

    Completeness3/5

    Creation, reading, appending, in-place editing, renaming/moving with link rewriting, search, property queries, and link diagnostics give broad lifecycle coverage. However, there is no delete/remove operation at all, and no direct frontmatter mutation short of raw read plus text replacement, leaving an obvious dead end for vault maintenance.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to read, write, search, and navigate Obsidian vault notes with support for CRUD operations, full-text search, graph navigation, daily notes, and frontmatter management.
      4,114 npm
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to manage Obsidian vaults through full CRUD operations, wikilink management, and section-level manipulation. It supports frontmatter editing, tag-based searching, and automated link updates to maintain vault integrity.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to search, read, and traverse Markdown note vaults (Obsidian-compatible) with full-text search, backlinks, knowledge graphs, and a persistent memory system for cross-session context.
      16
      11 npm
      4
      MIT