# N8N Configuration — Memento MCP Server ## MCP Client Setup in N8N The MCP server uses **Streamable HTTP** transport (replaces the legacy SSE transport). ### 1. Generate an API Key In Memento: **Settings > MCP > Generate a key** The key has the format `mcp_sk_...` and is scoped to your user account. Only your notes will be accessible. ### 2. Configure the MCP Client Node in N8N 1. Add an **MCP Client** node to your workflow 2. **Server Transport**: `Streamable HTTP` 3. **MCP Endpoint URL**: `http://memento-mcp:3001/mcp` (Docker) or `http://YOUR_IP:3001/mcp` 4. **Authentication**: Header Auth - Header Name: `x-api-key` - Header Value: your API key (`mcp_sk_...`) ### Alternative: curl ```bash # Health check curl -H "x-api-key: mcp_sk_yourkey" http://localhost:3001/ # List available tools curl -X POST http://localhost:3001/mcp \ -H "Content-Type: application/json" \ -H "x-api-key: mcp_sk_yourkey" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {} }' # Create a note curl -X POST http://localhost:3001/mcp \ -H "Content-Type: application/json" \ -H "x-api-key: mcp_sk_yourkey" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "create_note", "arguments": { "title": "My note", "content": "Note content here" } } }' ``` ## Available Tools (22) ### Notes (11) | Tool | Description | |------|-------------| | `create_note` | Create a note | | `get_notes` | List notes | | `get_note` | Get a note by ID | | `update_note` | Update a note | | `delete_note` | Delete a note | | `search_notes` | Search by keyword | | `move_note` | Move to a notebook | | `toggle_pin` | Pin / unpin | | `toggle_archive` | Archive / unarchive | | `export_notes` | Export as JSON | | `import_notes` | Import from JSON | #### Note Types | `type` value | Description | |--------------|-------------| | `richtext` | Rich text editor — **default** | | `markdown` | Markdown rendered (use instead of `isMarkdown`) | | `text` | Plain text | | `checklist` | Interactive checklist with `checkItems` | ### Notebooks (6) | Tool | Description | |------|-------------| | `create_notebook` | Create a notebook | | `get_notebooks` | List all notebooks | | `get_notebook` | Get notebook details | | `update_notebook` | Update a notebook | | `delete_notebook` | Delete a notebook | | `reorder_notebooks` | Reorder notebooks | ### Labels (4) | Tool | Description | |------|-------------| | `create_label` | Create a label | | `get_labels` | List labels | | `update_label` | Update a label | | `delete_label` | Delete a label | ### Reminders (1) | Tool | Description | |------|-------------| | `get_due_reminders` | Get due reminders | ## HTTP Endpoints | Endpoint | Method | Description | |----------|--------|-------------| | `/` | GET | Health check | | `/mcp` | GET/POST | Main MCP endpoint | | `/sse` | GET/POST | Legacy (redirects to `/mcp`) | | `/sessions` | GET | Active sessions | ## Security - **Authentication required** in production (`MCP_REQUIRE_AUTH=true` in Docker) - API keys are managed from **Settings > MCP** in Memento - Each key is scoped to a single user: only their notes are accessible - Keys are hashed in the database (SHA256); the raw key is only shown once at creation ## Ports | Service | Port | URL | |---------|------|-----| | Memento UI | 3000 | http://localhost:3000 | | MCP Server | 3001 | http://localhost:3001/mcp |