MCP TriliumNext
The MCP TriliumNext server enables AI assistants to manage TriliumNext notes through a standardized protocol with full CRUD operations:
• Create Notes: Create new notes with title, content, optional type (text, code, file, image, search, book, relationMap, canvas), and parent note ID
• Search Notes: Perform fulltext or structured searches using TriliumNext's powerful query syntax, including labels and date filters, with customizable result limits (1-100)
• Retrieve Notes: Fetch complete details and content of specific notes by ID
• Update Notes: Modify existing note content using note ID
• Access Recent Notes: Retrieve the 10 most recently modified notes as a resource
• Advanced Features: Structured data preservation for AI consumption, robust error handling, validation, and production-ready logging and monitoring
Provides tools for creating, searching, reading, and updating notes in TriliumNext, with support for different note types, fulltext searching with advanced query syntax, and access to recently modified notes.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP TriliumNextsearch for my meeting notes about the Q3 project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP TriliumNext
A Model Context Protocol (MCP) server for TriliumNext, providing AI assistants with seamless access to your note-taking workflow.
Overview
This MCP server enables AI assistants like Claude to interact with your TriliumNext notes through a standardized protocol. It provides tools for creating, searching, reading, and updating notes, as well as accessing recent notes as a resource.
Related MCP server: TriliumNext Notes' MCP Server
Features
🛠️ Tools
create_note - Create new notes with title, content, and type
search_notes - Search notes using fulltext or structured queries
get_note - Retrieve complete note details and content
update_note - Update existing note content
📚 Resources
trilium://recent-notes - Access to 10 most recently modified notes
✨ Key Capabilities
Full CRUD operations for notes
Advanced search with TriliumNext query syntax
Structured data preservation for AI consumption
Comprehensive error handling and validation
Production-ready logging and monitoring
Installation
Prerequisites
Node.js 18.0.0 or higher
TriliumNext server running and accessible
ETAPI token from your TriliumNext instance
Setup
Clone and install
git clone git@github.com:RadonX/mcp-trilium.git cd mcp-trilium npm installConfigure environment Create a
.envfile with your settings:TRILIUM_URL=http://localhost:8080 TRILIUM_AUTH_TOKEN=your_etapi_token_here REQUEST_TIMEOUT=30000 LOG_LEVEL=infoGet your ETAPI token
Open TriliumNext web interface
Go to Options → ETAPI
Create a new token or use existing one
Copy the token to your
.envfile
Test connectivity
npm run test-connectivity
Usage
With Claude Code
Add the MCP server directly using Claude Code:
claude mcp add trilium-mcp node /path/to/mcp-trilium/src/index.js --env TRILIUM_URL=http://localhost:8080 --env TRILIUM_AUTH_TOKEN=your_etapi_token_here --env REQUEST_TIMEOUT=30000 --env LOG_LEVEL=infoWith Claude Desktop
Add to your Claude Desktop configuration (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"trilium": {
"command": "node",
"args": ["/path/to/mcp-trilium/src/index.js"],
"env": {
"TRILIUM_URL": "http://localhost:8080",
"TRILIUM_AUTH_TOKEN": "your_token_here"
}
}
}
}With MCP Inspector
npx @modelcontextprotocol/inspector src/index.jsStandalone Usage
npm startExamples
Creating a Note
// Ask Claude: "Create a note about TypeScript basics"
{
"tool": "create_note",
"arguments": {
"title": "TypeScript Basics",
"content": "# TypeScript Fundamentals\n\nTypeScript is a typed superset of JavaScript...",
"type": "text",
"parentNoteId": "root"
}
}Searching Notes
// Ask Claude: "Find all notes about JavaScript"
{
"tool": "search_notes",
"arguments": {
"query": "javascript #programming",
"limit": 10
}
}Updating Content
// Ask Claude: "Update my JavaScript notes with new ES6 features"
{
"tool": "update_note",
"arguments": {
"noteId": "note123abc",
"content": "Updated content with ES6 features..."
}
}Search Query Syntax
TriliumNext supports powerful search queries:
Fulltext:
machine learning algorithmsExact match:
"neural networks"Labels:
#programming #javascriptCombined:
"react hooks" #programming type:codeDate filters:
dateCreated:>2024-01-01
Development
Running Tests
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverageProject Structure
src/
├── index.js # Main MCP server
├── tools/ # MCP tool implementations
│ ├── create-note.js
│ ├── search-notes.js
│ ├── get-note.js
│ └── update-note.js
├── resources/ # MCP resource implementations
│ └── recent-notes.js
└── utils/ # Shared utilities
├── trilium-client.js
├── validation.js
└── logger.jsAPI Reference
TriliumNext ETAPI
This server uses TriliumNext's External API (ETAPI). Key endpoints:
GET /notes- Search notesPOST /create-note- Create noteGET /notes/{id}- Get note detailsPUT /notes/{id}/content- Update note content
See docs/trilium-etapi-specification.md for complete API documentation.
Configuration
Environment Variables
TRILIUM_URL- TriliumNext server URL (default:http://localhost:8080)TRILIUM_AUTH_TOKEN- ETAPI authentication token (required)REQUEST_TIMEOUT- API request timeout in ms (default:30000)LOG_LEVEL- Logging level:error,warn,info,debug(default:info)
Note Types
Supported note types:
text- Rich text notes (default)code- Code snippets with syntax highlightingfile- File attachmentsimage- Image notessearch- Saved searchesbook- Book/chapter organizationrelationMap- Visual relation mapscanvas- Freeform canvas notes
Troubleshooting
Common Issues
Authentication Failed
# Check your token
curl -H "Authorization: Bearer your_token" http://localhost:8080/etapi/app-infoConnection Refused
Verify TriliumNext is running
Check
TRILIUM_URLin.envEnsure ETAPI is enabled in TriliumNext settings
Content Stored as [Object]
Fixed in v0.1.0 - content now properly sent as text/plain
Update to latest version if experiencing this issue
Debug Mode
LOG_LEVEL=debug npm startContributing
Fork the repository
Create a feature branch:
git checkout -b feature-nameMake your changes with tests
Run the test suite:
npm testSubmit a pull request
License
MIT License - see LICENSE file for details.
Related Projects
TriliumNext - The note-taking application
Model Context Protocol - MCP specification
Claude Desktop - AI assistant with MCP support
Future Enhancements
The following features may be added in future versions:
🚀 Planned Features
Enhanced note types support - Full support for all TriliumNext note types (relationMap, canvas, etc.)
Advanced search features - Attribute-based queries, date range filters, and complex search operators
Performance optimizations - Caching, batch operations, and streaming for large note collections
Note relationship management - Tools for managing note relationships and hierarchies
Bulk operations - Create, update, or delete multiple notes in a single operation
Attachment handling - Support for file uploads and downloads
Real-time updates - WebSocket integration for live note synchronization
💡 Potential Integrations
Export capabilities - Export notes to various formats (Markdown, PDF, etc.)
Template system - Predefined note templates for common use cases
Backup and restore - Automated backup functionality through MCP
Analytics and insights - Note usage statistics and content analysis
Changelog
v0.1.0
Initial release with full CRUD operations
MCP resource for recent notes
Comprehensive test coverage (94 tests)
Production-ready error handling and validation
Made with ❤️ for the TriliumNext and MCP communities
Available Tools
4 toolscreate_noteC
Create a new note in TriliumNext
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | The title of the note (max 200 characters) | |
| content | Yes | The content of the note (max 1MB) | |
| type | No | The type of note to create | text |
| parentNoteId | No | ID of the parent note (defaults to "root" if not provided) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a creation operation but doesn't mention permissions needed, whether it's idempotent, error handling, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a creation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens after creation (e.g., returns note ID), error conditions, or behavioral nuances. Given the complexity of a mutation operation, more context is needed for completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all four parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, resulting in the baseline score of 3 where the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Create') and resource ('a new note in TriliumNext'), making the purpose immediately understandable. However, it doesn't differentiate this from sibling tools like 'update_note' or explain when to create versus update, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'update_note' or 'search_notes'. There's no mention of prerequisites, context, or exclusions, leaving the agent with minimal usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_noteC
Get details of a specific note
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | The ID of the note to retrieve |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves note details, implying a read-only operation, but doesn't cover aspects like error handling (e.g., what happens if the noteId is invalid), authentication needs, rate limits, or return format, which are critical for an agent to use it correctly.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, straightforward sentence: 'Get details of a specific note'. It's appropriately sized and front-loaded, with no wasted words, making it efficient. However, it could be slightly more structured by including key details upfront, but it's concise enough to earn a high score.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (a read operation with one parameter) and the absence of annotations and output schema, the description is incomplete. It doesn't explain what 'details' are returned, error scenarios, or how it differs from siblings, leaving gaps that could hinder an agent's ability to use the tool effectively without additional context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with 'noteId' clearly documented as 'The ID of the note to retrieve'. The description adds no additional meaning beyond this, as it doesn't explain parameter usage or constraints. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Get details of a specific note' clearly states the verb 'Get' and resource 'note', making the purpose understandable. However, it lacks specificity about what 'details' include and doesn't distinguish from sibling tools like 'search_notes' or 'create_note', which is a missed opportunity for clarity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description doesn't mention that 'get_note' is for retrieving a single note by ID, while 'search_notes' might be for multiple notes or filtering, leaving the agent to infer usage from context without explicit help.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_notesC
Search for notes in TriliumNext
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (fulltext or structured, max 500 characters) | |
| limit | No | Maximum number of results to return |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool searches for notes but doesn't describe key behaviors like whether it's read-only (implied but not explicit), how results are returned (e.g., format, pagination), error conditions, or performance aspects like rate limits. This leaves significant gaps for an agent to understand the tool's operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for a search tool. It doesn't explain what the search returns (e.g., note metadata, content snippets), how results are structured, or any behavioral nuances like sorting or filtering options. This makes it inadequate for an agent to fully understand the tool's context and usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, so the input schema already documents both parameters ('query' and 'limit') with details like constraints and defaults. The description adds no additional meaning beyond what the schema provides, such as examples of query syntax or result ordering, but doesn't need to compensate for gaps, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Search for notes') and the target resource ('in TriliumNext'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_note' (which might retrieve a specific note) or mention what makes this search distinct.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_note' or 'create_note'. It lacks context about prerequisites, such as whether notes must exist or be accessible, and doesn't mention any exclusions or typical use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_noteC
Update the content of an existing note
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | The ID of the note to update | |
| content | Yes | The new content for the note (max 1MB) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but only states it updates content without disclosing behavioral traits like permission requirements, whether the update overwrites or merges content, error handling, or rate limits. This is inadequate for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste, front-loading the key action and resource. It's appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, no output schema, and a mutation tool with two parameters, the description is incomplete. It lacks details on behavior, return values, or error cases, making it insufficient for reliable agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters ('noteId' and 'content') adequately. The description adds no additional meaning beyond implying the tool uses these parameters, meeting the baseline for high coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Update') and resource ('the content of an existing note'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'create_note' or 'get_note' beyond the basic verb, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'create_note' or 'get_note'. It lacks context about prerequisites (e.g., needing an existing note ID) or exclusions, leaving usage unclear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
- First observed
create_note - First observed
get_note - First observed
search_notes - First observed
update_note
TDQS
Each tool has a clearly distinct purpose targeting specific CRUD operations for notes: create_note for creation, get_note for retrieval, search_notes for searching, and update_note for updates. There is no overlap in functionality, making tool selection straightforward.
All tool names follow a consistent verb_noun pattern with snake_case, using clear action verbs (create, get, search, update) paired with the noun 'note' or 'notes'. This uniformity enhances readability and predictability.
With 4 tools, the server is well-scoped for managing notes in TriliumNext, covering essential operations without being overly simplistic or bloated. Each tool serves a distinct and necessary function in the note lifecycle.
The tool set provides strong coverage for core note operations, including create, read, search, and update. A minor gap exists with no delete_note tool, which could limit full lifecycle management, but agents can still handle most workflows effectively.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Google Keep-style notes app with an MCP server for AI agents to read/write notes.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
- TaprootOAuthcom.taproothq
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
Related MCP Servers
- AlicenseBqualityFmaintenanceA Model Context Protocol server that enables AI assistants to read, write, and manipulate notes in your Obsidian vault through a standardized interface.54,7854ISC
- FlicenseAqualityCmaintenanceA model context protocol server that allows interaction with TriliumNext Notes, providing tools to create, search, retrieve, update, and delete notes through natural language commands.98168-
- FlicenseNot gradedqualityAmaintenanceA Model Context Protocol (MCP) server for interacting with TriliumNext via its ETAPI. Enables LLMs to create, read, update, and organize notes, including embedding images and files directly into note content.8165-
- AlicenseNot gradedqualityDmaintenanceEnables AI clients to manage Trilium Notes with full CRUD operations, search, calendar integration, and system administration through the Model Context Protocol.182MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/RadonX/mcp-trilium'
If you have feedback or need assistance with the MCP directory API, please join our Discord server