loading…
Search for a command to run...
loading…
A proxy server that wraps any MCP server, adding behavioral profiling, security scanning, risk gating, and safe execution to its tools.
A proxy server that wraps any MCP server, adding behavioral profiling, security scanning, risk gating, and safe execution to its tools.
MCP safety warden is a proxy server that wraps any MCP server and adds behavioral profiling, security scanning, risk gating, and safe execution to its tools.
Listed on the official MCP server registry
Use as a proxy to add safety gating to any MCP server, or point it at a server you don't own and run a full security audit without making a single tool call.
Fig 1. Two operating modes: proxy and audit
Behavioral profiling: Effect class, retry safety, destructiveness. LLM-assisted (Anthropic, OpenAI, Gemini, Ollama) with rule-based fallback. Observed stats (latency p50/p95, failure rate, output size) updated after every proxied call.
Security scanning: mcpsafety+ five-stage pipeline (Recon, Planner, Hacker, Auditor, Supervisor). Cisco AI Defense (AST/YARA). Snyk (metadata analysis). Kali and Burp Suite integrations enrich the pipeline with real network data and HTTP-layer probes. Source code scanning from GitHub with entropy, AST, taint flow, and rug-pull detection.
Fig 2. mcpsafety+ five-stage pipeline, triggered when you run a full security audit on any MCP server
Safe execution: Argument scanning (20+ attack categories, LLM second-pass). Two-layer output injection scanning. Risk gating with alternatives and per-tool policies. Drift detection on every call and standalone check.
Fig 3. Safe execution pipeline: the five checks every proxied tool call passes through
CLI: 17 subcommands, interactive risk menu, --json flag on every command, --yes for CI.
What it detects
Without a key the wrapper operates in rule-based-only mode: lower confidence tool classification, regex-only injection scanning, no alternatives in the risk gate, no mcpsafety+ pipeline. For a fully local setup, run Ollama, set OLLAMA_MODEL, and pass --provider ollama explicitly (Ollama is not auto-detected).
[!NOTE] stdio servers that require local setup (
stdioservers that need local configuration before starting - missing config files, credentials, data directories, or OS-specific dependencies) cannot be inspected by the wrapper - tool discovery will fail and 0 tools will be stored. You can still run a full source-code security scan without spawning the server by passing--github-urltoscan/onboard, or thegithub_urlparameter tosecurity_scan_server. The mcpsafety+ pipeline will fetch and analyze the source directly from GitHub.sseandstreamable_httpservers are not affected.
pip install mcpsafetywarden
With all optional extras:
pip install "mcpsafetywarden[all]"
Or specific extras:
pip install "mcpsafetywarden[anthropic,snyk]"
From source:
git clone https://github.com/gautamvarmadatla/mcpsafetywarden
cd mcpsafetywarden
pip install .
The SQLite database is created automatically on first run in the platform user data directory (~/.local/share/mcpsafetywarden/ on Linux, ~/Library/Application Support/mcpsafetywarden/ on macOS, %APPDATA%\mcpsafetywarden\ on Windows). Override with MCP_DB_PATH.
Optional: at-rest encryption for stored credentials
pip install cryptography
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
Set the printed key as MCP_DB_ENCRYPTION_KEY before starting the server.
All configuration is via environment variables.
| Variable | Default | Purpose |
|---|---|---|
MCP_TRANSPORT |
stdio |
Transport mode: stdio, sse, or streamable_http |
MCP_HOST |
127.0.0.1 |
Bind address for HTTP transports |
MCP_PORT |
8000 |
Bind port for HTTP transports |
MCP_AUTH_TOKEN |
(unset) | Bearer token for HTTP transport auth |
MCP_DB_ENCRYPTION_KEY |
(unset) | Fernet key to encrypt stored credentials at rest |
ANTHROPIC_API_KEY |
(unset) | Enables Anthropic as LLM provider |
OPENAI_API_KEY |
(unset) | Enables OpenAI as LLM provider |
GEMINI_API_KEY |
(unset) | Enables Gemini as LLM provider |
OLLAMA_MODEL |
(unset) | Model name for Ollama (e.g. llama3.1) |
OLLAMA_BASE_URL |
http://localhost:11434/v1 |
Ollama API base URL |
SNYK_TOKEN |
(unset) | Enables Snyk E001 prompt-injection detection |
MCP_SCANNER_API_KEY |
(unset) | Cisco AI Defense cloud ML engine key |
MCP_SCANNER_LLM_API_KEY |
(unset) | LLM key for Cisco internal AST analysis |
MCP_DB_PATH |
(unset) | Override the SQLite database file path |
GITHUB_TOKEN |
(unset) | GitHub personal access token for source-code scanning (raises rate limit from 60 to 5,000 req/hour) |
Security note: Never commit API keys or the encryption key. The wrapper strips its own secrets from child process environments before spawning stdio servers.
Add the wrapper to claude_desktop_config.json:
{
"mcpServers": {
"mcpsafetywarden": {
"command": "mcpsafetywarden-server",
"args": [],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-...",
"MCP_DB_ENCRYPTION_KEY": "<generated_fernet_key>"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/yourname/Documents"]
}
}
}
Register each server with the wrapper before use:
mcpsafetywarden register filesystem --transport stdio \
--command npx \
--args '["-y", "@modelcontextprotocol/server-filesystem", "/Users/yourname/Documents"]'
For a mandatory gateway setup where all tool calls must go through the wrapper, see docs/DEPLOYMENT.md.
See docs/TOOLS.md for the full tool reference.
| Tool | What it does |
|---|---|
onboard_server |
Register + inspect + security scan in one call |
register_server |
Register a server; optionally auto-inspect |
inspect_server |
Refresh tool list and profiles |
check_server_drift |
Detect schema and tool-list drift against stored baseline |
list_servers |
List all registered servers |
list_server_tools |
List tools on a server with summary profiles |
preflight_tool_call |
Risk assessment without execution |
safe_tool_call |
Execute with risk gating and alternatives |
get_tool_profile |
Full behavior profile with observed stats |
get_retry_policy |
Retry and timeout recommendations |
suggest_safer_alternative |
LLM-ranked safer substitutes |
run_replay_test |
Idempotency test (calls tool twice) |
security_scan_server |
Live security audit (mcpsafety+, Cisco, Snyk) |
scan_all_servers |
mcpsafety+ pipeline across all registered servers |
get_security_scan |
Latest stored scan report |
set_tool_policy |
Permanent allow/block policy for a tool |
get_run_history |
Recent execution history for a tool |
ping_server |
Reachability check with latency |
17 subcommands covering all 18 MCP tools. Every command supports --json for machine-readable output and --yes / -y to skip confirmation prompts.
See docs/CLI.md for the full reference with flags and examples.
Kali Linux MCP, Burp Suite MCP, and Snyk each integrate automatically once registered. Kali enriches the Recon stage and ping_server with real nmap/traceroute data. Burp adds raw HTTP probing, out-of-band callbacks, and proxy evidence. Snyk analyses tool metadata for injection strings, tool shadowing, hardcoded secrets, and 16 other checks.
See docs/INTEGRATIONS.md for setup instructions.
Install in editable mode:
pip install -e ".[all]"
Run the server and observe logs:
mcpsafetywarden-server 2>server.log
Every module uses logging.getLogger(__name__). The server does not call logging.basicConfig itself - configure logging in your entry point before importing.
pytest tests/ -v
Set an LLM API key to include LLM-assisted tests; without one they are skipped automatically. See docs/TESTING.md for step-by-step verification of classification, injection scanning, risk gating, and policy enforcement.
| Doc | Contents |
|---|---|
| docs/TOOLS.md | Full reference for all 18 MCP tools |
| docs/CLI.md | CLI subcommands, flags, and examples |
| docs/INTEGRATIONS.md | Kali, Burp Suite, and Snyk setup |
| docs/DEPLOYMENT.md | stdio, HTTP, container, and gateway deployment |
| docs/TROUBLESHOOTING.md | Common errors and fixes |
| docs/SECURITY.md | Secrets, auth, isolation, and scanning details |
| docs/TESTING.md | Verification steps for each feature |
| docs/COMPARISON.md | Comparison with related tools |
| docs/ROADMAP.md | Planned features |
See CONTRIBUTING.md for code standards and pull request guidelines.
Apache License 2.0. See LICENSE for details.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-safety-warden": {
"command": "npx",
"args": []
}
}
}PRs, issues, code search, CI status
Database, auth and storage
Reference / test server with prompts, resources, and tools.
Secure file operations with configurable access controls.