PT

perfectra1n/triliumnext-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

71 stars 10 forks 质量 73 趋势 20

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

  • 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_note can return tree breadcrumbs (include_path) and backlinks (include_backlinks); search_notes can attach plain-text content previews (content_preview_chars)
  • Revision restore — restore_revision rolls 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_TIMEOUT errors
  • MCP tool annotations (readOnlyHint, destructiveHint, idempotentHint, title) on every tool for better approval-dialog UX in clients that surface them
在 GitHub 查看完整 README

安装

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
新手?先看 mcpskill.org 教程 →

配置

{ "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" ] } } }