trilium-notes-mcp
v0.4.3
Published
MCP server for Trilium Notes via ETAPI
Downloads
1,153
Readme
trilium-notes-mcp
MCP server that gives Claude access to Trilium Notes via its REST API (ETAPI).
Requirements
- Node.js ≥ 18
- A running Trilium / TriliumNext instance with ETAPI enabled
- An ETAPI token (Settings → ETAPI in Trilium)
Installation
No install needed — run directly with npx:
claude mcp add --scope user trilium \
--env TRILIUM_URL=https://your-trilium-domain.example.com \
--env TRILIUM_TOKEN=your-etapi-token \
-- npx -y trilium-notes-mcp@latestOr add to your project's .mcp.json:
{
"mcpServers": {
"trilium": {
"command": "npx",
"args": ["-y", "trilium-notes-mcp@latest"],
"env": {
"TRILIUM_URL": "https://your-trilium-domain.example.com",
"TRILIUM_TOKEN": "your-etapi-token"
}
}
}
}Verify registration:
claude mcp listEnvironment variables
| Variable | Required | Description |
|---|---|---|
| TRILIUM_URL | ✅ | Base URL of your Trilium instance, e.g. https://notes.example.com |
| TRILIUM_TOKEN | ✅ | ETAPI token from Trilium Settings → ETAPI |
Available tools
Reading & searching
| Tool | Description |
|---|---|
| trilium_search_notes | Search by text or Trilium query syntax (#label, note.type = code, …) |
| trilium_get_note | Fetch full metadata + content of a note by ID |
| trilium_get_note_tree | List direct children of a note, one level deep (max 50) |
| trilium_get_note_subtree | Recursively traverse a note and its descendants (configurable depth, max 5) |
| trilium_get_note_path | Get the full ancestor path from root down to a note |
| trilium_get_app_info | Get Trilium server version and build information |
Writing & editing
| Tool | Description |
|---|---|
| trilium_create_note | Create a new note under a given parent |
| trilium_update_note | Rename a note or change its type / MIME type |
| trilium_update_note_content | Replace the full content of a note |
| trilium_append_to_note | Append text to the end of a note (great for journals) |
| trilium_delete_note | Permanently delete a note and all its children |
| trilium_move_note | Move or clone a note to a different parent |
Attributes
| Tool | Description |
|---|---|
| trilium_get_attributes | List all labels and relations of a note |
| trilium_set_attribute | Add or update a label / relation on a note (upsert by type + name) |
| trilium_delete_attribute | Remove a label or relation by its attribute ID |
Journal / Calendar
| Tool | Description |
|---|---|
| trilium_get_day_note | Get or auto-create Trilium's built-in day note for a date |
| trilium_get_week_note | Get Trilium's built-in week note for a date's week |
| trilium_get_inbox_note | Get Trilium's inbox note for a date |
Development
npm run dev # watch mode — recompiles on change
npm run lint # ESLint
npm run format # Prettier
npm test # Vitest unit testsHow ETAPI auth works
Every request includes the header Authorization: <token>. No "Bearer" prefix. The token is the ETAPI token generated in Trilium settings.
Known limitations
trilium_update_note_contentandtrilium_append_to_noteperform a read-then-write; concurrent edits on the same note from multiple clients may overwrite each other.trilium_get_note_treeis capped at 50 children;trilium_get_note_subtreeat 100 total nodes and 20 children per node.trilium_move_noterequires abranchIdto remove from the old location; omitting it clones the note instead.- Binary notes (images, files) return a
<binary content, N bytes>placeholder instead of raw bytes. - Protected notes are not supported (Trilium requires a session password for those).
