@fkom13/mcp-sftp-orchestrator 11.3.0 β†’ 11.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,294 +1,273 @@
1
- # πŸš€ MCP Orchestrator β€” SSH/SFTP Infrastructure Orchestration Server
1
+ # πŸš€ MCP Orchestrator β€” Serveur d'orchestration SSH/SFTP
2
2
 
3
- **Version** : 11.3.0
3
+ > **v11.8.0 Security Refresh** — Les 82 tools publient désormais les annotations MCP standard. `infra_overview` reste léger sans argument, mais `infra_overview { alias: "..." }` effectue une découverte live et corrèle Nginx/domaines, ports, Docker/Compose et services. Voir `CHANGELOG.md`.
4
+
5
+
6
+ **Version** : 11.8.0
7
+ **Tools** : 82
4
8
  **License** : MIT
5
- **Node** : >= 18.0.0
9
+ **Node** : >= 18.0.0
10
+ **Changelog** : [CHANGELOG.md](./CHANGELOG.md)
6
11
 
7
- A Model Context Protocol (MCP) server that turns any AI agent (Claude, OpenCode, Cursor...) into a full-fledged system administrator. Persistent queue, SSH connection pool, hybrid sync/async execution.
12
+ Serveur MCP (Model Context Protocol, transport **stdio**) qui donne Γ  un agent IA la capacitΓ© d’orchestrer un parc de serveurs : SSH, SFTP, Γ©dition de fichiers locale/remote (hash-safe), diffs cross-server, shell PTY, snapshots d’infra, notes de protocole, **projets**, **sessions de travail**, inventaire, trust SSH (pubkey), groupes d’alias et audit parc.
13
+
14
+ ---
8
15
 
9
- ### ✨ Key Features
10
- - **63 MCP tools** β€” SSH, SFTP, file ops, monitoring, snapshots, tunnels
11
- - **Built-in security** β€” Command blocklist, port allowlist, hash protection
12
- - **Multi-server** β€” `task_exec {alias:["vps1","vps2"]}` or `alias:"all"}`
13
- - **Persistence** β€” tmux + persistent queue = sessions that survive crashes
14
- - **Snapshots** β€” Deduplicated versioning of your critical files
15
- - **SSH Tunnels** β€” Local, Remote, SOCKS5 with secured port allowlist
16
- - **AI Guide** β€” Built-in manual for the agent (section:index/workflows/audit/security)
16
+ ## ✨ Points forts (v11.6)
17
17
 
18
- > **πŸ‡«πŸ‡· Version franΓ§aise :** [README.fr.md](README.fr.md)
18
+ | Domaine | CapacitΓ© |
19
+ |---------|----------|
20
+ | **ExΓ©cution** | `task_exec` multi-serveur / `group:oci` / dry-run destructif / force |
21
+ | **Fichiers** | `file_read` / `file_edit` (chirurgical) / `file_write` + hash + dryRun + backup |
22
+ | **Parc** | notes, `infra_audit`, `fleet_status`, `server_inventory` |
23
+ | **Projets** | registre local↔remote + `project_diff` |
24
+ | **Travail** | `work_start` β†’ edits β†’ `work_end` (note d’intervention auto) |
25
+ | **Trust** | `ssh_authorize_key` (pubkey only, dry_run par dΓ©faut) |
26
+ | **SΓ©cu** | secrets masquΓ©s, RO global + **RO par alias**, blocklist, pool SSH robuste |
19
27
 
20
28
  ---
21
29
 
22
30
  ## πŸ“¦ Installation
23
31
 
24
- ### Via npx (recommended)
25
- ```bash
26
- npx @fkom13/mcp-sftp-orchestrator
27
- ```
28
-
29
- ### Via git
30
32
  ```bash
31
33
  git clone https://github.com/fkom13/mcp-sftp-orchestrator.git
32
- cd mcp-sftp-orchestrator
34
+ cd sftp-mcp # ou tools/sftp-mcp
33
35
  npm install
34
36
  cp .env.example .env
35
- # Edit .env with your paths
37
+ # Γ‰diter MCP_DATA_DIR et chemins de clΓ©s
36
38
  ```
37
39
 
38
- Requirements: Node.js >= 18.0.0
40
+ PrΓ©requis : **Node.js >= 18**
39
41
 
40
42
  ---
41
43
 
