@node9/proxy 1.5.5 → 1.7.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 +70 -8
- package/dist/cli.js +784 -171
- package/dist/cli.mjs +782 -169
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,10 +20,10 @@ While others try to _guess_ if a prompt is malicious (Semantic Security), Node9
|
|
|
20
20
|
| | |
|
|
21
21
|
| ------------------------------------------------- | -------------------------------------------------- |
|
|
22
22
|
| [💎 The Aha Moment](#-the-aha-moment) | [🌐 MCP Gateway](#-mcp-gateway) |
|
|
23
|
-
| [⚡ Key Features](#-key-features) | [
|
|
24
|
-
| [🎮 Try it Live](#-try-it-live) | [
|
|
25
|
-
| [🚀 Quick Start](#-quick-start) | [
|
|
26
|
-
| [🛡️ How Protection Works](#️-how-protection-works) | [
|
|
23
|
+
| [⚡ Key Features](#-key-features) | [🤖 MCP Server](#-node9-mcp-server) |
|
|
24
|
+
| [🎮 Try it Live](#-try-it-live) | [🔗 Config Precedence](#-configuration-precedence) |
|
|
25
|
+
| [🚀 Quick Start](#-quick-start) | [⚙️ Custom Rules](#️-custom-rules-advanced) |
|
|
26
|
+
| [🛡️ How Protection Works](#️-how-protection-works) | [🖥️ CLI Reference](#️-cli-reference) |
|
|
27
27
|
| [🛠 Protection Modes](#-protection-modes) | [🗺️ Roadmap](#️-roadmap) |
|
|
28
28
|
|
|
29
29
|
---
|
|
@@ -32,10 +32,6 @@ While others try to _guess_ if a prompt is malicious (Semantic Security), Node9
|
|
|
32
32
|
|
|
33
33
|
**AIs are literal.** When you ask an agent to "Fix my disk space," it might decide to run `docker system prune -af`.
|
|
34
34
|
|
|
35
|
-
<p align="center">
|
|
36
|
-
<img src="https://github.com/user-attachments/assets/afae9caa-0605-4cac-929a-c14198383169" width="100%">
|
|
37
|
-
</p>
|
|
38
|
-
|
|
39
35
|
**With Node9, the interaction looks like this:**
|
|
40
36
|
|
|
41
37
|
1. **🤖 AI attempts a "Nuke":** `Bash("docker system prune -af --volumes")`
|
|
@@ -359,6 +355,70 @@ When Node9 blocks an MCP tool call, it returns a structured JSON-RPC error that
|
|
|
359
355
|
|
|
360
356
|
---
|
|
361
357
|
|
|
358
|
+
## 🤖 Node9 MCP Server
|
|
359
|
+
|
|
360
|
+
The Node9 MCP Server exposes node9 capabilities — starting with undo — as native MCP tools that Claude, Cursor, and Gemini can call directly. Unlike the MCP Gateway (which wraps _other_ servers), this server is node9's own surface.
|
|
361
|
+
|
|
362
|
+
```
|
|
363
|
+
Claude / Cursor / Gemini (MCP client)
|
|
364
|
+
↓ stdio (JSON-RPC 2.0)
|
|
365
|
+
Node9 MCP Server ← this process
|
|
366
|
+
↓ direct function calls
|
|
367
|
+
~/.node9/snapshots.json ← undo history
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Setup
|
|
371
|
+
|
|
372
|
+
The MCP server is registered **automatically** during `node9 init` or `node9 setup`. No separate step needed. What gets added to your agent config:
|
|
373
|
+
|
|
374
|
+
```json
|
|
375
|
+
{
|
|
376
|
+
"mcpServers": {
|
|
377
|
+
"node9": {
|
|
378
|
+
"command": "node9",
|
|
379
|
+
"args": ["mcp-server"]
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Available Tools
|
|
386
|
+
|
|
387
|
+
| Tool | Description |
|
|
388
|
+
| :------------------ | :-------------------------------------------------------------------- |
|
|
389
|
+
| `node9_undo_list` | List snapshot history — hash, tool, summary, files changed, timestamp |
|
|
390
|
+
| `node9_undo_revert` | Revert the working directory to a specific snapshot hash |
|
|
391
|
+
|
|
392
|
+
### Example — Claude using the MCP server
|
|
393
|
+
|
|
394
|
+
```
|
|
395
|
+
You: revert the last change node9 captured
|
|
396
|
+
|
|
397
|
+
Claude: Let me check the snapshot history first.
|
|
398
|
+
[calls node9_undo_list]
|
|
399
|
+
|
|
400
|
+
[1] a3f2c1d 4/4/2026, 18:15 Write — src/undo.ts (3 files) cwd: /home/user/myproject
|
|
401
|
+
full hash: a3f2c1d8e9b0f1a2b3c4d5e6f7a8b9c0d1e2f3a4
|
|
402
|
+
|
|
403
|
+
I'll revert to snapshot a3f2c1d.
|
|
404
|
+
[calls node9_undo_revert with hash: "a3f2c1d8e9b0f1a2b3c4d5e6f7a8b9c0d1e2f3a4"]
|
|
405
|
+
|
|
406
|
+
Successfully reverted to snapshot a3f2c1d in /home/user/myproject.
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Manual testing
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
npm run build
|
|
413
|
+
node dist/cli.js mcp-server
|
|
414
|
+
# paste JSON-RPC lines:
|
|
415
|
+
{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"test"},"capabilities":{}}}
|
|
416
|
+
{"jsonrpc":"2.0","method":"tools/list","id":2}
|
|
417
|
+
{"jsonrpc":"2.0","method":"tools/call","id":3,"params":{"name":"node9_undo_list","arguments":{}}}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
362
422
|
## 🔗 Configuration Precedence
|
|
363
423
|
|
|
364
424
|
Node9 merges configuration from multiple sources in priority order. Higher tiers win:
|
|
@@ -582,6 +642,7 @@ When the daemon is not running the HUD shows `🛡 node9 | offline` instead of a
|
|
|
582
642
|
| `node9 explain <tool> [args]` | Trace the policy waterfall for a given tool call (dry-run, no approval prompt) |
|
|
583
643
|
| `node9 undo [--steps N]` | Revert the last N AI file edits using shadow Git snapshots |
|
|
584
644
|
| `node9 mcp-gateway --upstream <cmd>` | Wrap an MCP server with Node9 security — intercepts every tool call |
|
|
645
|
+
| `node9 mcp-server` | Run the Node9 MCP server — exposes undo and other tools to Claude, Cursor, and Gemini |
|
|
585
646
|
| `node9 check` | Called by agent hooks; evaluates a pending tool call and exits 0 (allow) or 1 (block) |
|
|
586
647
|
|
|
587
648
|
### `node9 doctor`
|
|
@@ -653,6 +714,7 @@ This can happen when the daemon's PID file (`~/.node9/daemon.pid`) is missing
|
|
|
653
714
|
- [x] **Content Scanner / DLP** (Detect and block secrets like AWS keys and Bearer tokens in-flight)
|
|
654
715
|
- [x] **Flight Recorder** (Real-time activity stream in browser dashboard and `node9 tail` terminal view)
|
|
655
716
|
- [x] **Universal MCP Gateway** (Transparent stdio proxy — wraps any MCP server for any AI agent: `node9 mcp-gateway --upstream <cmd>`)
|
|
717
|
+
- [x] **Node9 MCP Server** (Native MCP tools for Claude/Cursor/Gemini: `node9_undo_list`, `node9_undo_revert` — auto-registered by `node9 init`)
|
|
656
718
|
- [ ] **Cursor & Windsurf Hook** (Native hook support for AI-first IDEs)
|
|
657
719
|
- [ ] **VS Code Extension** (Approval requests in a native sidebar — no more OS popups)
|
|
658
720
|
- [ ] **Execution Sandboxing** (Simulate dangerous commands in a virtual FS before applying)
|