TriliumNext MCP (triliumnext-mcp)
Use the triliumnext-mcp MCP tools as the primary interface for exploring, reading, creating, editing, linking, and organizing notes in TriliumNext.
Core Workflows
- Explore before writing: Call
search_notes(passcontent_preview_chars: 250to inspect candidates without N+1get_notecalls) andget_note_treeto resolve parent note IDs before creating or moving notes. - Read & page large notes: Call
get_notewithcontent_start/content_max_charsfor paginated reads,include_path: truefor breadcrumb locations, andinclude_backlinks: truefor inbound references. - Edit notes cleanly: Use
write_notewithmode:"metadata","replace","append", or"edit"(changessearch/replace blocks or unifiedpatch). Setformat: "markdown"when writing Markdown totextnotes. Runcreate_revisionbefore risky rewrites. - Internal links: Write
<a href="note:TARGET_ID">text</a>or Markdown[text](note:TARGET_ID)increate_note/write_note— the server resolves real Trilium reference links and rejects unknown IDs. Share the returnedurlwhen done. - Functional notes take two steps: Creating
code,render, or widget notes leaves them inert until attributes are attached withset_attribute(pass names without leading#or~).
Read references/tools-reference.md for all 20 tools, parameter modes, and functional recipes (code, render, widgets).
Gotchas
search_notesstrategy &TRILIUM_BUSY: Defaults tostrategy: "auto"(titles/labels first, falling back to body search only when fewer than 5 results match). Use"full"only when terms appear solely in bodies. OnTRILIUM_BUSY, wait the suggested cooldown (--busy-cooldown, default30s) instead of retrying immediately.- Timestamps only in
mode: "metadata":write_noterejectsdateCreated/utcDateCreated/utcDateModifiedon content writes. Update dates in a separatemode: "metadata"call after content edits (utcDateModifiedrequires Trilium > 0.105). - Multi-parent
organize_note"move": Cloned notes with multiple parents requirefromParentNoteId; the tool fails rather than guessing which placement to remove. Calling"unlink"on a note's last branch deletes the note itself. delete_noteis reversible: Useaction: "delete"to delete andaction: "undelete"(requires at least one undeleted parent) to restore; discover deleted IDs viaget_note_history.- Protected notes:
restore_revisioncannot restore protected notes via ETAPI, andcontent_preview_charsskips binary and protected notes.
Connection Setup
Read references/setup-and-config.md when deploying triliumnext-mcp (stdio vs --transport http), enabling --multi-tenant, setting --public-url, or configuring gateway auth, allowlists, and --allow-local-file-read.