42
- ## βš™οΈ Configuration (.env)
43
-
44
- All variables are optional. Defaults are designed for standard usage.
45
-
46
- | Variable | Default | Description |
47
- |----------|---------|-------------|
48
- | `MCP_DATA_DIR` | `~/.config/mcp-orchestrator` | Data directory (servers.json, apis.json, queue.json) |
49
- | `MCP_SYNC_TIMEOUT_S` | `120` | Seconds before background execution |
50
- | `MCP_DEFAULT_CMD_TIMEOUT_S` | `600` | Default SSH timeout (0 = unlimited) |
51
- | `MCP_INTERACTIVE_CMD_TIMEOUT_S` | `300` | Interactive command timeout (0 = unlimited) |
52
- | `MCP_MAX_WAIT_TIMEOUT_S` | `600` | Max timeout for `task_wait` |
53
- | `MAX_CONNECTIONS_PER_SERVER` | `5` | Max parallel SSH connections per server |
54
- | `MIN_CONNECTIONS_PER_SERVER` | `1` | Min pooled connections per server |
55
- | `IDLE_TIMEOUT` | `300000` | Idle connection close delay (ms) |
56
- | `KEEP_ALIVE_INTERVAL` | `30000` | SSH keepalive interval (ms) |
57
- | `MAX_QUEUE_SIZE` | `1000` | Max jobs in queue |
58
- | `SAVE_INTERVAL` | `5000` | Queue disk save interval (ms) |
59
- | `MCP_ALLOWED_ROOTS` | *(empty)* | Restrict file access to these roots (comma-separated). Empty = full access |
60
- | `MCP_DEBUG` | `false` | Enable detailed debug logs |
44
+ ## βš™οΈ Configuration (`.env`)
45
+
46
+ Toutes les variables sont optionnelles.
47
+
48
+ | Variable | DΓ©faut | Description |
49
+ |----------|--------|-------------|
50
+ | `MCP_DATA_DIR` | `~/.config/mcp-orchestrator` | Dossier data (JSON, snapshots, projets…) |
51
+ | `MCP_SYNC_TIMEOUT_S` | `120` | DΓ©lai (s) avant passage d’une tΓ’che en arriΓ¨re-plan |
52
+ | `MCP_DEFAULT_CMD_TIMEOUT_S` | `600` | Timeout SSH commande (s). `0` = infini |
53
+ | `MCP_INTERACTIVE_CMD_TIMEOUT_S` | `300` | Timeout interactif (s). `0` = infini |
54
+ | `MCP_MAX_WAIT_TIMEOUT_S` | `600` | Timeout max `task_wait` (s) |
55
+ | `MAX_CONNECTIONS_PER_SERVER` | `5` | Pool SSH max / serveur |
56
+ | `MIN_CONNECTIONS_PER_SERVER` | `1` | Pool SSH min / serveur |
57
+ | `IDLE_TIMEOUT` | `300000` | Fermeture connexion inactive (ms) |
58
+ | `KEEP_ALIVE_INTERVAL` | `30000` | Keepalive SSH (ms) |
59
+ | `MAX_QUEUE_SIZE` | `1000` | Taille max queue jobs |
60
+ | `SAVE_INTERVAL` | `5000` | Autosave queue (ms) |
61
+ | `MCP_ALLOWED_ROOTS` | _(vide)_ | Racines autorisΓ©es pour paths locaux (CSV) |
62
+ | `MCP_READONLY` | `false` | `1` = refuse Γ©critures / exec mutantes (global) |
63
+ | `MCP_COMPACT` | `false` | `1` = rΓ©ponses tronquΓ©es (tokens agent) |
64
+ | `MCP_DEBUG` | `false` | Logs dΓ©taillΓ©s stderr |
65
+
66
+ ### Fichiers sous `MCP_DATA_DIR`
67
+
68
+ | Fichier | Contenu |
69
+ |---------|---------|
70
+ | `servers.json` | Alias SSH (`host`, `user`, `keyPath`/`password`, `port?`, `readonly?`) |
71
+ | `apis.json` | Catalogue APIs (secrets masquΓ©s en lecture tools) |
72
+ | `queue.json` / `queue.backup.json` | Jobs |
73
+ | `history.json` | Historique tΓ’ches |
74
+ | `server_notes.json` | Protocoles / notes par serveur |
75
+ | `server_groups.json` | Groupes d’alias |
76
+ | `projects.json` | Registre projets |
77
+ | `work_sessions.json` | Sessions de travail |
78
+ | `policies.json` | Blocklist commandes |
79
+ | `tunnels.json` / `tunnel_allowlist.json` | Tunnels SSH |
80
+ | `infra_snapshots/` | Snapshots content-addressable |
61
81
 
