I keep all my notes in ZenNotes, a keyboard-first Markdown app where every note is just a .md file in a folder called a vault. This week I got my vault talking to Command Code over MCP (Model Context Protocol) so an AI assistant can actually read, search and write my notes for me. Here is how I set it up on Windows 11, including the parts that tripped me up.
The stack
| Piece | What it is |
|---|---|
| ZenNotes desktop app | Keyboard-first Markdown notes app. Notes are plain .md files in a vault folder |
zn CLI |
Terminal tool that reads, writes, searches and manages the vault |
| MCP server | zn mcp speaks MCP, the standard protocol AI assistants use to call tools |
What I liked right away is that the CLI and MCP server ship inside the app itself. Nothing extra to install.
Part 1: ZenNotes and the vault
Install the app. On Windows it lands at %LOCALAPPDATA%\Programs\@zennotesdesktop\ZenNotes.exe. On first launch you pick a vault location. Any folder works, I used E:\ZENNOTES.
The vault is just files:
E:\ZENNOTES\
├── inbox\ ← new notes land here
├── quick\ ← quick-capture notes
├── archive\ ← archived notes
├── trash\ ← soft-deleted notes
└── .zennotes\ ← app metadata
ZenNotes remembers your choice in %APPDATA%\zennotes\zennotes.config.json. It is just plain JSON with a vaultRoot field. No database, no sync layer, no lock in.
Part 2: The zn CLI
zn is a thin shim that runs a Node script bundled inside the app, so you need Node on your PATH. Then in ZenNotes go to Settings → CLI → Install and it creates the shim for you.
zn --version
# → zn v2.27.0
The shim is tiny. If you ever need to recreate it by hand, it is just a .cmd that runs node "%LOCALAPPDATA%\Programs\@zennotesdesktop\resources\cli.js" %* and puts itself on your PATH.
Part 3: Driving the vault from the terminal
Almost every command accepts --json, which makes the CLI easy to script. These are the ones I use most:
zn list # notes, most recent first
zn read inbox/Welcome.md # print a note body
zn capture "Meeting takeaways" --tag work # quick-add a note
zn search "deadline" # full-text search
zn tag find work # notes carrying #work
zn task list --unchecked # open tasks from checkboxes
zn archive inbox/To-do.md # move to archive
capture is my favorite. It turns a single line into a timestamped note and you can even pipe text into it.
Part 4: The MCP connection
zn mcp is a stdio server. The AI client spawns it, talks over stdin and stdout, then stops it when you are done. No port, no URL. You never leave it running.
Command Code stores per-project MCP servers in %USERPROFILE%\.commandcode\projects\<project-slug>\mcp.json:
{
"mcpServers": {
"zennotes": {
"transport": "stdio",
"enabled": true,
"command": "zn",
"args": ["mcp"]
}
}
}
Or register it from the command line:
commandcode mcp add zennotes -- zn mcp
Verify it:
commandcode mcp list # → zennotes stdio local enabled
commandcode mcp get zennotes # → command: zn, args: [mcp]
Then inside a Command Code session run /mcp, pick zennotes and connect. Now the assistant can work with your whole vault:
- “Create a note in my ZenNotes vault about X”
- “Summarize my notes tagged #graphics”
- “What tasks are open?”
- “Move the meeting notes to archive”
The Windows 11 gotchas
Two things tripped me up on this machine:
zn not found. The shim lives in C:\Users\<you>\.local\bin, which needs to be on your PATH. If the app gets reinstalled somewhere else, just reinstall the CLI from Settings → CLI and it will regenerate the shim.
cmd is not Command Code in PowerShell. The npm cmd package shadows cmd.exe in PowerShell on this machine, so use commandcode explicitly:
commandcode mcp list
And one conceptual trap: ZenNotes MCP is stdio, not HTTP. There is a self-hosted Go server on :7878 for the web app, but that is not an MCP endpoint.
Real workflows
With the connection live, the vault is scriptable end to end:
zn capture "Call dentist re: appointment" --tag errands
zn task list --unchecked
zn list --json | jq '.[].path'
In CI or headless environments, ZENNOTES_VAULT plus --json makes everything automatable. You can even verify the server on its own with zn mcp. It just starts and waits for a client, hit Ctrl+C to stop.
My notes are not a walled garden anymore. My editor can actually reach them now.