You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
zn mcp: expose asset operations (upload/rename/move/delete) as tools — the server API already implements them #34
zn mcp currently exposes only a read-only list_assets tool, while the znserver HTTP API already implements a full asset mutation family (upload, rename, move, duplicate, delete, restore, purge). Assistants connected over MCP therefore cannot manage attachments at all, even though desktop and web clients can.
What I measured
zn mcp v0.15.0 tools/list returns 34 tools; the only asset tool is:
list_assets — "List files under the vault's attachments directory (images, PDFs, audio, video, other binaries)". No parameters, read-only.
Same result on 0.8.0, so this isn't a recent regression — the mutation tools have never existed.
Meanwhile znserver (internal/httpserver/server.go, verified against self-hosted 2.80.1) routes:
GET /api/assets
GET /api/assets/exists
GET /api/assets/raw
POST /api/assets/upload (multipart: file, optional notePath)
POST /api/assets/rename
POST /api/assets/move
POST /api/assets/duplicate
POST /api/assets/delete (soft delete, returns undoToken)
GET /api/assets/deleted
POST /api/assets/restore
POST /api/assets/purge
POST /api/assets/empty-deleted
I verified upload/read-back/delete/restore against a live 2.80.1 server. Upload already returns exactly what an assistant needs next:
MCP is the primary integration surface for coding assistants and agents. They routinely need to attach generated plots, diagrams, PDFs, or audio to notes. Today the only programmatic path is direct filesystem access to the vault directory, which remote MCP clients (cloud-hosted agents talking to a znserver over the network) don't have — the HTTP API above is their only channel, and zn mcp doesn't proxy it.
delete_asset({path}) / restore_asset({...}) (soft delete + undo, mirroring the API)
optionally read_asset({path}) for small assets
Since 2.80 added path-level ACL flags to zn mcp (--allow-path, --read-only, …), the mutation tools could respect the same flags so read-only setups stay read-only.
Happy to provide more traces if useful — and thanks for the great tool.
Thanks @Asterythm for the clear report and the traces. zn mcp can now manage attachments, merged in 06ca624 and shipping in the next zn release.
New tools: upload_asset, read_asset, rename_asset, move_asset, duplicate_asset, delete_asset and restore_asset, and list_assets with deleted: true shows what can be restored. Upload returns the path and embed you asked for, up to 16 MiB. Renames and moves update the notes that link to the file.
A few choices worth knowing. Deletes are soft, and permanent deletion isn't exposed, so it stays in the app. The tools honor --allow-path, --deny-path, --read-only and --access. A client limited by paths on a server can list, upload, delete and restore, but can't read, copy, rename or move files. upload_asset needs the assets folder shared. notePath isn't included, because the server ignores it; paste the returned markdown into the note instead.
The desktop app's bundled MCP server doesn't have these tools yet.
Activity
adibhanna commentedon Nov 4, 2026
Thanks @Asterythm for the clear report and the traces.
zn mcpcan now manage attachments, merged in 06ca624 and shipping in the next zn release.New tools:
upload_asset,read_asset,rename_asset,move_asset,duplicate_asset,delete_assetandrestore_asset, andlist_assetswithdeleted: trueshows what can be restored. Upload returns the path and embed you asked for, up to 16 MiB. Renames and moves update the notes that link to the file.A few choices worth knowing. Deletes are soft, and permanent deletion isn't exposed, so it stays in the app. The tools honor
--allow-path,--deny-path,--read-onlyand--access. A client limited by paths on a server can list, upload, delete and restore, but can't read, copy, rename or move files.upload_assetneeds theassetsfolder shared.notePathisn't included, because the server ignores it; paste the returnedmarkdowninto the note instead.The desktop app's bundled MCP server doesn't have these tools yet.
Feat(mcp): attachments, task edits, daily notes and note sections as …