Skip to main content
Glama
Trilium MCP Server
by dhirajhq

Trilium MCP Server for Gemini CLI

This project provides a Model Context Protocol (MCP) server, a specialized Gemini Skill, and an autonomous Agent for managing Trilium Notes directly from your terminal using the Gemini CLI.

Features

  • Full ETAPI Integration: Create, search, move, and edit notes using natural language.

  • Autonomous Agent: A dedicated trilium-assistant agent for complex organizational tasks.

  • Specialized Skill: Expert guidance on Trilium's note tree structure and attributes.

  • Secure: Uses a .env file to protect your API tokens.


Related MCP server: Trilium MCP Server

πŸ› οΈ Setup & Installation

1. Prerequisites

  • Python 3.10+

  • Node.js (for Gemini CLI)

  • Trilium Notes (with ETAPI enabled)

2. Clone the Repository

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

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Copy the example environment file and fill in your Trilium details:

cp .env.example .env

Open .env and provide:

  • TRILIUM_SERVER_URL: Your Trilium instance URL (e.g., http://localhost:8080).

  • TRILIUM_ETAPI_TOKEN: Your ETAPI token (generated in Trilium Settings > Options > ETAPI).


πŸš€ Usage with Gemini CLI

Initialization

Simply run gemini inside the project directory. The CLI will automatically discover the MCP server, Agent, and Skill defined in the .gemini/ folder.

Commands

Using the Autonomous Agent

The agent can handle multi-step tasks like finding a note and moving it:

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

Using Direct MCP Tools

Perform surgical actions directly:

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

Activating the Skill

Get expert advice on how to structure your notes:

activate_skill trilium-notes


πŸ“‚ Project Structure

  • server.py: The MCP server implementation.

  • .gemini/settings.json: Configuration for the Gemini CLI to load the server.

  • .gemini/agents/trilium-assistant.md: The autonomous agent definition.

  • .gemini/skills/trilium-notes/: Specialized knowledge for Trilium workflows.

πŸ›‘οΈ Security

This project uses a .gitignore to ensure your .env file is never pushed to GitHub. Never share your .env file or ETAPI token.

πŸ“„ License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Brings your Trilium Notes knowledge base into Claude Desktop, enabling full-text search, note management, and content interaction through natural language.
      7
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI clients to manage Trilium Notes with full CRUD operations, search, calendar integration, and system administration through the Model Context Protocol.
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables searching and reading authorized Notesnook notes, inspecting text and attached images, and previewing and applying edits such as titles, tags, notebook membership and rich text, with plan/conflict checks and recovery previews. It runs locally over stdio using a separate encrypted profile that is authenticated and synced through Notesnook's official services.
      GPL 3.0