Self-hosted Vault MCP
Provides access to a Markdown notes folder, enabling file listing, note reading, search across Markdown notes, and atomic creation or updates of Markdown files.
Provides access to an Obsidian vault folder, enabling MCP clients to list, read, search, create, and update Markdown notes without requiring the Obsidian app or a sync plugin.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Self-hosted Vault MCP
Give an MCP client access to a Markdown or Obsidian folder on your server. Read relevant files, search a selected subtree, and create or update notes in one configured folder (default Agents). No running Obsidian app or synchronization plugin is needed.
Cloudflare Access authenticates every request. The server verifies signed Access assertions and uses stateless Streamable HTTP at /mcp.
Quick start
You need a Linux server with Docker Engine and Docker Compose v2, an existing vault folder, and a Cloudflare account with a domain, Tunnel, and Access. The image uses Python 3.12. A direct Python installation needs Python 3.12+ with venv/pip and the dependencies in requirements.txt.
Download this source and copy
.env.exampleto.env. Set the vault, state, and write-folder paths. Follow the concrete storage permission instructions to match the vault owner's numeric UID/GID, or use a dedicated service identity and shared group. The defaults are nonroot10001:10001; do not recursively change your vault's ownership.Follow the ordered Cloudflare setup: create the tunnel route, protect the entire hostname with Access, configure Managed OAuth (or a bot's Service Auth policy), and save the tunnel token through your password manager into its private file. Fill the corresponding
.envsettings and choose a published cloudflared image version, pinned to its digest for production.Run
docker compose up -d --build. Compose publishes no origin host port.Connect your Streamable HTTP MCP client to
https://vault.example.com/mcp, complete Access login, and callbootstrap.
Ask your agent to follow AGENTS.md for detailed configuration and a synthetic-note verification. Missing AGENTS.md or optional context in the served vault is reported honestly; the server invents no owner rules.
Related MCP server: L4
Tools
Tool | Purpose |
| Live owner instructions and optional context, including hashes or missing metadata |
| Recursive files in the write folder by default; explicit |
| Preferred discovery; same prefix defaults, up to 200 items per page, with continuation and coverage |
| One explicit visible file, with SHA-256 (up to 256 KiB) |
| Legacy bounded Markdown search; fails with a page-tool hint when the answer is incomplete |
| Preferred Markdown search; same prefix defaults, up to 50 matches and 1,000 scanned entries per page |
| Exclusive atomic creation, including new nested folders |
| Atomic replacement with an expected SHA-256 precondition |
| Local persistence mode or optional external readiness guard |
Writes require agent_write, a portable .md path inside the write folder, content no larger than 64 KiB, and a canonical UUID request_id. Use the same UUID and payload on retry. Hash conflicts do not overwrite the file. A crash after possible publication leaves an ambiguous ledger entry: inspect the actual file before deciding what to do. Do not bypass ambiguity with a fresh UUID blindly.
Storage and limits
A successful save confirms local filesystem persistence. It does not confirm synchronization to another device. Use a separately managed synchronization solution if needed; this project bundles none. Standalone writes work as soon as valid storage and authentication are configured. An optional external-readiness guard is documented in AGENTS.md and fails closed whenever configured.
Before trusting a connected deployment, check that the actual synchronizer ignores .vault-*.tmp staging files. With synthetic notes and owner permission, verify MCP save to another device and a reverse edit from that device back through MCP read/SHA. In the intended native client, verify OAuth login, initialize, tool listing, read, and a permitted synthetic create/update. These connected checks are separate from the local fixture suite.
The mutex coordinates MCP writers sharing the state directory. It is not a distributed lock; external editors and synchronizers can race a hash check. Use one MCP instance and avoid concurrent external edits to agent-owned notes. Keep backups of the vault and private state together; the state ledger preserves retry history and contains stored operation receipts.
Hidden paths, traversal, and symlinks are blocked. Visible files elsewhere in the vault can be read explicitly. This is one vault trust boundary, not a per-folder multi-user permission system. Notes are untrusted data; the owner's instructions govern permitted use.
Set VAULT_DENIED_PATHS to semicolon-separated visible relative paths, for example Private;Agents/Archive, to exclude those paths and descendants from generic reads, bootstrap, discovery, and writes. Matching uses Unicode NFC and casefolded path components, so Privateer is unaffected. The empty default keeps prior access. The configured write folder itself cannot be excluded. Restart after changing this setting.
Prefer the page tools for discovery. Their envelope contains items, scanned, skipped, truncated, and next_cursor. scanned counts examined visible entries in this call; skipped counts entries that could not be examined or read. A page may have no items and still have a cursor. Follow cursors until next_cursor is null and inspect skipped counts before claiming complete content coverage. Cursors bind to the operation, query, prefix and exclusion policy; malformed or mismatched cursors fail. They hold traversal position, not access rights or a snapshot of concurrent vault edits. Legacy list_files and search_notes retain their inputs and list output shapes when complete, and return an actionable error when bounded results are incomplete.
All four list/search tools accept optional modified_after and modified_before timezone-aware RFC3339 bounds. The window is [after, before): the lower edge is inclusive and the upper edge exclusive. Either bound may be omitted; malformed/naive timestamps or equal/reversed bounds fail with static errors. For example:
{"prefix":"Agents","modified_after":"2026-01-01T00:00:00Z","modified_before":"2026-01-02T00:00:00Z"}Pass these arguments to list_files_page; add query for search_notes_page. Continue with the same window, prefix and query plus cursor. Equivalent timezone offsets and fractional spellings share a cursor binding; changing the window fails. Filtering happens before filename/content matching without reading out-of-window bodies. Listing items remain path strings. With filters, prefix: "" lists only immediate root files in the window, omitting directories: directory modification times do not describe descendant edits. Use a targeted folder to list its files recursively, or explicit empty-prefix search to search recursively across the visible vault. Omitted filters preserve existing defaults, ordering, limits and coverage rules.
read_file also returns modified_at as UTC RFC3339, using metadata from the same open file descriptor as the content. Windows use the current filesystem modification time, including newly created notes; this is not original creation time or revision history. Delayed offline edits appear according to the served file's mtime, restored/preserved mtimes may fall outside a recent window, later edits replace earlier timestamps, and deleted files cannot be retrieved. Cursors are not snapshots; inspect skipped and repeat bounded discovery as needed during concurrent edits.
For existing clients, keep their legacy calls while upgrading them to follow page cursors. Reconnect after the server restarts so the client discovers the new tools. Start a new search after changing the query, prefix, or exclusion setting; an old cursor will be rejected. A completed page traversal proves only what this server could read during that traversal. It does not prove remote synchronization or a stable snapshot while another editor changes files.
Development
python3 -m venv .venv
.venv/bin/python -m pip install --index-url https://pypi.org/simple --require-hashes -r requirements.txt
.venv/bin/python -m unittest discover -s tests -v
.venv/bin/python -m pip wheel --no-deps --wheel-dir dist .The tests use synthetic temporary files and locally signed assertions through the real ASGI/MCP transport, with a fixture signing key resolver. They do not establish real Cloudflare configuration or native-client compatibility. CI also builds the container. Follow the deployment verification in AGENTS.md for your actual environment.
Source-available under PolyForm Perimeter 1.0.1. Personal and internal business use are allowed; providing competing products or services is restricted, including free competing offerings. Exceptions for competing commercial or free offerings require separate permission from the copyright owner. See NOTICE. Runtime dependencies FastMCP, PyJWT with cryptography, and Uvicorn retain their respective upstream licenses; cloudflared is a separate container maintained by Cloudflare.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Linked markdown notes as memory for AI apps: search, read, save and link notes over MCP.
Notes and memory assistant: one Markdown vault that Claude, ChatGPT and any MCP client can share.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceRemote MCP server for Obsidian vaults, enabling secure access to markdown notes from Claude clients without the Obsidian desktop app. Provides tools for searching, reading, listing recent notes, resolving daily notes, and creating/appending notes via HTTPS.MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to access and manage a personal markdown knowledge base stored in Cloudflare R2. Provides tools for listing, reading, writing, searching (full-text and semantic), and following backlinks between notes.3MIT
- AlicenseAqualityBmaintenanceEnables MCP clients to read, write, search, and manage notes, canvases, kanban boards, and other Obsidian vault content over a network, without requiring the Obsidian desktop app.33MIT
- AlicenseAqualityBmaintenanceExposes Obsidian-style Markdown vaults to MCP clients, enabling reading, writing, searching, and version-controlled editing of notes with automatic git snapshots and restore.1417 npm1MIT