
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 分