
TriliumNext (trilium-mcp)
io.github.OVDEN13由 GitHub 帳號 OVDEN13 發布v0.1.5更新於 Oct 24, 2026
Read and write a self-hosted TriliumNext knowledge base over its ETAPI.
概覽
透過 ETAPI 讀寫自架 TriliumNext 知識庫的 MCP 伺服器,讓助理建立、搜尋、搬移與標記筆記。
- 可以做什麼
- 建立筆記,支援在父筆記下批次建立並一次寫入標籤
- 讀取筆記中繼資料、內文,以及依層級取得整棵子樹
- 更新、附加內容、搬移、複製與刪除筆記或分支
- 以 Trilium 查詢語法搜尋知識庫,可限定於某個子樹
- 新增、列出與移除標籤和關聯,作為表格欄位或筆記間連結
- 適用情境
- 適合在自架 TriliumNext 中管理筆記的使用者,讓助理記錄研究資料、決策與閱讀清單,維護以標籤為基礎的表格或看板檢視,並把既有筆記中的片段帶入對話。
- 執行需求
- 需要可透過 HTTP(S) 連線的 TriliumNext 實例,以及在 Trilium 設定中建立的 ETAPI 權杖,透過 TRILIUM_TOKEN 提供。TRILIUM_URL 為必填,可用逗號分隔多個網址做容錯切換。選用 TRILIUM_HTTP_TIMEOUT_SECONDS 與 TRILIUM_MCP_LOG。以本機執行檔或 Docker 映像透過 stdio 執行,無執行階段相依套件。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 TriliumNext (trilium-mcp),將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
trilium-mcp
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.
Why
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:
- Capture stuff into your notes (reading lists, decisions, research dumps).
- Maintain structured "tables" by creating notes-as-rows under a parent and tagging them with labels-as-columns.
- Search your existing KB and feed snippets back into a conversation.
It is intentionally minimal: ten tools, ~600 lines of Go, zero clever abstractions.
Tools
Quick start
1. Run TriliumNext
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).
2. Install trilium-mcp
Pre-built binary (recommended) — grab the right archive from Releases.
From source with Go 1.23+:
With Docker (no Go on host):
3. Configure
Copy .env.example to .env next to the binary:
Or pass the same as real environment variables — the server reads either.
4. Register with your MCP client
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__*.
Usage patterns
"Database" of notes (the killer feature)
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-only log
append_content is non-destructive — handy for daily journals, decision logs, ideation dumps.
Trilium search cheat sheet
#tag— note has labeltag.#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.- Combine with
ancestor_note_idto scope to a subtree.
Full reference: Trilium search docs.
Environment variables
Building from source
Cross-compile (e.g. for macOS from Linux):
Security notes
- The server reads
TRILIUM_TOKENfrom env. Treat it like a password — anyone with it can read and write your entire KB. Keep.envout of git (it is in.gitignore). - The binary speaks only to your configured Trilium URL. It does not phone home, log to disk, or open any listening ports.
- HTTPS works automatically (the binary ships with system CAs when run from the host; the Docker image includes
ca-certificates).
Contributing
PRs welcome. Useful directions:
- Stream large note bodies instead of buffering.
move_note/clone_notetools.- Bulk operations (
add_label_to_many). - ETAPI v2 features as TriliumNext adds them.
- Tests against an ephemeral TriliumNext container.
For substantive changes, please open an issue first to discuss the shape.
License
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.
來源:README.md,提交 a3a3289
工具
0版本歷史
1- v0.1.5最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分