fix: unify theme system - fix theme switching persistence

- Unified localStorage key to 'theme-preference' across all components
- Fixed header.tsx using wrong localStorage key ('theme' instead of 'theme-preference')
- Added localStorage hybrid persistence for instant theme changes
- Removed router.refresh() which was causing stale data revert
- Replaced Blue theme with Sepia
- Consolidated auth() calls to prevent race conditions
- Updated UserSettingsData types to include all themes
This commit is contained in:
2026-01-18 22:33:41 +01:00
parent ef60dafd73
commit ddb67ba9e5
306 changed files with 59580 additions and 6063 deletions

View File

@@ -1,6 +1,6 @@
# Memento MCP Server
# Keep Notes MCP Server
Model Context Protocol (MCP) server for integrating Memento note-taking app with N8N and other automation tools.
Model Context Protocol (MCP) server for integrating Keep Notes note-taking app with N8N, Cursor, and other automation tools.
## Installation
@@ -11,20 +11,51 @@ npm install
## Usage
### Standalone Server
### Quick Start (Windows)
Le plus simple pour démarrer le serveur MCP:
```powershell
# Exécuter depuis le dossier mcp-server
.\start-mcp.ps1
```
Ou le script batch:
```cmd
start-mcp.bat
```
Ces scripts vérifient automatiquement les prérequis et démarrent le serveur.
### Standalone Server (Cross-platform)
```bash
npm start
```
### With N8N
Ou directement:
Add to your MCP client configuration:
```bash
node index.js
```
Pour le mode SSE (Server-Sent Events):
```bash
npm run start:sse
```
Voir [START-MCP.md](./START-MCP.md) pour le guide complet de démarrage.
### With Cursor MCP
Add to your Cursor MCP client configuration:
```json
{
"mcpServers": {
"memento": {
"keep-notes": {
"command": "node",
"args": ["D:/dev_new_pc/Keep/mcp-server/index.js"]
}
@@ -32,10 +63,16 @@ Add to your MCP client configuration:
}
```
### With N8N
Configure the MCP node in N8N with the server details above.
## Available Tools
### create_note
Create a new note in Memento.
### Note Management
#### create_note
Create a new note in Keep Notes.
**Parameters:**
- `title` (string, optional): Note title
@@ -46,6 +83,15 @@ Create a new note in Memento.
- `labels` (array, optional): Note labels/tags
- `isPinned` (boolean, optional): Pin the note
- `isArchived` (boolean, optional): Archive the note
- `images` (array, optional): Note images as base64 encoded strings
- `links` (array, optional): Note links
- `reminder` (string, optional): Reminder date/time (ISO 8601 format)
- `isReminderDone` (boolean, optional): Mark reminder as done
- `reminderRecurrence` (string, optional): Reminder recurrence (daily, weekly, monthly, yearly)
- `reminderLocation` (string, optional): Reminder location
- `isMarkdown` (boolean, optional): Enable markdown support
- `size` (string, optional): Note size (small, medium, large)
- `notebookId` (string, optional): Notebook ID to associate the note with
**Example:**
```json
@@ -58,90 +104,242 @@ Create a new note in Memento.
{ "id": "1", "text": "Milk", "checked": false },
{ "id": "2", "text": "Bread", "checked": false }
],
"labels": ["shopping", "personal"]
"labels": ["shopping", "personal"],
"notebookId": "cuid123..."
}
```
### get_notes
Get all notes from Memento.
#### get_notes
Get all notes from Keep Notes.
**Parameters:**
- `includeArchived` (boolean, optional): Include archived notes
- `search` (string, optional): Search query to filter notes
- `notebookId` (string, optional): Filter notes by notebook ID
### get_note
#### get_note
Get a specific note by ID.
**Parameters:**
- `id` (string, required): Note ID
### update_note
#### update_note
Update an existing note.
**Parameters:**
- `id` (string, required): Note ID
- All other fields from create_note are optional
### delete_note
#### delete_note
Delete a note by ID.
**Parameters:**
- `id` (string, required): Note ID
### search_notes
#### search_notes
Search notes by query.
**Parameters:**
- `query` (string, required): Search query
- `notebookId` (string, optional): Filter search by notebook ID
### get_labels
Get all unique labels from notes.
#### get_labels
Get all unique labels from notes (legacy method).
**Parameters:** None
### toggle_pin
#### toggle_pin
Toggle pin status of a note.
**Parameters:**
- `id` (string, required): Note ID
### toggle_archive
#### toggle_archive
Toggle archive status of a note.
**Parameters:**
- `id` (string, required): Note ID
### Notebook Management
#### create_notebook
Create a new notebook.
**Parameters:**
- `name` (string, required): Notebook name
- `icon` (string, optional): Notebook icon (emoji)
- `color` (string, optional): Notebook color (hex code)
- `order` (number, optional): Notebook order
#### get_notebooks
Get all notebooks.
**Parameters:** None
#### get_notebook
Get a specific notebook by ID with its notes.
**Parameters:**
- `id` (string, required): Notebook ID
#### update_notebook
Update an existing notebook.
**Parameters:**
- `id` (string, required): Notebook ID
- `name` (string, optional): Notebook name
- `icon` (string, optional): Notebook icon
- `color` (string, optional): Notebook color
- `order` (number, optional): Notebook order
#### delete_notebook
Delete a notebook by ID.
**Parameters:**
- `id` (string, required): Notebook ID
### Label Management
#### create_label
Create a new label.
**Parameters:**
- `name` (string, required): Label name
- `color` (string, optional): Label color (red, orange, yellow, green, teal, blue, purple, pink, gray)
- `notebookId` (string, required): Notebook ID to associate the label with
#### get_labels_detailed
Get all labels with details.
**Parameters:**
- `notebookId` (string, optional): Filter labels by notebook ID
#### update_label
Update an existing label.
**Parameters:**
- `id` (string, required): Label ID
- `name` (string, optional): Label name
- `color` (string, optional): Label color
#### delete_label
Delete a label by ID.
**Parameters:**
- `id` (string, required): Label ID
## N8N Integration Example
1. Install the MCP node in N8N
2. Configure the Memento MCP server
3. Use the tools in your workflows:
```javascript
// Create a note from email
### Create a note from email
```json
{
"tool": "create_note",
"arguments": {
"title": "{{ $json.subject }}",
"content": "{{ $json.body }}",
"labels": ["email", "inbox"]
"labels": ["email", "inbox"],
"notebookId": "cuid123..."
}
}
```
// Search notes
### Search notes
```json
{
"tool": "search_notes",
"arguments": {
"query": "meeting"
"query": "meeting",
"notebookId": "cuid123..."
}
}
```
### Create a notebook
```json
{
"tool": "create_notebook",
"arguments": {
"name": "Work Projects",
"icon": "💼",
"color": "#3B82F6"
}
}
```
## Database
The MCP server connects to the same SQLite database as the Memento web app located at:
The MCP server connects to the same SQLite database as the Keep Notes web app located at:
`D:/dev_new_pc/Keep/keep-notes/prisma/dev.db`
## Prisma Schema Reference
The MCP server works with the following Prisma models:
### Note Model
- id: String (CUID)
- title: String?
- content: String
- color: String (default: "default")
- isPinned: Boolean
- isArchived: Boolean
- type: String (default: "text")
- checkItems: String? (JSON)
- labels: String? (JSON)
- images: String? (JSON)
- links: String? (JSON)
- reminder: DateTime?
- isReminderDone: Boolean
- reminderRecurrence: String?
- reminderLocation: String?
- isMarkdown: Boolean
- size: String (default: "small")
- notebookId: String?
- userId: String?
- order: Int
- createdAt: DateTime
- updatedAt: DateTime
### Notebook Model
- id: String (CUID)
- name: String
- icon: String?
- color: String?
- order: Int
- userId: String
- createdAt: DateTime
- updatedAt: DateTime
### Label Model
- id: String (CUID)
- name: String
- color: String (default: "gray")
- notebookId: String?
- userId: String?
- createdAt: DateTime
- updatedAt: DateTime
## N8N Workflows
Ce serveur MCP est accompagné de 6 workflows N8N prêts à l'emploi pour une intégration complète:
1. **Create Note with Classification** - Création de notes avec classification automatique par IA
2. **Search & Summary** - Recherche et résumé intelligent de notes
3. **Notebook Manager** - Gestion complète des notebooks (CRUD)
4. **Reminder Notifications** - Automatisation des rappels avec notifications
5. **Label Manager** - Gestion des labels avec suggestion IA
6. **Email to Note** - Conversion automatique d'emails en notes
Pour plus de détails, consultez [N8N-WORKFLOWS.md](./N8N-WORKFLOWS.md)
### Importation des Workflows
Chaque workflow peut être importé directement dans N8N via le fichier JSON correspondant:
```bash
# Exemple: Importer le workflow de création de notes
# Ouvrir N8N → Import from File → Sélectionner n8n-workflow-create-note.json
```
## License
MIT