A security testing tool for MCP (Model Context Protocol) servers. Built to enumerate, scan, and actively exploit vulnerabilities in MCP implementations — both black-box (live servers) and white-box (source code).
MCP servers are increasingly being used to give LLMs access to tools, files, and external services. That also makes them an attack surface. MCPloit lets you:
- Enumerate what tools, resources, and prompts a server exposes
- Connect to MCP servers for manual testing, custom payload execution, and studying tool behavior
- Scan for common vulnerabilities passively (no active probing)
- Audit source code with SAST rules + optional Claude AI review
- Exploit specific vulnerabilities with a library of 99 payloads
git clone https://github.com/Heisenbergg4/mcploit.git
cd mcploit
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtOptional — needed only for --ai flag:
export ANTHROPIC_API_KEY=sk-ant-...python3 mcploit.py connect http://localhost:9001/sse
python3 mcploit.py connect ./server.py # STDIOAfter connecting to a server, MCPloit launches an interactive shell for manual exploration and testing of MCP capabilities.
python3 mcploit.py connect https://huggingface.co/mcpYou will enter the MCPloit shell:
mcploit> Available Commands
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Command ┃ Description ┃ Usage ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ list-tools │ List all available tools │ list-tools │
│ list-resources │ List all available resources │ list-resources │
│ list-prompts │ List all available prompts │ list-prompts │
│ call-tool │ Call a tool with arguments │ call-tool <name> '{"key":"val"}' │
│ read-resource │ Read a resource by URI │ read-resource <uri> │
│ get-prompt │ Get a rendered prompt │ get-prompt <name> │
│ info │ Show server information │ info │
│ history │ Show command history │ history │
│ clear │ Clear the screen │ clear │
│ exit / q │ Exit interactive shell │ exit │
└─────────────────┴──────────────────────────────┴──────────────────────────────────────┘
List available tools:
mcploit> list-toolsExample output:
evaluate_expression
read_file
store_password
Call a tool:
mcploit> call-tool tool-name '{parameter:value}'Read a resource:
mcploit> read-resource resource-uriRender a prompt template:
mcploit> get-prompt prompt-name '{parameter:value}'This mode is useful for:
- Manual reconnaissance of MCP servers
- Understanding tool schemas and parameters
- Testing custom payloads
- Verifying vulnerabilities discovered by automated scans
- Observing real-time MCP server behavior
python3 mcploit.py enum http://localhost:9001/sse
python3 mcploit.py enum ./server.py -o results.jsonpython3 mcploit.py scan http://localhost:9001/sse
python3 mcploit.py scan ./server.py -d prompt_injection,code_executionpython3 mcploit.py scan http://localhost:9001/sse --probe --schema# SAST only (fast, no API key needed)
python3 mcploit.py audit ./server-src/ --sast-only
# Full pipeline with AI triage
python3 mcploit.py audit ./server-src/ --ai --markdown report.md# Auto-run all payloads for a module
python3 mcploit.py exploit http://localhost:9001/sse -m prompt_injection --auto
# Pick payloads interactively
python3 mcploit.py exploit http://localhost:9001/sse -m path_traversal --interactive
# Target a specific tool
python3 mcploit.py exploit http://localhost:9008/sse -m rce --tool evaluate_expression --autopython3 mcploit.py full-scan http://localhost:9001/sse \
--source ./server-src/ --ai --probe --accept-disclaimer \
-o full.json --markdown report.md| Alias | Module |
|---|---|
pi, injection |
prompt_injection |
rce, exec, ce |
code_execution |
pt, traversal, lfi |
path_traversal |
poison |
tool_poisoning |
tm, rug, shadow |
tool_manipulation |
secrets, creds |
secrets_exposure |
token, theft |
token_theft |
99 payloads across 7 categories. List them with:
python3 mcploit.py payloads list
python3 mcploit.py payloads show rceWhen you point audit at source code, it runs three layers:
- SAST — 31 regex rules covering RCE, path traversal, secrets, injection, and MCP-specific issues. Runs in ~2 seconds.
- AST analysis — extracts
@toolfunctions, checks forshell=True, traces param-to-sink data flow - AI review (optional,
--ai) — sends HIGH/CRITICAL findings and each@toolto Claude for triage. Flags true positives with[AI].
- STDIO — Python or Node.js scripts (
./server.py,./server.js) - SSE —
http://host/sse - HTTP —
http://host/mcp - Auto-detected from the target string if
--transportis not set
--probeand--run-cverequire--accept-disclaimer(orMCPLOIT_ACCEPTED_DISCLAIMER=1)- Default mode is safe — canary payloads only, no writes, no shells
--unsafeenables the full destructive payload set--aisends source code to the Anthropic API — don't use on proprietary code without clearance- Never run the included vulnerable lab servers on a public network