62
82
  ---
63
83
 
64
- ## πŸ”Œ MCP Client Configuration (OpenCode, Claude Desktop, etc.)
84
+ ## πŸ”Œ Connexion client MCP
85
+
86
+ ### Grok / config.toml
87
+
88
+ ```toml
89
+ [mcp_servers.orchestrator]
90
+ command = "node"
91
+ args = ["/chemin/absolu/sftp-mcp/server.js"]
92
+ # optionnel:
93
+ # env = { MCP_DATA_DIR = "/chemin/absolu/sftp-mcp/data" }
94
+ ```
95
+
96
+ ### OpenCode / Claude Desktop (JSON)
65
97
 
66
98
  ```json
67
99
  {
68
100
  "mcpServers": {
69
101
  "orchestrator": {
70
102
  "command": "node",
71
- "args": ["/path/to/sftp-mcp/server.js"],
103
+ "args": ["/chemin/absolu/sftp-mcp/server.js"],
72
104
  "env": {
73
- "MCP_DATA_DIR": "/path/to/sftp-mcp/data"
105
+ "MCP_DATA_DIR": "/chemin/absolu/sftp-mcp/data"
74
106
  }
75
107
  }
76
108
  }
77
109
  }
78
110
  ```
79
111
 
80
- ---
81
-
82
- ## 🧰 Tool Reference (63 tools)
83
-
84
- ### Help & Diagnostics
85
- | Tool | Description |
86
- |------|-------------|
87
- | `help` | Complete guide: tools, env vars, parameter schemas |
88
- | `guide` | AI manual: workflows, cheatsheet, audit, security |
89
- | `system_diagnostics` | Full system diagnostic (queue, pool, servers, APIs) |
90
-
91
- ### Server Management
92
- | Tool | Description |
93
- |------|-------------|
94
- | `server_add` | Add/update a server alias |
95
- | `server_list` | List all configured servers |
96
- | `server_remove` | Remove a server alias |
97
- | `infra_overview` | Fleet-wide overview (roles, services, warnings) |
98
- | `server_note_set/get/list/remove` | Documented server context |
99
-
100
- ### Security (Blocklist)
101
- | Tool | Description |
102
- |------|-------------|
103
- | `policy_blocklist_list` | List blocked commands |
104
- | `policy_blocklist_add` | Add a pattern to blocklist |
105
- | `policy_blocklist_remove` | Remove a pattern from blocklist |
106
-
107
- ### Task Execution
108
- | Tool | Description |
109
- |------|-------------|
110
- | `task_exec` | SSH one-shot. Supports `alias:["vps1","vps2"]` or `alias:"all"` |
111
- | `task_exec_interactive` | SSH with interactive prompt handling |
112
- | `task_exec_sequence` | Sequential SSH commands |
113
- | `task_transfer` | SFTP transfer. Supports `server_to_server` |
114
- | `task_transfer_multi` | Bulk transfers with glob patterns |
115
-
116
- ### Monitoring
117
- | Tool | Description |
118
- |------|-------------|
119
- | `get_system_resources` | CPU, RAM, Disk metrics |
120
- | `get_services_status` | systemd, Docker, PM2 status (graceful fallback) |
121
- | `get_fail2ban_status` | Fail2Ban status |
122
- | `check_api_health` | HTTP health check |
123
-
124
- ### Logs
125
- | Tool | Description |
126
- |------|-------------|
127
- | `get_pm2_logs` | PM2 logs |
128
- | `get_docker_logs` | Docker logs |
129
- | `tail_file` | Tail a remote file |
130
-
131
- ### File Operations (Local + Remote)
132
- | Tool | Description |
133
- |------|-------------|
134
- | `file_read` | Read file + SHA-256 hash (edit protection) |
135
- | `file_write` | Create/overwrite with `dryRun` and `backup` |
136
- | `file_edit` | Surgical or full edit + hash protection |
137
-
138
- ### Comparison & Drift Detection
139
- | Tool | Description |
140
- |------|-------------|
141
- | `diff_files` | Compare 2 files (local/remote, cross-server) |
142
- | `diff_folders` | Compare 2 directories |
143
- | `compare_all_sources` | Detect drifts across N servers |
144
-
145
- ### Persistent Shell Sessions
146
- | Tool | Description |
147
- |------|-------------|
148
- | `shell_create` | Open a persistent shell (cd/env preserved) |
149
- | `shell_exec` | Execute in an existing session |
150
- | `shell_list` / `shell_close` | List/close sessions |
151
-
152
- ### tmux (Surviving Terminal Sessions)
153
- | Tool | Description |
154
- |------|-------------|
155
- | `tmux_create` | Create a persistent tmux session |
156
- | `tmux_exec` | Send a command to a session |
157
- | `tmux_read` | Read session buffer |
158
- | `tmux_list` / `tmux_kill` | List/kill sessions |
159
-
160
- ### SSH Tunnels
161
- | Tool | Description |
162
- |------|-------------|
163
- | `tunnel_create` | Local/remote/SOCKS5 tunnel, persistent via tmux |
164
- | `tunnel_list` | List active tunnels |
165
- | `tunnel_close` | Close a tunnel |
166
- | `tunnel_allowlist_add/remove` | Manage allowed ports |
167
-
168
- ### Snapshots (File Versioning)
169
- | Tool | Description |
170
- |------|-------------|
171
- | `snapshot_create` | Capture file state with deduplication |
172
- | `snapshot_list` | List snapshots |
173
- | `snapshot_diff` | Compare 2 snapshots |
174
- | `snapshot_restore` | Restore (dryRun by default) |
175
- | `snapshot_delete` | Delete + orphan cleanup |
176
-
177
- ### Queue & Monitoring
178
- | Tool | Description |
179
- |------|-------------|
180
- | `task_queue` | View all active/pending tasks |
181
- | `task_status` | Task detail by ID |
182
- | `task_history` | Filterable history |
183
- | `task_retry` | Retry a failed task |
184
- | `task_wait` | Wait for a background task |
185
- | `task_logs` | MCP internal logs |
186
- | `queue_stats` / `pool_stats` | Queue and SSH pool stats |
187
-
188
- ### API Catalog
189
- | Tool | Description |
190
- |------|-------------|
191
- | `api_add` / `api_list` / `api_remove` | API monitoring catalog |
192
- | `api_check` | Health check via SSH + curl |
112
+ Après modification du code : recharger le serveur MCP (`/mcps` → `r` ou restart session). Vérifier `system_diagnostics` → `version: "11.8.0"`.
193
113
 
