This example demonstrates how to generate an MCP server for the Trilium Notes ETAPI, allowing integration with the Trilium Notes knowledge management system.
- First, obtain the ETAPI OpenAPI specification:
wget https://github.com/TriliumNext/Notes/blob/master/src/etapi/etapi.openapi.yaml- Generate the MCP server:
python ../../generator.py \
--output-dir=./trilnext \
--api-url=http://localhost:8021 \
--auth-type bearer \
--api-token "your-token" \
etapi.openapi.yamlThe server will be generated at: ./trilnext/openapi-mcp-etapi-uuid
- Build and run the Docker container:
cd ./trilnext/openapi-mcp-etapi-uuid
./docker.sh build
./docker.sh start --transport=sse- Default API URL:
http://localhost:8021(standard Trilium Notes ETAPI port) - Authentication: Bearer token (obtained from Trilium Notes settings)
- Transport: SSE (Server-Sent Events)
The generated MCP server provides tools for all Trilium Notes ETAPI operations, including:
- Note management (create, read, update, delete)
- Attachment handling
- Branch operations
- Attribute management
- Day/Week/Month/Year note operations
- Backup creation
- Authentication
You can test the connection to your Trilium Notes instance by accessing the /api/app-info endpoint through the MCP server.