PT 

perfectra1n/triliumnext-mcp 是从 https://github.com/perfectra1n/triliumnext-mcp. 导入的 MCP 服务器候选
概览
perfectra1n/triliumnext-mcp 是从 https://github.com/perfectra1n/triliumnext-mcp. 导入的 MCP 服务器候选
概述(AI 翻译)
一个模型上下文协议(MCP)服务器,用于通过 TriliumNext 的 ETAPI 交互。使大型语言模型能够创建、读取、更新和组织笔记——包括将图像和文件直接嵌入笔记内容中。
目录
- 特色
- 安装
- Configuration — CLI、env vars、config file
- 日志——记录了哪些内容,数据去向,如何调整
- 度量 — Prometheus
/metrics端点、认证模式、公开系列 - 可用工具
- 嵌入图像和文件
- 多租户HTTP部署——为多个用户运行一台服务器
- 建筑学
- 快速启动(Docker)/(本地)
- HTTP 端点 ·错误响应 ·请求体大小限制
- 连接客户端 — Claude Desktop、Claude Code、SDK
- JWT / OIDC 网关认证 ·CORS ·速率限制
- StreamableHTTP 传输——与
/sse并列的较新的 MCP 传输 - 每租户审计+指标
- SSRF配置 ·反向代理
- 安全模型 ·故障排除
- 使用 MCP Inspector 进行调试
- 开发 — 构建、测试、Docker
- 获取ETAPI令牌
特色
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
TriliumNext MCP Server
A Model Context Protocol (MCP) server for interacting with TriliumNext via its ETAPI. Enables LLMs to create, read, update, and organize notes — including embedding images and files directly into note content.
Contents
- Features
- Installation
- Configuration — CLI, env vars, config file · Limits and tuning
- Logging — what gets logged, where it goes, how to tune it
- Metrics — Prometheus
/metricsendpoint, auth modes, exposed series - Available Tools
- Embedding Images and Files
- Multi-tenant HTTP deployment — run one server for many users
- Architecture
- Quick start (Docker) / (local)
- HTTP endpoints · Error responses · Request body size limits
- Connecting clients — Claude Desktop, Claude Code, SDK
- JWT / OIDC gateway auth · CORS · Rate limiting · Host header check
- StreamableHTTP transport — newer MCP transport alongside
/sse - Per-tenant audit + metrics
- SSRF configuration · Reverse-proxy
- Security model · Troubleshooting
- Debugging with MCP Inspector
- Development — build, test, docker
- Getting an ETAPI Token
Features
- 20 tools across 8 categories for full note management, search, organization, attachments, revisions, and system operations (consolidated from 35 in v1 — see Migrating from v1)
- Server-built note links — write `` or
[text](note:abc123)and the server emits a proper Trilium reference link (path,class,data-note-path), rejecting links to notes that don’t exist - Note context on demand —
get_notecan return tree breadcrumbs (include_path) and backlinks (include_backlinks);search_notescan attach plain-text content previews (content_preview_chars) - Revision restore —
restore_revisionrolls a note back, snapshotting the current state first so the restore is reversible - Resilient ETAPI client — per-request timeouts, automatic retry of idempotent requests on network errors and 502/503/504, and clear
TRILIUM_UNREACHABLE/TRILIUM_TIMEOUTerrors - MCP tool annotations (
readOnlyHint,destructiveHint,idempotentHint,title) on every tool for better approval-dialog UX in clients that surface them
安装
npx -y mcp-remote https://mcp.example.com/sse --header Authorization: Bearer YOUR_GATEWAY_TOKEN --header X-Trilium-Url: https://notes.example.com --header X-Trilium-Token: YOUR_ETAPI_TOKEN配置
{
"mcpServers": {
"trilium": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.example.com/sse",
"--header", "Authorization: Bearer YOUR_GATEWAY_TOKEN",
"--header", "X-Trilium-Url: https://notes.example.com",
"--header", "X-Trilium-Token: YOUR_ETAPI_TOKEN"
]
}
}
}