194
114
  ---
195
115
 
196
- ## πŸ“– Usage Examples
197
-
198
- ### Multi-server
199
- ```bash
200
- # One command, multiple servers
201
- task_exec {alias:["vps1","vps2","vps3"], cmd:"uptime"}
116
+ ## 🧰 Référence des outils (82)
117
+
118
+ ### Diagnostic & audit
119
+ | Outil | Description |
120
+ |-------|-------------|
121
+ | `help` | Guide outils + .env + astuces |
122
+ | `guide` | Manuel IA (workflows, cheatsheet, pitfalls, audit, security) |
123
+ | `system_diagnostics` | Queue, pool, serveurs/APIs **masquΓ©s**, version, readOnly |
124
+ | `infra_audit` | Synthèse parc + projets + notes + crashed |
125
+ | `infra_overview` | Serveurs + notes (vue légère) |
126
+ | `fleet_status` | Ping SSH parallèle (latence, load, disk) |
127
+ | `server_inventory` | Inventaire lΓ©ger (pm2/docker/disk/home, cache 10 min) |
128
+
129
+ ### Serveurs & groupes
130
+ | Outil | Description |
131
+ |-------|-------------|
132
+ | `server_add` | CRUD alias (`keyPath` ou `password`, `port`, **`readonly`**) |
133
+ | `server_list` | Liste (passwords masquΓ©s) |
134
+ | `server_remove` | Supprime un alias |
135
+ | `server_group_list/set/remove` | Groupes (`oci`, `contabo`…). Usage : `group:oci` ou nom de groupe |
136
+
137
+ ### Projets (v11.6)
138
+ | Outil | Description |
139
+ |-------|-------------|
140
+ | `project_list` / `project_get` / `project_set` / `project_remove` | Registre |
141
+ | `project_resolve` | β†’ `{ local, remote, ignore, runtime }` |
142
+ | `project_diff` | Diff local↔remote du projet |
143
+
144
+ Exemple `project_set` :
202
145
 
203
- # Entire fleet
204
- task_exec {alias:"all", cmd:"df -h /"}
146
+ ```json
147
+ {
148
+ "name": "p-image",
149
+ "local": { "path": "/home/.../dev-serveur/p-image" },
150
+ "servers": {
151
+ "prod": {
152
+ "alias": "fkomprodmini2_prod",
153
+ "path": "/home/ubuntu/p-image",
154
+ "runtime": { "pm2": "p-image", "port": 5002 },
155
+ "url": "https://pruna.esprit-artificiel.com"
156
+ }
157
+ },
158
+ "ignore": ["node_modules", ".git", "data"]
159
+ }
205
160
  ```
206
161
 
207
- ### SOCKS5 Proxy Tunnel
208
- ```bash
209
- tunnel_create {name:"proxy", type:"socks", listen_port:1080, via:"vps_paris"}
210
- # β†’ Browser β†’ SOCKS5 127.0.0.1:1080 β†’ Paris VPS
211
- ```
162
+ ### Sessions de travail (v11.6)
163
+ | Outil | Description |
164
+ |-------|-------------|
165
+ | `work_start` | Ouvre un journal (`alias`, `project`, `tag`, snapshot optionnel) |
166
+ | `work_log` | Event (`file_edit`, `task_exec`, …) |
167
+ | `work_list` | Sessions actives (+ historique) |
168
+ | `work_end` | ClΓ΄ture + `server_note` `last_intervention` |
212
169
 
213
- ### Local Tunnel (access remote service)
214
- ```bash
215
- tunnel_create {name:"crm", type:"local", listen_port:8080, target:"127.0.0.1:3100", via:"vps_prod"}
216
- # β†’ http://localhost:8080 β†’ production CRM
217
- ```
170
+ ### Trust SSH (v11.6)
171
+ | Outil | Description |
172
+ |-------|-------------|
173
+ | `ssh_authorize_key` | Ajoute une **pubkey** dans `authorized_keys` distant. `dry_run` dΓ©faut. Sources : `string` \| `local_path` \| `alias` |
218
174
 
219
- ### Remote Tunnel (expose local service)
220
- ```bash
221
- tunnel_create {name:"dev", type:"remote", listen_port:9090, target:"127.0.0.1:3000", via:"vps", source:"vps_prod", key_path:"/home/user/.ssh/vps.key"}
222
- # β†’ vps_prod:9090 β†’ your local machine:3000
175
+ ```json
176
+ {
177
+ "target_alias": "fkomprodmini1_prod",
178
+ "source": { "type": "alias", "alias": "vps_contabo" },
179
+ "comment": "fleet-from-contabo",
180
+ "dry_run": true
181
+ }
223
182
  ```
