{ "name": "Memento MCP — Webhook to Note", "nodes": [ { "parameters": { "httpMethod": "POST", "path": "memento-note", "responseMode": "responseNode", "options": {} }, "id": "webhook-trigger", "name": "Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [240, 300], "webhookId": "memento-create-note" }, { "parameters": { "jsCode": "// Flexible input: accept anything and build a note from it\nconst body = $input.item.json.body || $input.item.json;\n\nconst title = body.title || body.subject || body.name || null;\nconst content = body.content || body.text || body.message || body.description || JSON.stringify(body, null, 2);\nconst color = body.color || 'default';\nconst labels = Array.isArray(body.labels) ? body.labels : body.labels ? [body.labels] : [];\nconst notebookId = body.notebookId || body.notebook_id || null;\nconst isPinned = body.isPinned === true || body.pinned === true;\nconst isMarkdown = body.isMarkdown === true || body.markdown === true;\nconst reminder = body.reminder || body.dueDate || body.due_date || null;\nconst color_valid = ['default','red','orange','yellow','green','teal','blue','purple','pink','gray'].includes(color) ? color : 'default';\n\nreturn [{ json: { title, content, color: color_valid, labels, notebookId, isPinned, isMarkdown, reminder } }];" }, "id": "prepare-note", "name": "Prepare Note Data", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [480, 300] }, { "parameters": { "method": "POST", "url": "http://memento-mcp:3001/mcp", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" }, { "name": "x-api-key", "value": "={{ $vars.MEMENTO_API_KEY }}" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"tools/call\",\n \"params\": {\n \"name\": \"create_note\",\n \"arguments\": {\n \"title\": {{ $json.title ? JSON.stringify($json.title) : 'null' }},\n \"content\": {{ JSON.stringify($json.content) }},\n \"color\": \"{{ $json.color }}\",\n \"labels\": {{ JSON.stringify($json.labels) }},\n \"isPinned\": {{ $json.isPinned }},\n \"isMarkdown\": {{ $json.isMarkdown }}\n {{ $json.notebookId ? ', \"notebookId\": \"' + $json.notebookId + '\"' : '' }}\n {{ $json.reminder ? ', \"reminder\": \"' + $json.reminder + '\"' : '' }}\n }\n }\n}" }, "id": "mcp-create-note", "name": "MCP — Create Note", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [720, 300] }, { "parameters": { "jsCode": "const response = $input.item.json;\nconst result = JSON.parse(response.result?.content?.[0]?.text || '{}');\n\nreturn [{\n json: {\n success: true,\n noteId: result.id,\n title: result.title,\n createdAt: result.createdAt\n }\n}];" }, "id": "format-response", "name": "Format Response", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [960, 300] }, { "parameters": { "respondWith": "json", "responseBody": "={{ $json }}" }, "id": "webhook-response", "name": "Respond to Webhook", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1.1, "position": [1200, 300] } ], "connections": { "Webhook": { "main": [[{ "node": "Prepare Note Data", "type": "main", "index": 0 }]] }, "Prepare Note Data": { "main": [[{ "node": "MCP — Create Note", "type": "main", "index": 0 }]] }, "MCP — Create Note": { "main": [[{ "node": "Format Response", "type": "main", "index": 0 }]] }, "Format Response": { "main": [[{ "node": "Respond to Webhook", "type": "main", "index": 0 }]] } }, "pinData": {}, "settings": { "executionOrder": "v1" }, "staticData": null, "tags": [{ "id": "memento-mcp", "name": "Memento MCP" }], "triggerCount": 1, "updatedAt": "2026-05-03T00:00:00.000Z", "versionId": "1" }