trilium-mcp

by ovden13

Not rated
GitHub

About

Read and write a self-hosted TriliumNext knowledge base over its ETAPI. Ten tools: create/get/update/append/delete notes, full search, labels and relations.

Details

Author
ovden13
Categories
AI, Knowledge Base, Other, Database, API

Setup

Install trilium-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/ovden13/trilium-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

AnMCPserver that lets AI agents (Claude Desktop, Claude Code, any MCP-compatible client) read and write a self-hostedTriliumNextknowledge base over itsETAPI.

Single static Go binary. No runtime dependencies. Talks to your local Trilium over HTTP(S) and to the client over stdio.

TriliumNext is a strong personal KB: tree-of-notes with attributes (labels, relations) that double as table columns / board lanes / calendar events. This MCP exposes the right slice of ETAPI so an agent can:

- Capture stuff into your notes (reading lists, decisions, research dumps).
- Maintain structured "tables" by creating notes-as-rows under a parent and tagging them with labels-as-columns.
- Search your existing KB and feed snippets back into a conversation.

It is intentionally minimal: ten tools, ~600 lines of Go, zero clever abstractions.

# docker-compose.yml services: trilium: image: triliumnext/notes:latest ports: - "8092:8080" volumes: - ./data:/home/node/trilium-data

Openhttp://localhost:8092/, finish the setup wizard, thenOptions → ETAPI → Create new ETAPI token. Copy the token (shown only once).

Pre-built binary(recommended) — grab the right archive fromReleases.

go install github.com/OVDEN13/trilium-mcp@latest
git clone https://github.com/OVDEN13/trilium-mcp && cd trilium-mcp docker build -t trilium-mcp .

Copy.env.exampleto.envnext to the binary:

TRILIUM_URL=http://localhost:8092 TRILIUM_TOKEN=your-etapi-token-here # Optional: # TRILIUM_HTTP_TIMEOUT_SECONDS=30

Or pass the same as real environment variables — the server reads either.

claude mcp add --scope user trilium /path/to/trilium-mcp \ --env TRILIUM_URL=http://localhost:8092 \ --env TRILIUM_TOKEN=your-token

Claude Desktop— add to~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or the equivalent on your OS:

{ "mcpServers": { "trilium": { "command": "/absolute/path/to/trilium-mcp", "env": { "TRILIUM_URL": "http://localhost:8092", "TRILIUM_TOKEN": "your-token" } } } }

Restart the client. The ten tools should show up astrilium__.

"Database" of notes (the killer feature)

Trilium's collection views (Table / Board / Calendar) render any note's children based on shared labels. So a "table" is just a parent note + child notes + a consistent label schema:

Books (parent) ├── "Atomic Habits" #status=read #rating=9 #author=Clear ├── "Antifragile" #status=read #rating=8 #author=Taleb └── "Деньги" #status=reading #author=Жонсон
// 1. Create the row create_note({ parent_note_id: "<id of Books>", title: "Atomic Habits", labels: { "status": "read", "rating": "9", "author": "Clear" } }) // 2. Query rows later search_notes({ query: "#status=read #rating>=8", ancestor_note_id: "<id of Books>" })

Flip the parent's view toTable(orBoardbystatus, orCalendarby a date label) in the Trilium UI and you have a database without ever leaving notes.

append_content({ note_id: "<journal id>", content: "Decided to ship v0.2 on Monday." })

append_contentis non-destructive — handy for daily journals, decision logs, ideation dumps.

- #tag— note has labeltag.
- #status=active— label equals.
- #rating>=8— numeric comparison.
- ~author.title
= "Clear"— follow a relation, match relation target's title.
- note.title %= "^Re:"— regex on title.
- note.content *= "kubernetes"— substring in body.
- #status=active OR #status=pending— boolean.
- Combine withancestor_note_idto scope to a subtree.

git clone https://github.com/OVDEN13/trilium-mcp cd trilium-mcp go build -ldflags="-s -w" -o trilium-mcp .

Cross-compile (e.g. for macOS from Linux):

GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o trilium-mcp-darwin-arm64 .

- The server readsTRILIUM_TOKENfrom env. Treat it like a password — anyone with it can read and write your entire KB. Keep.envout of git (it is in.gitignore).
- The binary speaksonlyto your configured Trilium URL. It does not phone home, log to disk, or open any listening ports.
- HTTPS works automatically (the binary ships with system CAs when run from the host; the Docker image includesca-certificates).

- Stream large note bodies instead of buffering.
- move_note/clone_notetools.
- Bulk operations (add_label_to_many).
- ETAPI v2 features as TriliumNext adds them.
- Tests against an ephemeral TriliumNext container.

For substantive changes, please open an issue first to discuss the shape.

trilium-mcpis an independent project; it is not endorsed by or affiliated with the TriliumNext project. TriliumNext itself is AGPL-3.0; this MCP server talks to it only over its public ETAPI.

Local-first MCP memory server with no external dependency, source citations and OKF/Markdown KB.

Self-hosted MCP server for Obsidian: semantic + full-text search, wikilink graph, note CRUD, OAuth, and a self-describing vault guide.

MCP server for Obsidian vaults — search, memory, link graph, 23 tools, OAuth-protected.

An enterprise-ready system to archive AI conversations from ChatGPT and Claude into a Supabase database.

Interact with your Anytype data through its API, enabling AI assistants to access your information.

MCP server for Apple Notes with semantic search and CRUD operations. Claude searches, reads, creates, updates, and manages your Apple Notes through natural language.

An MCP server for interacting with Bookstack, built with the mcp-framework for Node.js.

Hosted MCP server for live sports data — scores, analytics, schedules, standings, multi-book odds, team form, head-to-head, model predictions, and pre-generated matchup analysis across 1,000+ leagues in 150+ countries. Free tier, no card.

Integrates Model Context Protocol (MCP) with Obsidian, allowing AI assistants to interact with your notes and vault.

CLI & MCP server for Zotero 7/8 — 52 tools to let AI manage your research library locally. Search, import, export, PDF, notes, and more.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.