TriliumNext MCP Server

MCP server for TriliumNext notes over ETAPI: 20 tools to read, write, search, attach files, restore revisions and back up

  • 70 ★ on the repository
  • Last commit
MCP server

Broad access

Why this level

  • The ETAPI token lets the assistant read, edit and delete all notes, and the backup, export and import actions work on the whole database
  • In stdio mode attachments are read from local paths, and in HTTP mode without a gateway token the server is open to anyone who can reach it
All reasons and checks

perfectra1n/triliumnext-mcp

Install

Manual install

claude mcp add trilium node /path/to/triliumnext-mcp/dist/index.js --scope user -e TRILIUM_TOKEN=<your_etapi_token> -e TRILIUM_URL=<your_trilium_url>/etapi

First git clone, npm install and npm run build. The ETAPI token is created in TriliumNext.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • The ETAPI token lets the assistant read, edit and delete all notes, and the backup, export and import actions work on the whole database
  • In stdio mode attachments are read from local paths, and in HTTP mode without a gateway token the server is open to anyone who can reach it

This is third-party code. Review the repository files before installing.

What it does

TriliumNext MCP Server connects an AI assistant to your TriliumNext instance through ETAPI, its programmatic interface. Twenty tools fall into eight groups: notes, search, tree organization, attributes and labels, journal and calendar, attachments, revisions and system operations. The assistant reads a note together with its breadcrumbs and backlinks, creates and edits it in four modes (metadata, replace, append, edit by search or diff) and writes Markdown while the server stores HTML. Images and files are embedded in a note in the same call, from base64, a data: URL, a local path or a web address. The server turns note:abc123 links into real Trilium links and rejects ones that point to a missing note. When a search finds nothing, it retries the query as an OR over single words and shows which word matched nothing. Before restoring a revision the server snapshots the current state, so a restore can be undone. Beyond stdio the server runs over HTTP/SSE and StreamableHTTP. In multi-tenant mode every client brings its own Trilium URL and ETAPI token, and the gateway is protected by a token, JWT or OIDC. Rate limiting and Prometheus metrics are included.

Who it is for. Users of TriliumNext who keep notes and a knowledge base in Trilium and want an agent to read, search and edit them, and teams that run one server for many users.

Good fit when

  • The agent has to find notes on a topic and summarize them, and a typo in the query made Trilium return nothing
  • Meeting results must be appended to a note with screenshots from a local folder embedded in one call
  • A note is edited piece by piece with search and replace or a unified diff, without overwriting the whole text
  • An edit went wrong and the note has to be rolled back to a revision while keeping the current state
  • One server runs in Docker for several people, each with their own ETAPI token

Not a fit when

  • You use Obsidian or Joplin: the server works with TriliumNext only, and those apps have their own servers
  • You need offline work without a running Trilium: every call goes through the ETAPI of a live instance
  • The server would be exposed without a gateway token: notes and the backup and import functions would be open to everyone
  • The agent must not be trusted with deletion: delete_note and the unlink and import actions change the note tree

Example request

Find the notes about release 2.0 in Trilium, extend the summary note with a list of the meeting decisions and embed the screenshot ~/Desktop/board.png

MCP

Transport
stdio, http, sse
Authentication
API key

Environment variables

TRILIUM_TOKEN required, secret
ETAPI token from the TriliumNext settings
TRILIUM_URL required
ETAPI address, defaults to http://localhost:37740/etapi

Limitations

  • A running TriliumNext with ETAPI enabled and a token is required. The default address is http://localhost:37740/etapi.
  • Installation is from source: git clone, npm install and npm run build. The instructions mention no ready npm package.
  • Search ranks by titles and attributes: a note matched only by its body is returned but scores zero and lands at the end of the results.
  • The default limit for an SSE request body is 500 MB.
  • The MIT license is named in the README, but the repository has no LICENSE file.
  • In stdio mode reading local files for attachments is on by default, in HTTP mode it is off.

How to disable. claude mcp remove trilium deletes the entry from Claude Code. The ETAPI token can be revoked inside TriliumNext, after which the server fails authorization. The build folder is deleted by hand.

FAQ

How do I get an ETAPI token for the server?

The token is created inside TriliumNext: Options, the ETAPI section, a new token. It goes in through the TRILIUM_TOKEN variable or the --token option.

How do I connect the server to Claude Code?

Run claude mcp add trilium node /path/to/dist/index.js --scope user with the TRILIUM_TOKEN and TRILIUM_URL variables. The server then shows up in every repository.

Why did search return notes despite a typo in the query?

If a query of two or more words returns zero results, the server retries it as an OR over single words. The response counts which word appeared in no title or attribute.

Can a bad edit be undone?

Yes. The restore_revision tool returns a note to the chosen revision and first snapshots the current state, so the restore itself can be undone too.

Can one server serve several people?

Yes, in multi-tenant mode each client sends its own Trilium URL and ETAPI token. The gateway is protected by a shared token or JWT and OIDC, and a Docker Compose file is provided for deployment.

Discussion

No questions or reviews yet.

Official

The official Kibela MCP server searches, reads and edits notes, folders and comments of your wiki straight from an assistant chat

MCP serverExtended access16Repository stars

tracker-mcp

traker-mcp

Russian stack

A Yandex Tracker MCP server with 187 tools and a skill: issues, queues, boards, sprints and automation over API v3, with a read-only mode

MCP serverBroad access1Repository stars

Trello MCP server with 57 tools: cards, lists, checklists, attachments, comments, custom fields and workspaces, plus acceptance-criteria extraction

MCP serverBroad access447Repository stars

Notion MCP (awkoy)

Notion MCP Server (awkoy)

Notion MCP on a token: an agent searches pages, runs databases, edits blocks and comments through three tools and 47 operations, with no manual sign-in

MCP serverBroad access180Repository stars

The noteriv-mcp server opens a Noteriv vault to agents: reading, writing, search, tags, backlinks and daily notes, all locally.

MCP serverExtended access115Repository stars

Connects an agent to Nextcloud: notes, calendar, contacts, files, mail and Deck boards through more than 110 MCP tools

MCP serverBroad access412Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
TriliumNext MCP Server (this card)noAPI key70
Joplin MCPnoAPI key174notes in Joplin, a different app with its own API
Obsidian MCPnonot required751an Obsidian vault of Markdown files, while Trilium has its own database and ETAPI

README in short

The README opens with a table of contents and a feature list: 20 tools, note links, revision restore and three transports. Next come installation and configuration through arguments, environment variables and a file, then logging and metrics. Tables describe every tool by group, separate sections explain embedding images and files, and a large block covers multi-tenant deployment with gateway authentication.

README badge

Report a problem