224
183
 
225
- ### Persistent tmux Session
226
- ```bash
227
- tmux_create {alias:"vps", name:"build", start_cmd:"npm run build"}
228
- tmux_read {alias:"vps", session:"build"}
229
- tmux_kill {alias:"vps", session:"build"}
230
- ```
184
+ ### Policies
185
+ | Outil | Description |
186
+ |-------|-------------|
187
+ | `policy_blocklist_list/add/remove` | Blocklist commandes (aussi appliquΓ©e Γ  shell + sequences) |
188
+
189
+ ### Catalogue API
190
+ | Outil | Description |
191
+ |-------|-------------|
192
+ | `api_add` / `api_list` / `api_remove` / `api_check` | Monitoring (clΓ©s masquΓ©es en list) |
193
+
194
+ ### ExΓ©cution de tΓ’ches
195
+ | Outil | Description |
196
+ |-------|-------------|
197
+ | `task_exec` | SSH ; alias \| tableau \| `all` \| `group:x` ; dry_run/force destructif |
198
+ | `task_exec_interactive` | Prompts yes/no, menus |
199
+ | `task_exec_sequence` | SΓ©quence sur un serveur (policy par Γ©tape) |
200
+ | `task_transfer` | SFTP upload/download/`server_to_server` |
201
+ | `task_transfer_multi` | Multi + globs |
202
+
203
+ ### Files / Diff / Shell / Snapshots
204
+ | Famille | Outils |
205
+ |---------|--------|
206
+ | Files | `file_read`, `file_write`, `file_edit` |
207
+ | Diff | `diff_files`, `diff_folders`, `compare_all_sources` |
208
+ | Shell | `shell_create`, `shell_exec` (+ `skip_policy`), `shell_list`, `shell_close` |
209
+ | Snapshots | `snapshot_create/list/diff/restore/delete` |
210
+
211
+ **Γ‰dition safe** : `file_read` β†’ hash β†’ `file_edit` + `expectedHash` (+ `dryRun` / `backup`).
212
+
213
+ ### Notes serveur
214
+ | Outil | Description |
215
+ |-------|-------------|
216
+ | `server_note_set/get/list/remove` | Protocole (description, services, warnings, intervention) |
217
+
218
+ ### Monitoring & logs
219
+ | Outil | Description |
220
+ |-------|-------------|
221
+ | `get_system_resources` | CPU / RAM / disque |
222
+ | `get_services_status` | systemd / Docker / PM2 |
223
+ | `get_fail2ban_status` | Fail2Ban |
224
+ | `check_api_health` | HTTP via SSH+curl |
225
+ | `get_pm2_logs` / `get_docker_logs` / `tail_file` | Logs |
226
+
227
+ ### Queue
228
+ | Outil | Description |
229
+ |-------|-------------|
230
+ | `task_queue` / `task_status` / `task_history` / `task_wait` / `task_logs` | Suivi |
231
+ | `task_retry` / `task_retry_all` | Relance |
232
+ | `task_purge` | Purge (dry_run dΓ©faut) |
233
+ | `queue_stats` / `pool_stats` | Stats |
234
+
235
+ ### Tmux & tunnels
236
+ | Outil | Description |
237
+ |-------|-------------|
238
+ | `tmux_create/exec/read/list/kill` | Sessions tmux distantes |
239
+ | `tunnel_create/list/close` | Tunnels SSH local/remote/socks |
240
+ | `tunnel_allowlist_add/remove` | Ports autorisΓ©s pour tunnels |
231
241
 
