Skip to content

Commit 4922dfe

Browse files
node9aiandreykh89
andcommitted
feat(mcp): add MCP tool pinning — rug pull defense (PR #81)
Co-authored-by: andreykh89 <andreykh89@users.noreply.github.com>
2 parents ccfe6d4 + 75252d3 commit 4922dfe

File tree

9 files changed

+1192
-25
lines changed

9 files changed

+1192
-25
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ Wrap any MCP server transparently. The AI sees the same server — Node9 interce
8484

8585
Or use `node9 setup` — it wraps existing MCP servers automatically.
8686

87+
### MCP Tool Pinning — rug pull defense
88+
89+
MCP servers can change their tool definitions between sessions. A compromised or malicious server could silently add, remove, or modify tools after initial trust — a **rug pull** attack.
90+
91+
Node9 defends against this by **pinning** tool definitions on first use:
92+
93+
1. **First connection** — the gateway records a SHA-256 hash of all tool definitions
94+
2. **Subsequent connections** — the hash is compared; if tools changed, the session is **quarantined** and all tool calls are blocked until a human reviews and approves the change
95+
3. **Corrupt pin state** — fails closed (blocks), never silently re-trusts
96+
97+
```bash
98+
node9 mcp pin list # show all pinned servers and hashes
99+
node9 mcp pin update <serverKey> # remove pin, re-pin on next connection
100+
node9 mcp pin reset # clear all pins (re-pin on next connection)
101+
```
102+
103+
This is automatic — no configuration needed. The gateway pins on first `tools/list` and enforces on every subsequent session.
104+
87105
---
88106

89107
## Python SDK — govern any Python agent

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@node9/proxy",
3-
"version": "1.8.4",
3+
"version": "1.9.0",
44
"description": "The Sudo Command for AI Agents. Execution Security for Claude Code & MCP.",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

0 commit comments

Comments
 (0)