docs: update all MCP documentation for 22 tools + API key auth
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 15s

- Rewrite mcp-server/README.md: clean structure, auth section, 22 tools
- Rewrite N8N-CONFIG.md: remove hardcoded IPs, add x-api-key auth flow
- Rewrite N8N-WORKFLOWS.md: simplified, removed AI proxy tool references
- Update README.md/README.fr.md: 37→22 tools, add auth mention
- Update GUIDE.md/GUIDE.en.md: remove AI/API key tool tables, add auth
- Update DEPLOY.md: SSE → Streamable HTTP in architecture diagram

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 16:25:00 +02:00
parent 49e076a4bb
commit bbaae76103
8 changed files with 270 additions and 945 deletions

View File

@@ -1,275 +1,122 @@
# Configuration N8N - Memento MCP SSE Server
# Configuration N8N - Memento MCP Server
## 🎯 Ton IP Actuelle
**IP Principale**: `172.26.64.1`
## Configuration MCP Client dans N8N
## 🔌 Configuration MCP Client dans N8N
Le serveur MCP utilise le transport **Streamable HTTP** (remplace l'ancien SSE).
### Option 1: Via Settings → MCP Access (Recommandé)
### 1. Generer une cle API
1. Ouvre N8N dans ton navigateur
2. Va dans **Settings** (⚙️)
3. Sélectionne **MCP Access**
4. Clique sur **Add Server** ou **+**
5. Entre cette configuration:
Dans Memento : **Parametres > MCP > Generer une cle**
```json
{
"name": "memento",
"transport": "sse",
"url": "http://172.26.64.1:3001/sse",
"description": "Memento Note-taking App MCP Server"
}
```
La cle a le format `mcp_sk_...` et est associee a votre compte utilisateur. Seules vos notes seront accessibles.
6. Sauvegarde la configuration
7. Dans tes workflows, active **"Available in MCP"** (toggle)
8. Utilise le node **MCP Client** pour appeler les tools
### 2. Configurer le noeud MCP Client dans N8N
### Option 2: Via Variables d'Environnement
1. Ajouter un noeud **MCP Client** dans votre workflow
2. **Server Transport** : `Streamable HTTP`
3. **MCP Endpoint URL** : `http://memento-mcp:3001/mcp` (Docker) ou `http://VOTRE_IP:3001/mcp`
4. **Authentication** : Header Auth
- Header Name : `x-api-key`
- Header Value : votre cle API (`mcp_sk_...`)
Si tu as accès aux variables d'environnement de N8N:
### Alternative : curl
```bash
export N8N_MCP_SERVERS='{
"memento": {
"transport": "sse",
"url": "http://172.26.64.1:3001/sse"
}
}'
```
# Health check
curl -H "x-api-key: mcp_sk_votrecle" http://localhost:3001/
Ou dans Docker:
```yaml
environment:
- N8N_MCP_SERVERS={"memento":{"transport":"sse","url":"http://172.26.64.1:3001/sse"}}
```
# Lister les outils
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-H "x-api-key: mcp_sk_votrecle" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}'
### Option 3: Via Fichier de Configuration
Si N8N utilise un fichier config:
```json
{
"mcpServers": {
"memento": {
"transport": "sse",
"url": "http://172.26.64.1:3001/sse"
# Creer une note
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-H "x-api-key: mcp_sk_votrecle" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "create_note",
"arguments": {
"title": "Ma note",
"content": "Contenu de la note"
}
}
}
}
}'
```
## 🛠️ 9 Tools Disponibles
## Outils disponibles (22)
Une fois configuré, tu peux appeler ces tools depuis N8N:
### Notes (11)
### 1. create_note
```json
{
"tool": "create_note",
"arguments": {
"content": "Ma note de test",
"title": "Titre optionnel",
"color": "blue",
"type": "text",
"images": ["data:image/png;base64,..."]
}
}
```
| Outil | Description |
|-------|-------------|
| `create_note` | Creer une note |
| `get_notes` | Lister les notes |
| `get_note` | Recuperer une note par ID |
| `update_note` | Modifier une note |
| `delete_note` | Supprimer une note |
| `search_notes` | Rechercher par mot-cle |
| `move_note` | Deplacer vers un notebook |
| `toggle_pin` | Epingler/Depingler |
| `toggle_archive` | Archiver/Desarchiver |
| `export_notes` | Exporter en JSON |
| `import_notes` | Importer depuis JSON |
### 2. get_notes
```json
{
"tool": "get_notes",
"arguments": {
"includeArchived": false,
"search": "optionnel"
}
}
```
### Notebooks (6)
### 3. get_note
```json
{
"tool": "get_note",
"arguments": {
"id": "note_id_ici"
}
}
```
| Outil | Description |
|-------|-------------|
| `create_notebook` | Creer un notebook |
| `get_notebooks` | Lister les notebooks |
| `get_notebook` | Details d'un notebook |
| `update_notebook` | Modifier un notebook |
| `delete_notebook` | Supprimer un notebook |
| `reorder_notebooks` | Reordonner |
### 4. update_note
```json
{
"tool": "update_note",
"arguments": {
"id": "note_id_ici",
"title": "Nouveau titre",
"isPinned": true
}
}
```
### Labels (4)
### 5. delete_note
```json
{
"tool": "delete_note",
"arguments": {
"id": "note_id_ici"
}
}
```
| Outil | Description |
|-------|-------------|
| `create_label` | Creer un label |
| `get_labels` | Lister les labels |
| `update_label` | Modifier un label |
| `delete_label` | Supprimer un label |
### 6. search_notes
```json
{
"tool": "search_notes",
"arguments": {
"query": "recherche"
}
}
```
### Rappels (1)
### 7. get_labels
```json
{
"tool": "get_labels",
"arguments": {}
}
```
| Outil | Description |
|-------|-------------|
| `get_due_reminders` | Recuperer les rappels dus |
### 8. toggle_pin
```json
{
"tool": "toggle_pin",
"arguments": {
"id": "note_id_ici"
}
}
```
## Endpoints HTTP
### 9. toggle_archive
```json
{
"tool": "toggle_archive",
"arguments": {
"id": "note_id_ici"
}
}
```
| Endpoint | Methode | Description |
|----------|---------|-------------|
| `/` | GET | Health check |
| `/mcp` | GET/POST | Endpoint MCP principal |
| `/sse` | GET/POST | Legacy (redirige vers `/mcp`) |
| `/sessions` | GET | Sessions actives |
## 🚀 Démarrage du Serveur SSE
## Securite
### Méthode 1: Script PowerShell (Simple)
```powershell
cd D:\dev_new_pc\Keep\mcp-server
.\start-sse.ps1
```
- **Authentification obligatoire** en production (`MCP_REQUIRE_AUTH=true` dans Docker)
- Les cles API sont gerees depuis **Parametres > MCP** dans Memento
- Chaque cle est scopee a un utilisateur : seules ses notes sont accessibles
- Les cles sont hashees en base (SHA256), seul le raw key est montre a la creation
### Méthode 2: npm
```bash
cd D:\dev_new_pc\Keep\mcp-server
npm run start:sse
```
### Méthode 3: Node direct
```bash
cd D:\dev_new_pc\Keep\mcp-server
node index-sse.js
```
Le serveur démarrera sur:
- **Local**: http://localhost:3001
- **Réseau**: http://172.26.64.1:3001
- **SSE Endpoint**: http://172.26.64.1:3001/sse
## ✅ Vérification
### Test 1: Health Check (depuis ton PC)
```powershell
Invoke-RestMethod -Uri "http://localhost:3001/"
```
### Test 2: Health Check (depuis N8N)
```bash
curl http://172.26.64.1:3001/
```
### Test 3: Workflow N8N
Crée un workflow avec:
1. **Manual Trigger**
2. **MCP Client** node:
- Server: `memento`
- Tool: `get_notes`
- Arguments: `{}`
3. **Code** node pour voir le résultat
## 🔥 Troubleshooting
### Erreur: "Connection refused"
✅ Vérifie que le serveur SSE tourne:
```powershell
Get-Process | Where-Object { $_.ProcessName -eq "node" }
```
### Erreur: "Cannot reach server"
✅ Vérifie le firewall Windows:
```powershell
# Ajouter règle firewall pour port 3001
New-NetFirewallRule -DisplayName "Memento MCP SSE" -Direction Inbound -LocalPort 3001 -Protocol TCP -Action Allow
```
### Erreur: "SSE connection timeout"
✅ Vérifie que N8N peut atteindre ton PC:
```bash
# Depuis la machine N8N
ping 172.26.64.1
curl http://172.26.64.1:3001/
```
### N8N sur Docker?
Si N8N tourne dans Docker, utilise l'IP de l'hôte Docker, pas `172.26.64.1`.
Trouve l'IP du host:
```bash
docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' <container_id>
```
## 📊 Ports Utilisés
## Ports
| Service | Port | URL |
|---------|------|-----|
| Next.js (Memento UI) | 3000 | http://localhost:3000 |
| MCP SSE Server | 3001 | http://172.26.64.1:3001/sse |
| REST API | 3000 | http://localhost:3000/api/notes |
## 🔐 Sécurité
⚠️ **ATTENTION**: Le serveur SSE n'a **PAS D'AUTHENTIFICATION** actuellement!
Pour production:
1. Ajoute une clé API
2. Utilise HTTPS avec certificat SSL
3. Restreins les CORS origins
4. Utilise un reverse proxy (nginx)
## 📚 Documentation Complète
- [MCP-SSE-ANALYSIS.md](../MCP-SSE-ANALYSIS.md) - Analyse détaillée SSE
- [README-SSE.md](README-SSE.md) - Documentation serveur SSE
- [README.md](../README.md) - Documentation projet
## 🎉 C'est Prêt!
Ton serveur MCP SSE est configuré et prêt pour N8N!
**Endpoint N8N**: `http://172.26.64.1:3001/sse`
---
**Dernière mise à jour**: 4 janvier 2026
**IP**: 172.26.64.1
**Port**: 3001
**Status**: ✅ Opérationnel
| Memento UI | 3000 | http://localhost:3000 |
| MCP Server | 3001 | http://localhost:3001/mcp |