232
- ### Security Blocklist
233
- ```bash
234
- # List blocked commands
235
- policy_blocklist_list
236
- # β†’ ["rm -rf /", "mkfs*", ...]
242
+ ---
237
243
 
238
- # Conscious bypass
239
- task_exec {alias:"vps", cmd:"rm -rf /tmp/cache", skip_policy:true}
240
- ```
244
+ ## πŸ“– Workflows agent recommandΓ©s
241
245
 
242
- ### Secure File Editing
243
- ```bash
244
- # Read + hash
245
- file_read {source:{type:"remote", alias:"vps", path:"/etc/nginx/nginx.conf"}}
246
- # β†’ content + hash
247
-
248
- # Edit with protection
249
- file_edit {source:{type:"remote", alias:"vps", path:"/etc/nginx/nginx.conf"},
250
- oldString:"worker_connections 768;",
251
- newString:"worker_connections 1024;",
252
- expectedHash:"abc123...",
253
- backup:true}
254
-
255
- # Preview without writing
256
- file_edit {source:{type:"remote", alias:"vps", path:"/etc/nginx/nginx.conf"},
257
- oldString:"worker_connections 768;",
258
- newString:"worker_connections 1024;",
259
- dryRun:true}
246
+ ### DΓ©but de session
260
247
  ```
261
-
262
- ### Snapshot Before Risky Changes
263
- ```bash
264
- # Before
265
- snapshot_create {source:{type:"remote", alias:"vps"}, paths:["/etc/nginx/"], tag:"before-fix"}
266
-
267
- # After if something broke
268
- snapshot_restore {snapshotId:"...", target:{type:"remote", alias:"vps"}, dryRun:false, force:true}
248
+ infra_audit (ou infra_overview)
249
+ fleet_status
250
+ project_list / project_resolve
269
251
  ```
270
252
 
271
- ### Multi-server Drift Detection
272
- ```bash
273
- compare_all_sources {sources:[
274
- {type:"remote", alias:"vps1", path:"/etc/nginx/nginx.conf", label:"prod"},
275
- {type:"remote", alias:"vps2", path:"/etc/nginx/nginx.conf", label:"staging"}
276
- ]}
253
+ ### Chantier sur un projet
254
+ ```
255
+ work_start { project: "p-image", alias: "fkomprodmini2_prod", tag: "fix-x", message: "…" }
256
+ file_read β†’ file_edit (expectedHash, dryRun puis apply)
257
+ work_log { type: "file_edit", path: "…" }
258
+ work_end { summary: "…" } β†’ note serveur mise Γ  jour
259
+ project_diff { name: "p-image" }
277
260
  ```
278
261
 
279
- ---
280
-
281
- ## πŸ“š AI Built-in Manual (guide)
282
-
283
- The orchestrator includes an interactive manual for your AI agent:
262
+ ### Commandes longues
263
+ ```
264
+ task_exec { timeout: 0, … } β†’ si > syncTimeout β†’ task_wait { id }
265
+ ```
284
266
 
285
- ```bash
286
- guide section:index # Table of contents
287
- guide section:workflows # Copy-paste recipes
288
- guide section:cheatsheet # Tool β†’ usage table
289
- guide section:audit # Full fleet audit in 8 steps
290
- guide section:security # Blocklist + tunnels
291
- guide section:pitfalls # Common mistakes
267
+ ### Cibles multi-serveurs
268
+ ```
269
+ task_exec { alias: "group:oci", cmd: "hostname" }
270
+ task_exec { alias: "all", cmd: "uptime" }
292
271
  ```
