Read and write a self-hosted TriliumNext knowledge base over its ETAPI.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
An MCP server that lets AI agents (Claude Desktop, Claude Code, any MCP-compatible client) read and write a self-hosted TriliumNext knowledge base over its ETAPI.
Single static Go binary. No runtime dependencies. Talks to your local Trilium over HTTP(S) and to the client over stdio.
TriliumNext is a strong personal KB: tree-of-notes with attributes (labels, relations) that double as table columns / board lanes / calendar events. This MCP exposes the right slice of ETAPI so an agent can:
It is intentionally minimal: ten tools, ~600 lines of Go, zero clever abstractions.
| Tool | Purpose |
|---|---|
create_note | Create a note (optionally under a parent, with labels in one shot). |
batch_create_notes | Create many notes in one call β saves per-call schema overhead during restructuring. |
get_note | Fetch note metadata; optionally include body content. |
get_note_subtree | Recursively fetch a note + descendants up to N levels as a nested tree β replaces N+1 get_note calls. |
update_note | Partial update: include only the fields you want to change; omitted fields stay as-is. |
append_content | Append text to the body with a configurable separator. |
delete_note | Delete a note and its subtree. |
batch_delete_notes | Delete many notes; partial failures don't stop the rest. |
move_note | Re-parent a note in two ETAPI calls (vs the old read-recreate-delete dance). |
clone_note | Add the note under an additional parent β Trilium-native multi-parent links. |
delete_branch | Remove one parent-child link without deleting the note (un-clone). |
search_notes | Full-power Trilium search (#label, ~relation, note.title %= "regex", ancestor scoping, etc.). |
add_label | Attach a label (#key=value) β acts as a "column" in collection views. |
add_relation | Attach a relation (~name β noteId) β like a foreign key between notes. |
remove_attribute | Remove a label or relation by its attribute id. |
list_attributes | List all labels and relations on a note. |
If you don't already have one:
Open http://localhost:8092/, finish the setup wizard, then Options β ETAPI β Create new ETAPI token. Copy the token (shown only once).
Pre-built binary (recommended) β grab the right archive from Releases.
From source with Go 1.23+:
With Docker (no Go on host):
Copy .env.example to .env next to the binary:
Or pass the same as real environment variables β the server reads either.
Claude Code (CLI):
Claude Desktop β add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent on your OS:
Restart the client. The ten tools should show up as trilium__*.
Trilium's collection views (Table / Board / Calendar) render any note's children based on shared labels. So a "table" is just a parent note + child notes + a consistent label schema:
An agent populates it like this:
Flip the parent's view to Table (or Board by status, or Calendar by a date label) in the Trilium UI and you have a database without ever leaving notes.
append_content is non-destructive β handy for daily journals, decision logs, ideation dumps.
#tag β note has label tag.#status=active β label equals.#rating>=8 β numeric comparison.~author.title *= "Clear" β follow a relation, match relation target's title.note.title %= "^Re:" β regex on title.note.content *= "kubernetes" β substring in body.#status=active OR #status=pending β boolean.ancestor_note_id to scope to a subtree.Full reference: Trilium search docs.
| Var | Default | Notes |
|---|---|---|
TRILIUM_URL | required | Base URL of your Trilium instance, e.g. http://localhost:8092. The /etapi path is added automatically, but a trailing /etapi is tolerated and stripped (so http://localhost:8092/etapi also works). Accepts multiple URLs separated by commas β the server tries them in order and falls back to the next one on transport errors (DNS/connection/timeout). HTTP errors like 404 are returned immediately without retry. Example: http://192.168.0.10:8092,https://memo.example.com (fast LAN first, public fallback). |
TRILIUM_TOKEN | required | ETAPI token from Trilium settings |
TRILIUM_HTTP_TIMEOUT_SECONDS | 30 | Per-request timeout |
TRILIUM_MCP_LOG | info | off / info / debug. Logs are written to stderr (stdout is reserved for the MCP JSON-RPC stream). info shows one line per tool call with name + duration + ok/error. debug also shows the request arguments and a truncated preview of the response. |
Cross-compile (e.g. for macOS from Linux):
TRILIUM_TOKEN from env. Treat it like a password β anyone with it can read and write your entire KB. Keep .env out of git (it is in .gitignore).ca-certificates).PRs welcome. Useful directions:
move_note / clone_note tools.add_label_to_many).For substantive changes, please open an issue first to discuss the shape.
MIT.
trilium-mcp is an independent project; it is not endorsed by or affiliated with the TriliumNext project. TriliumNext itself is AGPL-3.0; this MCP server talks to it only over its public ETAPI.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/triliumnext-trilium-mcp)<a href="https://allmcps.com/mcp/triliumnext-trilium-mcp"><img src="https://allmcps.com/api/badge/triliumnext-trilium-mcp?style=directory" alt="TriliumNext (trilium Mcp) on AllMCPs" /></a>