fix: Add debounced Undo/Redo system to avoid character-by-character history
- Add debounced state updates for title and content (500ms delay) - Immediate UI updates with delayed history saving - Prevent one-letter-per-undo issue - Add cleanup for debounce timers on unmount
This commit is contained in:
147
mcp-server/README.md
Normal file
147
mcp-server/README.md
Normal file
@@ -0,0 +1,147 @@
|
||||
# Memento MCP Server
|
||||
|
||||
Model Context Protocol (MCP) server for integrating Memento note-taking app with N8N and other automation tools.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
cd mcp-server
|
||||
npm install
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Standalone Server
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
### With N8N
|
||||
|
||||
Add to your MCP client configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"memento": {
|
||||
"command": "node",
|
||||
"args": ["D:/dev_new_pc/Keep/mcp-server/index.js"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Available Tools
|
||||
|
||||
### create_note
|
||||
Create a new note in Memento.
|
||||
|
||||
**Parameters:**
|
||||
- `title` (string, optional): Note title
|
||||
- `content` (string, required): Note content
|
||||
- `color` (string, optional): Note color (default, red, orange, yellow, green, teal, blue, purple, pink, gray)
|
||||
- `type` (string, optional): Note type (text or checklist)
|
||||
- `checkItems` (array, optional): Checklist items
|
||||
- `labels` (array, optional): Note labels/tags
|
||||
- `isPinned` (boolean, optional): Pin the note
|
||||
- `isArchived` (boolean, optional): Archive the note
|
||||
|
||||
**Example:**
|
||||
```json
|
||||
{
|
||||
"title": "Shopping List",
|
||||
"content": "Buy groceries",
|
||||
"color": "blue",
|
||||
"type": "checklist",
|
||||
"checkItems": [
|
||||
{ "id": "1", "text": "Milk", "checked": false },
|
||||
{ "id": "2", "text": "Bread", "checked": false }
|
||||
],
|
||||
"labels": ["shopping", "personal"]
|
||||
}
|
||||
```
|
||||
|
||||
### get_notes
|
||||
Get all notes from Memento.
|
||||
|
||||
**Parameters:**
|
||||
- `includeArchived` (boolean, optional): Include archived notes
|
||||
- `search` (string, optional): Search query to filter notes
|
||||
|
||||
### get_note
|
||||
Get a specific note by ID.
|
||||
|
||||
**Parameters:**
|
||||
- `id` (string, required): Note ID
|
||||
|
||||
### update_note
|
||||
Update an existing note.
|
||||
|
||||
**Parameters:**
|
||||
- `id` (string, required): Note ID
|
||||
- All other fields from create_note are optional
|
||||
|
||||
### delete_note
|
||||
Delete a note by ID.
|
||||
|
||||
**Parameters:**
|
||||
- `id` (string, required): Note ID
|
||||
|
||||
### search_notes
|
||||
Search notes by query.
|
||||
|
||||
**Parameters:**
|
||||
- `query` (string, required): Search query
|
||||
|
||||
### get_labels
|
||||
Get all unique labels from notes.
|
||||
|
||||
**Parameters:** None
|
||||
|
||||
### toggle_pin
|
||||
Toggle pin status of a note.
|
||||
|
||||
**Parameters:**
|
||||
- `id` (string, required): Note ID
|
||||
|
||||
### toggle_archive
|
||||
Toggle archive status of a note.
|
||||
|
||||
**Parameters:**
|
||||
- `id` (string, required): Note 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
|
||||
{
|
||||
"tool": "create_note",
|
||||
"arguments": {
|
||||
"title": "{{ $json.subject }}",
|
||||
"content": "{{ $json.body }}",
|
||||
"labels": ["email", "inbox"]
|
||||
}
|
||||
}
|
||||
|
||||
// Search notes
|
||||
{
|
||||
"tool": "search_notes",
|
||||
"arguments": {
|
||||
"query": "meeting"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Database
|
||||
|
||||
The MCP server connects to the same SQLite database as the Memento web app located at:
|
||||
`D:/dev_new_pc/Keep/keep-notes/prisma/dev.db`
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
Reference in New Issue
Block a user