Skip to main content
Glama

用于 Gemini CLI 的 Trilium MCP 服务器

本项目提供了一个模型上下文协议 (MCP) 服务器、一个专门的 Gemini 技能以及一个自主代理,用于使用 Gemini CLI 直接从终端管理 Trilium Notes

功能特性

  • 完整的 ETAPI 集成:使用自然语言创建、搜索、移动和编辑笔记。

  • 自主代理:一个专门的 trilium-assistant 代理,用于处理复杂的组织任务。

  • 专业技能:关于 Trilium 笔记树结构和属性的专家指导。

  • 安全:使用 .env 文件保护您的 API 令牌。


Related MCP server: Notes MCP Server

🛠️ 设置与安装

1. 前置要求

  • Python 3.10+

  • Node.js (用于 Gemini CLI)

  • Trilium Notes (已启用 ETAPI)

2. 克隆仓库

git clone https://github.com/dhiraj-ydv/trilium-mcp.git
cd trilium-mcp

3. 安装依赖

pip install -r requirements.txt

4. 配置环境变量

复制示例环境变量文件并填写您的 Trilium 详细信息:

cp .env.example .env

打开 .env 并提供:

  • TRILIUM_SERVER_URL:您的 Trilium 实例 URL(例如 http://localhost:8080)。

  • TRILIUM_ETAPI_TOKEN:您的 ETAPI 令牌(在 Trilium 设置 > 选项 > ETAPI 中生成)。


🚀 与 Gemini CLI 配合使用

初始化

只需在项目目录中运行 gemini。CLI 将自动发现 .gemini/ 文件夹中定义的 MCP 服务器、代理和技能。

命令

使用自主代理

该代理可以处理多步骤任务,例如查找笔记并将其移动:

@trilium-assistant move my 'Drafts' note into the 'Projects' folder.

使用直接 MCP 工具

直接执行精确操作:

mcp_trilium-mcp_create_note title="Meeting Notes" parentNoteId="root" content="Hello World"

激活技能

获取关于如何构建笔记结构的专家建议:

activate_skill trilium-notes


📂 项目结构

  • server.py:MCP 服务器实现。

  • .gemini/settings.json:Gemini CLI 加载服务器的配置。

  • .gemini/agents/trilium-assistant.md:自主代理定义。

  • .gemini/skills/trilium-notes/:Trilium 工作流的专业知识。

🛡️ 安全性

本项目使用 .gitignore 来确保您的 .env 文件永远不会被推送到 GitHub。切勿分享您的 .env 文件或 ETAPI 令牌。

📄 许可证

MIT

F
license - not found
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.

  • Run AI customer support from your terminal: conversations, knowledge base, and chat widget.

  • Cross-session, cross-device memory for your agent: remember and recall notes. No key to start.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dhiraj-ydv/trilium-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server