Skip to main content
Glama
TriliumNext Notes' MCP Server

TriliumNext Notes' MCP Server

MCP-Server von TriliumNext Notes

⚠️ HAFTUNGSAUSSCHLUSS: Dies ist ein Prototyp für https://github.com/TriliumNext/Notes/issues/705 . Nur für Entwickler empfohlen. Bitte sichern Sie Ihre Trilium-Notizen, bevor Sie dieses Tool verwenden. ⚠️

Ein Model Context Protocol-Server für TriliumNext Notes. Dieser Server bietet Tools für die Interaktion mit Ihrer Trilium Notes-Instanz über MCP.

Update: Unterstützt die neueste Version von TriliumNext v0.92.6

Hinweis: Wir empfehlen die Verwendung mit der Cline-Erweiterung in VSCode anstelle von Claude Desktop

Schnellstart

Stellen Sie sicher, dass Sie zuerst Ihre Umgebungsvariablen einrichten:

  • TRILIUM_API_URL (Standard: http://localhost:8080/etapi )

  • TRILIUM_API_TOKEN (erforderlich, erhalten Sie dies aus Ihren Trilium Notes-Einstellungen)

Related MCP server: MCP TriliumNext

Installation

1. Verwendung mit Claude Desktop

Fügen Sie die Serverkonfiguration zu Ihrer Claude Desktop-Konfigurationsdatei hinzu:

Fügen Sie dem mcpServers -Objekt in Ihrer Claude-Konfigurationsdatei die folgende Konfiguration hinzu:

Für die lokale Installation (unter Windows)

"triliumnext-mcp": {
  "command": "cmd",
  "args": [
        "/k",
        "npx",
        "-y",
        "triliumnext-mcp"
      ],
   "env": {
    "TRILIUM_API_URL": "http://localhost:8080/etapi",
    "TRILIUM_API_TOKEN": "<YOUR_TRILIUM_API_TOKEN>"
  }
}

Für die lokale Installation (unter Linux)

"triliumnext-mcp": {
  "command": "npx",
  "args": [
        "-y",
        "triliumnext-mcp"
      ],
   "env": {
    "TRILIUM_API_URL": "http://localhost:8080/etapi",
    "TRILIUM_API_TOKEN": "<YOUR_TRILIUM_API_TOKEN>"
  }
}

Für die Entwicklung (unter Windows/Linux)

cd /path/to/triliumnext-mcp
npm run build
"triliumnext-mcp": {
  "command": "node",
  "args": [
        "/path/to/triliumnext-mcp/build/index.js"
  ],
  "env": {
    "TRILIUM_API_URL": "http://localhost:8080/etapi",
    "TRILIUM_API_TOKEN": "<YOUR_TRILIUM_API_TOKEN>"
  }
}

Speicherort der Konfigurationsdatei:

  • Windows: %APPDATA%/Claude/claude_desktop_config.json

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Verfügbare Tools

Der Server stellt die folgenden Tools zur Notizverwaltung bereit:

  • search_notes - Notizen durchsuchen

    • Erfordert: Suchanfrage

    • Optional: fastSearch (Volltextsuche umschalten), includeArchivedNotes

  • get_note - Ruft den Inhalt einer Notiz nach ID ab

    • Erfordert: Notiz-ID

  • create_note - Erstelle eine neue Notiz

    • Erfordert: ID der übergeordneten Notiz, Titel, Typ, Inhalt

    • Optional: MIME-Typ für Code-/Datei-/Bildnotizen

    • Unterstützte Notiztypen: Text, Code, Datei, Bild, Suche, Buch, RelationMap, Render

  • update_note - Eine vorhandene Notiz aktualisieren

    • Erfordert: Notiz-ID

    • Optional: neuer Titel, neuer Inhalt

  • delete_note - Eine Notiz löschen

    • Erfordert: Notiz-ID

Entwicklung

Wenn Sie zum Server beitragen oder ihn ändern möchten:

# Clone the repository
git clone https://github.com/tan-yong-sheng/triliumnext-mcp.git

# Install dependencies
npm install

# Build the server
npm run build

# For development with auto-rebuild
npm run watch

Available Tools

9 tools
create_noteA

Create a new note in TriliumNext with duplicate title detection. When a note with the same title already exists in the same directory, you'll be presented with choices: skip creation, create anyway (with forceCreate: true), or update the existing note. ONLY use this tool when the user explicitly requests note creation (e.g., 'create a note', 'make a new note'). DO NOT use this tool proactively or when the user is only asking questions about their notes. TIP: For code notes, content is plain text (no HTML processing).

Inputs: parentNoteId (required), title (required), type (required), content, +4 more.

delete_noteA

Delete a note permanently. ONLY use this tool when the user explicitly requests note deletion (e.g., 'delete the note', 'remove this note', 'delete this permanently'). TRY NOT to use this tool proactively or for automated cleanup. CAUTION: This action cannot be undone and will permanently remove the note and all its content.

Inputs: noteId (required).

get_noteA

Get a note and its content by ID. Perfect for when someone wants to see what's in a note, extract specific information, or prepare for search and replace operations. Getting the full content lets you see the context and create better regex patterns for extraction or replacement. ⚠️ SMART CONTENT INCLUSION: For file/image notes, binary content is automatically excluded by default for performance. Use includeBinaryContent: true to explicitly retrieve binary data when needed.

Inputs: noteId (required), includeContent, includeBinaryContent, searchPattern, +2 more.

manage_attributesA

Manage note attributes with write operations (create, update, delete). Create labels (#tags), template relations (~template), update existing attributes, and organize notes with metadata. IMPORTANT: This tool only provides write access - use read_attributes to view existing attributes. Relations require values pointing to existing notes (e.g., template relations use 'Board', 'Calendar'; author relations use target note titles or IDs). UPDATE LIMITATIONS: For labels, only value and position can be updated. For relations, only position can be updated. The isInheritable property cannot be changed via update - delete and recreate to modify inheritability. Supports single operations and efficient batch creation for better performance.

Inputs: noteId (required), operation (required), attributes.

read_attributesA

Read all attributes (labels and relations) for a note. View existing labels (#tags), template relations (~template), and note metadata. This tool provides read-only access to inspect current attributes assigned to any note. Returns structured data with labels, relations, and summary information.

Inputs: noteId (required).

resolve_note_idA

Resolves a note/folder name to its actual note ID for use with other tools. You MUST call this function when users provide note names instead of note IDs (e.g., 'wqd7006', 'My Project') UNLESS the user explicitly provides a note ID. Simple title-based search with user choice when multiple matches found.

Inputs: noteName (required), exactMatch, maxResults, autoSelect.

search_and_replace_noteA

Search and replace content within a single note. When someone wants to replace text in a note, first call get_note to get the current content and hash, then use this function to make the changes. This ensures you're working with the latest version of their note.

Inputs: noteId (required), searchPattern (required), replacePattern (required), expectedHash (required), +3 more.

search_notesA

Unified search with comprehensive filtering capabilities including keyword search, date ranges, field-specific searches, attribute searches, note properties, template-based searches, note type filtering, MIME type filtering, and hierarchy navigation through unified searchCriteria structure. For simple keyword searches, use the 'text' parameter. For complex boolean logic like 'docker OR kubernetes', use searchCriteria with proper OR logic. For template search: use relation type with 'template.title' property and built-in template values like 'Calendar', 'Board', 'Text Snippet', 'Grid View', 'List View', 'Table', 'Geo Map'. For note type search: use noteProperty type with 'type' property and values from the 9 supported ETAPI types: 'text', 'code', 'render', 'search', 'relationMap', 'book', 'noteMap', 'mermaid', 'webView'. For MIME type search: use noteProperty type with 'mime' property and MIME values like 'text/javascript', 'text/x-python', 'text/vnd.mermaid', 'application/json'. Use hierarchy properties like 'parents.noteId', 'children.noteId', or 'ancestors.noteId' for navigation.

Inputs: text, searchCriteria, limit.

update_noteA

Update note with support for title-only updates, content overwrite, content append, or file replacement. ⚠️ REQUIRED: ALWAYS call get_note first to obtain current hash. ⚠️ SIMPLER RULES: Note type and MIME type are IMMUTABLE - cannot be changed after creation. MODE SELECTION: Use 'append' when user wants to add/insert content (e.g., 'append to note', 'add to the end', 'insert content', 'add more content', 'continue writing', 'add to bottom'). Use 'overwrite' when replacing entire content (e.g., 'replace content', 'overwrite note', 'update the whole note', 'completely replace'). TITLE-ONLY: Efficient title changes without content modification. FILE UPDATES: Replace file content only with SAME file type (image→image, file→file). To change file types, create a new note instead. PREVENTS: Type mismatches, file type conflicts, and overwriting changes made by other users. ONLY use when user explicitly requests note update. WORKFLOW: get_note → review content → update_note with returned hash

Inputs: noteId (required), expectedHash (required), title, content, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no ambiguity. For example, create_note, delete_note, get_note, update_note cover the CRUD lifecycle distinctly, while manage_attributes and read_attributes separate write and read operations cleanly. Tools like resolve_note_id and search_notes serve unique auxiliary functions without overlap.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case throughout, such as create_note, delete_note, get_note, update_note, manage_attributes, read_attributes, resolve_note_id, search_and_replace_note, and search_notes. This uniformity makes the set predictable and easy to understand.

    Tool Count5/5

    With 9 tools, the count is well-scoped for a notes management server, covering core operations like CRUD, attribute handling, search, and ID resolution. Each tool earns its place without redundancy, providing a comprehensive yet manageable interface for the domain.

    Completeness5/5

    The tool set offers complete coverage for note management, including full CRUD (create_note, get_note, update_note, delete_note), attribute management (manage_attributes, read_attributes), search capabilities (search_notes, search_and_replace_note), and auxiliary functions (resolve_note_id). There are no obvious gaps, enabling agents to handle all typical workflows without dead ends.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server enabling AI assistants to interact with TriliumNext notes, providing tools for creating, searching, reading, and updating notes in your knowledge base.
      4
      2
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A simple server for saving, listing, and searching notes persisted to a local JSON file. It enables users to manage their personal notes using natural language via the Model Context Protocol.
      3
      ISC
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server for managing text notes, with resources (note:// URIs), tools (create_note), and prompts (summarize_notes).
      -