# TriliumNext (trilium-mcp)

Lets an agent read and write your TriliumNext knowledge base over ETAPI. Useful when your notes live in Trilium and you want to file things there from a chat.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: OVDEN13
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/OVDEN13/trilium-mcp
- Updated: 2026-06-20
- HTML: https://affpapa.org/en/nevibecode/mcp/triliumnext-trilium-mcp

## What it does

The server ships as a single static Go binary with no runtime dependencies. It speaks stdio to the client and HTTP or HTTPS to Trilium. The toolset covers note creation one at a time or in bulk, fetching metadata and whole subtrees, partial updates, appending text to a body, deletion, re-parenting, cloning and branch removal. Search and attribute handling sit alongside: labels, relations, listing them, dropping one by id.

You need a running TriliumNext instance plus an ETAPI token, which the settings page shows once. Connection details go into `TRILIUM_URL` and `TRILIUM_TOKEN`; `TRILIUM_HTTP_TIMEOUT_SECONDS` caps each request and `TRILIUM_MCP_LOG` sets log verbosity. `TRILIUM_URL` accepts a comma-separated list — the server walks it in order and moves on when a transport error hits, while an HTTP error such as 404 comes back right away.

Logs go to stderr because stdout carries the JSON-RPC stream. Running it in Docker means passing the environment variables into the container; without them the server has nothing to connect to.

## Requirements
- Needs: Docker
- Environment variables: `TRILIUM_URL`, `TRILIUM_TOKEN`, `TRILIUM_HTTP_TIMEOUT_SECONDS`, `TRILIUM_MCP_LOG` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env TRILIUM_URL=<TRILIUM_URL> --env TRILIUM_TOKEN=<TRILIUM_TOKEN> --env TRILIUM_HTTP_TIMEOUT_SECONDS=<TRILIUM_HTTP_TIMEOUT_SECONDS> --env TRILIUM_MCP_LOG=<TRILIUM_MCP_LOG> --transport stdio triliumnext-trilium-mcp -- docker run -i --rm -e TRILIUM_URL -e TRILIUM_TOKEN -e TRILIUM_HTTP_TIMEOUT_SECONDS -e TRILIUM_MCP_LOG ghcr.io/ovden13/trilium-mcp:0.1.5
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add triliumnext-trilium-mcp --env TRILIUM_URL=<TRILIUM_URL> --env TRILIUM_TOKEN=<TRILIUM_TOKEN> --env TRILIUM_HTTP_TIMEOUT_SECONDS=<TRILIUM_HTTP_TIMEOUT_SECONDS> --env TRILIUM_MCP_LOG=<TRILIUM_MCP_LOG> -- docker run -i --rm -e TRILIUM_URL -e TRILIUM_TOKEN -e TRILIUM_HTTP_TIMEOUT_SECONDS -e TRILIUM_MCP_LOG ghcr.io/ovden13/trilium-mcp:0.1.5
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "triliumnext-trilium-mcp": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "TRILIUM_URL",
                "-e",
                "TRILIUM_TOKEN",
                "-e",
                "TRILIUM_HTTP_TIMEOUT_SECONDS",
                "-e",
                "TRILIUM_MCP_LOG",
                "ghcr.io/ovden13/trilium-mcp:0.1.5"
            ],
            "env": {
                "TRILIUM_URL": "<TRILIUM_URL>",
                "TRILIUM_TOKEN": "<TRILIUM_TOKEN>",
                "TRILIUM_HTTP_TIMEOUT_SECONDS": "<TRILIUM_HTTP_TIMEOUT_SECONDS>",
                "TRILIUM_MCP_LOG": "<TRILIUM_MCP_LOG>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "triliumnext-trilium-mcp": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "TRILIUM_URL",
                "-e",
                "TRILIUM_TOKEN",
                "-e",
                "TRILIUM_HTTP_TIMEOUT_SECONDS",
                "-e",
                "TRILIUM_MCP_LOG",
                "ghcr.io/ovden13/trilium-mcp:0.1.5"
            ],
            "env": {
                "TRILIUM_URL": "<TRILIUM_URL>",
                "TRILIUM_TOKEN": "<TRILIUM_TOKEN>",
                "TRILIUM_HTTP_TIMEOUT_SECONDS": "<TRILIUM_HTTP_TIMEOUT_SECONDS>",
                "TRILIUM_MCP_LOG": "<TRILIUM_MCP_LOG>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e TRILIUM_URL=<TRILIUM_URL> -e TRILIUM_TOKEN=<TRILIUM_TOKEN> -e TRILIUM_HTTP_TIMEOUT_SECONDS=<TRILIUM_HTTP_TIMEOUT_SECONDS> -e TRILIUM_MCP_LOG=<TRILIUM_MCP_LOG> triliumnext-trilium-mcp docker run -i --rm -e TRILIUM_URL -e TRILIUM_TOKEN -e TRILIUM_HTTP_TIMEOUT_SECONDS -e TRILIUM_MCP_LOG ghcr.io/ovden13/trilium-mcp:0.1.5
```
Replace <…> with your own values

## When to use it
- file links and notes into Trilium without leaving the agent chat
- build a table out of note rows tagged with labels as columns
- find entries by label, relation or a title regex
- append a line to a decision log and leave the rest untouched
- move or duplicate a note under a second parent

## Example prompts
- Create a note titled Atomic Habits under the Books node with labels status=read, rating=9, author=Clear
- Search the Books subtree for notes tagged #status=read and #rating>=8
- Append a line to the journal note: shipping v0.2 on Monday

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
