MCP TriliumNext

Provides an MCP server to control and query TriliumNext notes via create, read, update, search, and recent-note access.
  • javascript

0

GitHub Stars

javascript

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "radonx-mcp-trilium": {
      "command": "node",
      "args": [
        "/path/to/mcp-trilium/src/index.js"
      ],
      "env": {
        "LOG_LEVEL": "info",
        "TRILIUM_URL": "http://localhost:8080",
        "REQUEST_TIMEOUT": "30000",
        "TRILIUM_AUTH_TOKEN": "YOUR_ETAPI_TOKEN"
      }
    }
  }
}

You can run a dedicated MCP server that lets AI assistants interact with your TriliumNext notes. This server supports creating, reading, updating, and searching notes, plus quick access to recently modified notes, all through a standardized MCP interface.

How to use

Use an MCP client to connect to the TriliumNext MCP server. You will be able to create notes, search your notes with powerful queries, retrieve full note details, update note content, and access a list of recently modified notes as a resource. You interact with the server by invoking tools like create_note, search_notes, get_note, and update_note through your MCP client. Provide the necessary arguments (such as note title, content, and identifiers) exactly as your client expects, and the server will perform the requested actions against your TriliumNext data.

How to install

Prerequisites you need before installing include Node.js 18.0.0 or higher and a running TriliumNext instance with ETAPI access. You will also need an ETAPI token from your TriliumNext setup.

Step 1 — Clone the MCP server repository and install dependencies:

git clone git@github.com:RadonX/mcp-trilium.git
cd mcp-trilium
npm install

Step 2 — Configure environment variables for the MCP server. Create a file named .env with these values (adjust as needed):

TRILIUM_URL=http://localhost:8080
TRILIUM_AUTH_TOKEN=your_etapi_token_here
REQUEST_TIMEOUT=30000
LOG_LEVEL=info

Step 3 — Obtain your ETAPI token from TriliumNext: open the TriliumNext web interface, navigate to Options → ETAPI, create a new token or use an existing one, and copy it into your .env file.

Step 4 — Test connectivity to ensure the MCP server can reach TriliumNext with the provided token:

npm run test-connectivity

Additional configuration and usage notes

HTTP vs stdio MCP configurations can be used together if your setup includes both a remote MCP endpoint and a local runtime. The provided setup focuses on running the MCP server locally via Node, which you can connect to from your MCP clients.

Configuration and examples

The server exposes a set of commands (tools) you can call from an MCP client. These tools operate against your TriliumNext data and preserve structured data for AI consumption. Key endpoints and tokens are shown in the startup configuration you run in your environment.

Example commands you’ll use through your MCP client include creating, searching, retrieving, and updating notes, as well as accessing the 10 most recently modified notes as a resource.

Security and best practices

Keep your ETAPI token secure. Do not expose the token in client-side code or in publicly accessible configurations. Use environment variable management and rotate tokens periodically. If you suspect token leakage, revoke the token and generate a new one in TriliumNext Options → ETAPI.

Troubleshooting

Authentication failed or you receive a 401/403 when calling ETAPI endpoints. Verify that TRILIUM_AUTH_TOKEN in your environment matches the token created in TriliumNext. Ensure the TriliumNext ETAPI endpoint is reachable at TRILIUM_URL and that the ETAPI feature is enabled in TriliumNext settings.

Connection refused or timeouts. Check that TriliumNext is running and accessible at the URL you configured. Review REQUEST_TIMEOUT in your environment to ensure it’s sufficient for your network latency.

Developer notes

Project structure and where to look when you extend the server: the main server entry is src/index.js, with tool implementations in src/tools and resource implementations in src/resources. Shared utilities live under src/utils.

Standalone usage

You can start the MCP server directly after dependencies are installed. The standard startup command is provided as part of your runtime environment setup.

Available tools

create_note

Create a new note with a title, content, and type. Returns the created note details.

search_notes

Search notes using full-text or structured queries and return matching notes.

get_note

Retrieve complete details and content for a specific note by ID.

update_note

Update the content of an existing note by its ID.

recent-notes

Provide access to the 10 most recently modified notes as a resource.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
MCP TriliumNext MCP Server - radonx/mcp-trilium | VeilStrat