Skip to content

Build your personal knowledge base with Trilium Notes

chore(llm): add instructions for MCP use

Elian Doran23ccbf964268
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index b4dfb29f7f..108341ed8e 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -213,6 +213,12 @@ When adding query parameters to ETAPI endpoints (`apps/server/src/etapi/`), main
10. **Attribute inheritance can be complex** - When checking for labels/relations, use `note.getOwnedAttribute()` for direct attributes or `note.getAttribute()` for inherited ones. Don't assume attributes are directly on the note.
+## MCP Server
+- Trilium exposes an MCP (Model Context Protocol) server at `http://localhost:8080/mcp`, configured in `.mcp.json`
+- The MCP server is **only available when the Trilium server is running** (`pnpm run server:start`)
+- It provides tools for reading, searching, and modifying notes directly from the AI assistant
+- Use it to interact with actual note data when developing or debugging note-related features
+
## TypeScript Configuration
- **Project references**: Monorepo uses TypeScript project references (`tsconfig.json`)
diff --git a/CLAUDE.md b/CLAUDE.md
index a818b18929..71a82f39f7 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -161,6 +161,12 @@ Trilium provides powerful user scripting capabilities:
- **Do not use `import.meta.url`/`fileURLToPath`** to resolve file paths — the server is bundled into CJS for production, so `import.meta.url` will not point to the source directory
- **Do not use `__dirname` with relative paths** from source files — after bundling, `__dirname` points to the bundle output, not the original source tree
+## MCP Server
+- Trilium exposes an MCP (Model Context Protocol) server at `http://localhost:8080/mcp`, configured in `.mcp.json`
+- The MCP server is **only available when the Trilium server is running** (`pnpm run server:start`)
+- It provides tools for reading, searching, and modifying notes directly from the AI assistant
+- Use it to interact with actual note data when developing or debugging note-related features
+
## Build System Notes
- Uses pnpm for monorepo management
- Vite for fast development builds