293
272
 
294
273
  ---
@@ -296,79 +275,82 @@ guide section:pitfalls # Common mistakes
296
275
  ## πŸ—οΈ Architecture
297
276
 
298
277
  ```
299
- MCP Client (stdio)
278
+ Client MCP (stdio)
300
279
  β”‚
301
- server.js ─── 63 MCP tools registered
280
+ server.js ─── 82 tools
302
281
  β”‚
303
- β”œβ”€β”€ queue.js ─────── Persistent job queue (JSON + backup)
304
- β”œβ”€β”€ ssh.js ───────── SSH execution (pool + dedicated connections)
305
- β”œβ”€β”€ sftp.js ──────── SFTP transfers (upload/download/multi)
306
- β”œβ”€β”€ sshPool.js ───── Persistent SSH connection pool
307
- β”œβ”€β”€ servers.js ───── CRUD server aliases
308
- β”œβ”€β”€ apis.js ──────── CRUD API catalog
309
- β”œβ”€β”€ history.js ───── Task history
310
- β”œβ”€β”€ config.js ────── Centralized configuration
311
- β”œβ”€β”€ utils.js ─────── Utilities (escapeShellArg)
312
- β”œβ”€β”€ fileOps.js ───── File operations (read/write/edit)
313
- β”œβ”€β”€ diffEngine.js ── Diff engine (files/dirs/sources)
314
- β”œβ”€β”€ compareEngine.js ─ Multi-source comparison
315
- β”œβ”€β”€ diffFormatter.js ─ Diff formatting
316
- β”œβ”€β”€ sourceAdapter.js ─ Local/remote abstraction
317
- β”œβ”€β”€ shellSessions.js ─ Persistent shell sessions
318
- β”œβ”€β”€ snapshotManager.js ─ Versioned snapshots
319
- β”œβ”€β”€ notes.js ──────── Documented server context
320
- β”œβ”€β”€ policies.js ──── Command blocklist
321
- β”œβ”€β”€ tunnels.js ────── SSH tunnels (local/remote/SOCKS)
322
- β”œβ”€β”€ guide.js ──────── AI built-in manual
323
- └── diagnose.js ───── Diagnostics
282
+ β”œβ”€β”€ queue.js File d’attente persistante + purge/retry
283
+ β”œβ”€β”€ ssh.js / sshPool ExΓ©cution + pool (retry safe, port configurable)
284
+ β”œβ”€β”€ sftp.js Transferts (server_to_server via sourceAdapter/pool)
285
+ β”œβ”€β”€ sourceAdapter.js Local fs | remote SFTP pool
286
+ β”œβ”€β”€ fileOps.js Read/write/edit + hash + dryRun + backup
287
+ β”œβ”€β”€ diffEngine.js / compareEngine.js / diffFormatter.js
288
+ β”œβ”€β”€ shellSessions.js PTY persistants + policy
289
+ β”œβ”€β”€ snapshotManager.js
290
+ β”œβ”€β”€ projects.js / workSession.js / inventory.js / groups.js / fleet.js
291
+ β”œβ”€β”€ sshTrust.js authorized_keys (pubkey only)
292
+ β”œβ”€β”€ servers.js / apis.js / notes.js / policies.js / tunnels.js
293
+ β”œβ”€β”€ history.js / guide.js / config.js / utils.js
324
294
  ```
325
295
 
326
- ### Job Lifecycle
296
+ ### Cycle de vie d’un job
327
297
 
328
298
  ```
329
- pending β†’ running β†’ completed / failed
330
- ↓ (on restart)
331
- crashed β†’ retry β†’ pending
299
+ pending β†’ running β†’ completed | failed | partial
300
+ ↓ (redΓ©marrage MCP pendant running)
301
+ crashed β†’ task_retry β†’ pending
332
302
  ```
333
303
 
334
304
  ---
335
305
 
336
- ## πŸ”’ Security
306
+ ## πŸ”’ SΓ©curitΓ©
337
307
 
