Trilium MCP Server
Provides comprehensive note management for Trilium Notes, including creating, reading, updating, deleting, and searching notes, rich HTML content support, calendar integration, file attachments, and system operations like backup and export.
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., "@Trilium MCP ServerAdd a note to today's calendar about team standup."
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.
Trilium MCP Server
A comprehensive Model Context Protocol (MCP) server for Trilium Notes integration, providing complete note management functionality through MCP-compatible AI clients.
🚀 Production Ready • 🔧 15 API Endpoints • 📊 208 Tests • 🏥 Health Monitoring • 📚 Interactive API Docs
Live Server: https://your-trilium-server.example.com/mcp
Features
Complete Note Management: Create, read, update, delete, and search notes
Rich Content Support: HTML content with formatting and attachments
Calendar Integration: Day, week, and month notes with automatic organization
Advanced Search: Full-text search with filtering and structured results
File Attachments: Base64-encoded file attachment support
System Operations: Backup creation, export functionality, and system info
Interactive API Documentation: Beautiful HTML docs with examples and OpenAPI JSON export
Verbose Logging: Comprehensive request tracking and health monitoring
Production Deployment: HTTPS endpoint with authentication and error handling
Related MCP server: MCP TriliumNext
API Documentation
For complete API documentation, see API Reference.
Interactive Documentation: Visit /docs for complete API documentation with:
All 15 endpoints organized by category
Request/response examples
Parameter descriptions with types and constraints
Known issues and workarounds
OpenAPI 3.0 JSON export at
/docs/jsonMCP Manifest at
/mcp.json(JSON-RPCtools/listformat)
Quick Start
For AI Clients (Recommended)
Copy configuration from
mcp-server-config.json:
{
"mcpServers": {
"trilium": {
"command": "curl",
"args": [
"-X",
"POST",
"https://your-trilium-server.example.com/mcp",
"-H",
"Content-Type: application/json",
"-H",
"Accept: application/json, text/event-stream",
"--data-binary",
"@-"
]
}
}
}Import into your AI client:
Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS)Other MCP clients: Use the universal configuration
Start using - All 15 tools will be available immediately!
Direct HTTP Testing
# Test note creation
curl -X POST https://your-trilium-server.example.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "create_note",
"arguments": {
"parentId": "root",
"title": "API Test Note",
"content": "<h1>Hello from MCP!</h1><p>This note was created via the API.</p>"
}
}
}'
# Test search functionality
curl -X POST https://your-trilium-server.example.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "search_notes",
"arguments": {
"query": "API Test",
"limit": 5,
"format": "structured"
}
}
}'
# Get system information
curl -X POST https://your-trilium-server.example.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_app_info",
"arguments": {}
}
}'Local Development
Prerequisites
Node.js 18+
pnpm package manager
Trilium Notes instance with ETAPI enabled
Setup
Clone and install:
git clone <repository-url>
cd trilium-mcp
pnpm installConfigure environment:
cp .env.example .env
# Edit .env with your Trilium URL and tokenStart development server:
pnpm dev # Auto-reload enabled
# or
pnpm start # Production modeHealth check:
curl http://localhost:3000/healthEnvironment Variables
Variable | Description | Required | Default |
| Trilium ETAPI URL (include | ✅ | - |
| ETAPI authentication token | ✅ | - |
| HTTP server port | ❌ | 3000 |
| Environment mode | ❌ | development |
Production Features
Comprehensive Logging
Request tracking: Unique IDs for every MCP request with timing
ETAPI monitoring: All Trilium API calls logged with request/response details
Health monitoring: System stats every 30 seconds (memory, connections, uptime)
Error handling: Full stack traces and detailed error messages
Connection tracking: Active/total connection counts with lifecycle logging
Health Monitoring
# View server health
curl https://my-own-trilium-mcp.fly.dev/health
# View API documentation
curl https://my-own-trilium-mcp.fly.dev/docs
# Get OpenAPI JSON spec
curl https://my-own-trilium-mcp.fly.dev/docs/json
# Get MCP Manifest (tools/list format)
curl https://my-own-trilium-mcp.fly.dev/mcp.json
# Monitor deployment logs
fly logs -a your-app-nameSecurity
HTTPS deployment with proper TLS
ETAPI authentication with Basic Auth
CORS enabled for cross-origin requests
Request validation with MCP protocol compliance
Error sanitization without sensitive data leakage
Performance Metrics
Based on comprehensive testing:
Response Times: 100-300ms average for most operations
Memory Usage: ~99MB RSS, stable memory footprint
Connection Handling: Proper cleanup and resource management
Uptime: Production-stable with comprehensive error handling
Success Rate: 13/15 endpoints (87%) fully working
Testing Results
The server has been comprehensively tested with real-world scenarios:
✅ Created nested folder structure with rich HTML content ✅ All CRUD operations tested with actual data ✅ Calendar integration verified with daily/monthly notes ✅ File attachments tested with base64 encoding ✅ Search functionality confirmed with structured results ✅ System operations validated including backups and info retrieval
See Final Test Results for complete testing documentation.
Additional Resources
API Reference - Complete endpoint documentation
MCP Usage Guide - User guide for operating the MCP server
Trilium Notes - The note-taking application
Model Context Protocol - The underlying protocol
Trilium ETAPI Docs - External API documentation
License
MIT License - see LICENSE file for details.
Ready to use! 🎉 Import the configuration files into your favorite MCP-compatible AI client and start managing your Trilium notes with AI assistance.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/lilaflo/trilium-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server