Obsidian × MCPVault: Write a Note from Any MCP Client
Create or patch a note in your Obsidian vault through MCPVault, from any MCP client, with frontmatter preserved.
Run this workflow
CI-verified, 5/5 fixtures passing.
Intended Use
Anyone who wants their AI client to create or update vault notes over MCP, from any host (Claude Desktop, LM Studio, or any MCP client, including local open-model setups). MCPVault's signature is frontmatter protection: patch_note edits the body without clobbering frontmatter. CI verifies that invariant deterministically. The model-driven write_note / patch_note call is fenced.
Not for
- Vaults you have not backed up
- Expecting CI to prove a specific model, GPU, or OS works, that part is host-side and community-reported, not machine-checked
The Stack
Tested Against
mcpvault@latestnode@20.xobsidian@1.7.xSide effects & data flow
- Network
- none, local only
- Writes
- ./mcp.json, ./vault/Daily/
- Credentials
- none required
Prerequisites
- Node 20+ (MCPVault runs via npx)
- Any MCP client: Claude Desktop, or LM Studio with MCP enabled
- An Obsidian vault folder you've backed up
Steps
- 1
Configure MCPVault and write a note with frontmatter
Same host-agnostic MCPVault block (Claude Desktop or LM Studio). CI validates the config, then writes a note with frontmatter, the shape write_note produces.
cat > mcp.json <<'EOF' { "mcpServers": { "obsidian": { "command": "npx", "args": ["@bitbonsai/mcpvault@latest", "/path/to/your/Vault"], "env": {} } } } EOF node -e 'const c=JSON.parse(require("fs").readFileSync("mcp.json","utf8"));const o=c.mcpServers.obsidian;if(o.command==="npx"&&o.args.some(a=>a.indexOf("@bitbonsai/mcpvault")===0)){console.log("config OK: npx -> @bitbonsai/mcpvault")}else{console.log("BAD");process.exit(1)}' mkdir -p vault/Daily cat > vault/Daily/2026-06-09.md <<'EOF' --- title: Daily Note tags: [daily, journal] status: open --- Morning thoughts go here. EOF test -s vault/Daily/2026-06-09.md && echo "note written: vault/Daily/2026-06-09.md" - 2
What CI checks: patch_note edits the body and frontmatter survives
MCPVault's guarantee is frontmatter protection. CI appends to the body (what patch_note does) and confirms the title, tags, and status frontmatter are untouched and still sit above the new body line. That invariant is the deterministic heart of the write path. No model, no key.
printf '%s\n' '- 14:00 shipped the MCPVault read/write recipes' >> vault/Daily/2026-06-09.md cat > checkwrite.mjs <<'EOF' import { readFileSync } from 'node:fs'; const t = readFileSync('vault/Daily/2026-06-09.md', 'utf8'); let ok = true; function check(label, cond){ console.log(label + ': ' + (cond ? 'yes' : 'NO')); if(!cond) ok=false; } check('frontmatter title preserved', t.includes('title: Daily Note')); check('frontmatter tags preserved', t.includes('tags: [daily, journal]')); check('frontmatter status preserved', t.includes('status: open')); check('body patch applied', t.includes('shipped the MCPVault read/write recipes')); check('frontmatter sits above patched body', t.indexOf('title: Daily Note') < t.indexOf('shipped the MCPVault')); if(!ok){ console.log('mcpvault write check FAILED'); process.exit(1); } console.log('mcpvault write check OK'); EOF node checkwrite.mjs - 3
Ask your model to write or patch (the model step, not checked by CI)
In your MCP client, ask it to create or update a note. write_note / patch_note then run through the model, which is non-deterministic and fenced. CI proves the write target is valid and frontmatter is preserved, never the model's wording.
Eval, 5 fixtures
Last passed: verified todayconfig-validcontainstimeout 30s · max $0Expected:
config OK: npx -> @bitbonsai/mcpvaultfrontmatter-preservedcontainstimeout 30s · max $0Expected:
frontmatter title preserved: yespatch-appliedcontainstimeout 30s · max $0Expected:
body patch applied: yeswrite-okcontainstimeout 30s · max $0Expected:
mcpvault write check OKclean-exitexit_codetimeout 30s · max $0Expected:
0
Results
The write side of the host-agnostic setup a reader ran locally on Windows + LM Studio; CI verifies write_note + patch_note keep frontmatter intact.
Did this work for you?
Our CI checks the setup runs. You tell us if the whole thing worked. Tell us straight.
Liked this workflow?
Get new verified workflows in WebAfterAI, three issues a week (Tue, Thu, Sat).