338
- - **Command Blocklist** : `rm -rf /`, `mkfs*`, fork bombs, and other destructive commands are blocked by default
339
- - **Conscious bypass** : `skip_policy: true` to force execution
340
- - **Tunnel port allowlist** : only explicitly allowed ports can be used
341
- - **File access restriction** : `MCP_ALLOWED_ROOTS` env var to limit file operations to specific directories
342
- - **`escapeShellArg()`** : all URLs and paths are escaped before being passed to curl/shell
343
- - **Plaintext secret detection** : warning on startup if passwords/API keys are in plaintext
344
- - **Pre-modification snapshots** : `backup:true` on file_edit/file_write for instant rollback
345
- - **Recommendation** : use SSH keys (not passwords), store secrets in Vaultwarden
308
+ | MΓ©canisme | DΓ©tail |
309
+ |-----------|--------|
310
+ | Secrets | MasquΓ©s en `api_list` / diagnostics (`***` + 4 derniers car.) |
311
+ | Shell escape | `escapeShellArg` sur curl, logs, chemins |
312
+ | Blocklist | `policies.json` ; shell + sequence inclus ; `skip_policy` pour forcer |
313
+ | RO global | `MCP_READONLY=1` |
314
+ | RO alias | `"readonly": true` dans `servers.json` |
315
+ | Destructif | `task_exec` dry-run si pattern dangereux sans `force:true` |
316
+ | Trust | Pubkey only ; dry_run par dΓ©faut |
317
+ | ClΓ©s | PrΓ©fΓ©rer `keyPath` SSH ; Vaultwarden pour secrets API |
346
318
 
347
319
  ---
348
320
 
349
321
  ## πŸ§ͺ Tests
350
322
 
351
323
  ```bash
352
- node diagnose.js # Full diagnostic
353
- node test_mcp.js # MCP smoke test
354
- node test_features.js # Unit tests (queue, pool, glob, prompts, crash)
324
+ npm test:unit # p0 + p1 + p16 (43 tests)
325
+ npm test # unit + smoke MCP + features
326
+ node diagnose.js # diagnostic local optionnel
355
327
  ```
356
328
 
329
+ | Fichier | Couverture |
330
+ |---------|------------|
331
+ | `test_p0_unit.js` | utils, policies, redact, timeouts, version |
332
+ | `test_p1_unit.js` | groups, purge, destructive, RO env |
333
+ | `test_p16_unit.js` | projects, work session, compact, sshTrust |
334
+ | `test_mcp.js` | smoke SDK |
335
+ | `test_features.js` | queue / pool / globs / prompts |
336
+
357
337
  ---
358
338
 
359
- ## πŸ›£οΈ Roadmap
339
+ ## πŸ›£οΈ Versions rΓ©centes
360
340
 
361
- | Version | Changes |
362
- |---------|---------|
363
- | 10.0.0 | New tools: file_read/write/edit, diff, snapshots, shell, notes |
364
- | 10.4.0 | server_to_server, help with schemas, audit guide |
365
- | 11.0.0 | Command Blocklist, Multi-host (`alias:"all"`), tmux |
366
- | 11.2.0 | SSH Tunnels (local/remote/SOCKS5), allowlist, ssh2 stderr fix |
367
- | 11.3.0 | AllowedRoots (`MCP_ALLOWED_ROOTS`) for file restriction |
368
- | 12.0.0 (planned) | Auto key setup for tunnels, webhooks, static dashboard |
341
+ | Version | Contenu | Snapshot gencodedoc |
342
+ |---------|---------|---------------------|
343
+ | **11.6.1** | Hardening multi-agent: RO transversal, server-to-server dossiers/force, allowed roots anti-symlink, quoting shell/tmux, queue + JSON stores atomiques | β€” |
344
+ | **11.6.0** | Projets, work sessions, inventory, ssh_authorize_key, RO alias, compact | **#23** (final docs) |
345
+ | 11.4.0 | fleet, infra_audit, groups, retry_all, purge, pool rewrite | #21 |
346
+ | 11.3.0 | Secrets mask, policy shell/seq, port SSH, wait partial | #20 |
347
+ | 10.4–10.0 | file ops, diff, shell, snapshots, notes, guide | #17–19 |
348
+ | 9.x / 8.x | SFTP force, timeouts, interactif, sΓ©cu de base | β€” |
349
+
350
+ DΓ©tail : **[CHANGELOG.md](./CHANGELOG.md)** Β· plans historiques : `ROADMAP.md`, `ROADMAP_EXTENDED.md`.
369
351
 
370
352
  ---
371
353
 
372
- ## πŸ“„ License
354
+ ## πŸ“„ Licence
373
355
 
374
356
  MIT β€” Copyright (c) 2025-2026 Franck (fkom13)