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.
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.
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
- Configure environment
Create a
.env
file with your settings: - Get your ETAPI token
- Open TriliumNext web interface
- Go to Options → ETAPI
- Create a new token or use existing one
- Copy the token to your
.env
file
- Test connectivity
Usage
With Claude Desktop
Add to your Claude Desktop configuration (~/.claude/claude_desktop_config.json
):
With MCP Inspector
Standalone Usage
Examples
Creating a Note
Searching Notes
Updating Content
Search Query Syntax
TriliumNext supports powerful search queries:
- Fulltext:
machine learning algorithms
- Exact match:
"neural networks"
- Labels:
#programming #javascript
- Combined:
"react hooks" #programming type:code
- Date filters:
dateCreated:>2024-01-01
Development
Running Tests
Project Structure
API 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
Connection Refused
- Verify TriliumNext is running
- Check
TRILIUM_URL
in.env
- Ensure 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
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes with tests
- Run the test suite:
npm test
- Submit 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
This server cannot be installed
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.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants to read, write, and manipulate notes in your Obsidian vault through a standardized interface.Last updated -3192TypeScriptISC License
- AsecurityFlicenseAqualityA Model Context Protocol server that connects AI assistants like Claude to Notion workspaces, enabling them to view, search, create, and update Notion databases, pages, and content blocks.Last updated -127061JavaScript
- AsecurityFlicenseAqualityA model context protocol server that allows interaction with TriliumNext Notes, providing tools to create, search, retrieve, update, and delete notes through natural language commands.Last updated -59JavaScript
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -161TypeScript