MCP

Model Context Protocol allows external chat applications such as Claude Code to have access to the Trilium database.

Built-in MCP

v0.103.0 comes with a built-in MCP server that is not active by default. To activate it, go to Options → AI/LLM and toggle the MCP server option.

Once the MCP is active, simply add the MCP server to your AI assistant. The URL to use is displayed in the Endpoint URL information underneath the MCP toggle.

Only the HTTP transport is supported, the stdio method is not supported. If that is a blocker, consider using a third-party alternative listed below.

The tools exposed to the MCP are the same tools that are supported by the internal chat (see the Note access section). Notes with the #excludeFromLlm label are hidden from both, see Privacy.

Approving tool calls

Trilium does not ask for approval of the calls an external assistant makes; that is left to the assistant's own permission settings. To help it decide, each tool tells the assistant whether it only reads your notes, only adds to them (creating a note, cloning it or appending to it), or can overwrite or remove something (editing, renaming, moving or deleting). An assistant that supports these hints can then run reads on their own and ask before changes, the way Ask before changes does in Trilium's chat.

Authentication

To protect your notes from unauthorized access, the MCP server requires authentication. Generally MCP servers need to support OAuth for authentication, but Trilium uses a simpler mechanism using Bearer tokens.

To configure authentication, first create an ETAPI (REST API) token by going to Options → ETAPI. Then follow the instructions in Options → AI / LLM, by looking at the How to connect an assistant section under MCP.

Third-party alternatives

The following are alternatives to Trilium's built-in MCP feature. Since Trilium's AI implementation is still experimental, its tooling might not be as mature as external tools.