convez.ai
MCP ServerSegurançaAvançado
gurudeepmallam-cmd

MCPTROTTER - Framework de Segurança para MCP

gurudeepmallam-cmd/mcppt

31 checks de segurança automatizados para MCP servers + pentest interativo

Ver no GitHub
InicialPluginScore · de 0 a 100

Framework de pentest e segurança especializado em servidores MCP (Model Context Protocol). Oferece 31 verificações automatizadas de segurança (auth bypass, injeção, replay attacks, etc.) além de modo interativo para exploração manual via Burp Suite. Executa scans completos em menos de 60 segundos.

Instalação

$npx convez-ai gurudeepmallam-cmd/mcppt

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
3
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 1 mês
Versão
v3.1.0
Issues abertas
0
Contribuidores
1

Casos de uso

  • Auditar servidores MCP antes de produção
  • Testar vulnerabilidades de autenticação e autorização em MCP
  • Validar isolamento de tenant e prevenção de injeção
  • Exploração manual de MCP servers com replay via Burp Suite
  • Detectar auth bypass, stored injection e command injection

Veredito

Ferramenta madura e especializada para pentesting de MCP servers. Cobertura ampla de vetores de ataque específicos do protocolo, com automação robusta e modo interativo poderoso. Essencial para quem trabalha com MCP em ambientes críticos.

README

A tradução para o português deste README ainda está na fila.

MCPTROTTER — MCP Security Framework


What it is

MCPTROTTER is a security framework for testing MCP (Model Context Protocol) servers. It works two ways:

Manual exploration — connect to any MCP server and interact with it the way an attacker would. Call tools directly, inspect schemas, fuzz parameters, read resources, send raw JSON-RPC methods. No scan needed. You control every request.

Automated scanning — run 31 security checks in under 60 seconds. Auth bypass, stored injection, replay attacks, session entropy, tenant isolation, tool poisoning, command injection, and more.

Both modes route through Burp Suite so you see every request in HTTP History and can follow up in Repeater.


Install

From PyPI (recommended):

pip install mcppt

From source:

git clone https://github.com/gurudeepmallam-cmd/mcppt
cd mcppt/mcppt_tool
pip install -e .

Requires Python 3.10+.


Quick start — try it right now (no target needed)

MCPTROTTER ships with a deliberately vulnerable demo server that fires every check.

Terminal 1 — start the demo server:

cd mcppt_tool
python test_server.py
=======================================================
  Vulnerable MCP Test Server
  URL:   http://127.0.0.1:8888/mcp
  Token: valid-token-abc123
=======================================================

Terminal 2 — open the interactive shell:

mcppt
  __  __   ___  ___  _____ ____   ___ _____ _____ ___ ___
 |  \/  | / __|| _ \|_   _|  _ \ / _ \_   _|_   _| __| _ \
 | |\/| || (__|  _/ | | |   /  | (_) || |   | | | _||   /
 |_|  |_| \___||_|  |_| |_|_\  \___/ |_|   |_| |___|_|_\

  MCP Pentest Framework  v3.0  --  31 checks  +  manual exploration

  by Gurudeep Mallam

  Quick start:  target <url>  →  connect  →  list  →  scan
  Manual test:  call <tool> <args>  |  raw <method>  |  fuzz <tool> <param> <type>

Paste these commands one by one:

target http://127.0.0.1:8888/mcp
token  valid-token-abc123
connect
list
scan
findings
report demo.md

Expected output — demo server scan

Running scan with token set produces this (under 60 seconds):

Duration: ~45s   Findings: 6 CRITICAL  6 HIGH  13 MEDIUM  3 LOW
SeverityCheckFinding
CRITICALauthAuth bypass on get_notes — no token required
CRITICALauthAuth bypass on get_notes — invalid token accepted
CRITICALpublishpublish_report callable without confirmation gate
CRITICALstoredStored injection confirmed: save_note → get_notes unescaped
CRITICALreplayReplay confirmed on WRITE tool publish_report
CRITICALpoison_allInjection marker reflected in result.content[0].text
HIGHinjectionPrompt injection reflected in publish_report.title
HIGHreplayReplay confirmed on get_notes
HIGHsessionShort session ID (3 chars): 108
HIGHsessionNon-UUID/non-hex session format: 108
HIGHsessionNear-sequential IDs (diffs=[1,7,1,1]) — low entropy
MEDIUMenumtools/list accessible without Authorization header
MEDIUMschemaMultiple fields accept wrong types (string/int/null bypass)
MEDIUMcontext_overflow10,000-char payload accepted without truncation
LOWrateNo rate limiting — 30/30 requests in 1.5s
LOWheadersMissing: X-Content-Type-Options, CSP, X-Frame-Options
LOWheadersServer header leaks: Werkzeug/3.1.8 Python/3.13.5

Without a token set, only the rate limiting check fires. Always run token <value> before scan.


All commands

Setup

target  <url>          Set MCP server URL
token   <bearer>       Set primary auth token
token2  <bearer>       Set second user token (IDOR / scope / tenant checks)
noverify               Toggle SSL verification skip (needed for self-signed certs)
proxy   <url|off>      Set Burp proxy:  proxy http://127.0.0.1:8080
verbose                Toggle raw HTTP request/response logging
status                 Show current session configuration

Manual exploration

connect                Test connection + show server name, version, capabilities
list                   List all tools the server exposes (names, schemas, params)
inspect <tool>         Show full JSON schema for a specific tool
call <tool> [json]     Call any tool directly with your own arguments
                         call get_notes
                         call get_user {"id": 1}
                         call save_note {"text": "test injection payload"}
raw <method> [params]  Send any raw JSON-RPC method
                         raw tools/list
                         raw resources/list
                         raw sampling/createMessage {...}
resources [read <uri>] List resources or read a specific URI
prompts [get <name>]   List prompts or get a specific prompt
headers                Show HTTP response headers from the last request

Targeted testing

fuzz <tool> <param> <type|file>   Fuzz a specific tool parameter

  Built-in wordlists:
    sqli        SQL injection payloads
    xss         XSS and template injection
    traversal   Path traversal (../etc/passwd, encoded variants)
    cmd         OS command injection (; id, $(id), | whoami)
    ssrf        SSRF targets (169.254.169.254, localhost)
    ssti        Server-side template injection
    inject      Prompt injection payloads for LLM tools

  Custom:  fuzz read_file path /path/to/payloads.txt

  Examples:
    fuzz get_user id sqli
    fuzz save_note text inject
    fuzz read_file path traversal

Automated scan

scan                   Run all 31 checks
scan auth ssrf idor    Run specific checks only
scan stored injection  Mix and match any check names

Findings

note <sev> <check> <title> [| detail]   Manually log a finding
                         note HIGH manual_test Input reflected | seen in 500 response
findings               Colour-coded findings table (scan + manual notes)
clear                  Clear findings and tool cache
report out.md          Export Markdown report
report out.json        Export JSON report

AI analysis (optional)

ai claude  sk-ant-...  Configure Claude for analysis
ai openai  sk-...      Configure OpenAI GPT-4o
analyze                Attack narrative + remediation priority from findings

One-liner (non-interactive / CI)

# Full scan, save Markdown report
mcppt scan --url https://target.com/mcp --token eyJ... --output report.md

# With second token (enables IDOR, scope, tenant checks)
mcppt scan --url https://target.com/mcp --token t1 --token2 t2 --output report.md

# Through Burp proxy, skip SSL
mcppt scan --url https://target.com/mcp --token eyJ... --proxy http://127.0.0.1:8080 --no-verify

# Targeted checks only
mcppt scan --url https://target.com/mcp --token eyJ... --checks auth,ssrf,stored,idor

Burp Suite integration — step by step

Route every MCPTROTTER request through Burp to inspect, replay, and fuzz manually.

Step 1 — Set up Burp listener

Burp Suite → Proxy → Proxy Settings

Confirm the listener is 127.0.0.1:8080 (it is by default). No changes needed.

Step 2 — Run through proxy

Inside the shell:

proxy    http://127.0.0.1:8080
noverify
scan

Or as a one-liner:

mcppt scan --url https://target.com/mcp --token eyJ... --proxy http://127.0.0.1:8080 --no-verify

noverify / --no-verify is required because Burp intercepts TLS with its own certificate.

Step 3 — See requests in HTTP History

Burp → Proxy → HTTP History

Every MCP tool call appears as a POST /mcp request. You'll see initialize, tools/list, tools/call for each check. Manual commands (call, raw, fuzz) also appear here — every request MCPTROTTER makes goes through Burp.

Step 4 — Send to Repeater for manual testing

Right-click any request → Send to Repeater (Ctrl+R).

POST /mcp HTTP/1.1
Host: target.com
Authorization: Bearer eyJ...
Content-Type: application/json

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_notes","arguments":{}}}

Change "id": 2 to "id": 1 to test IDOR. Swap the token to another user's. Modify "name" to call a different tool.

If you get a session error, copy the initialize request from HTTP History into Repeater first, send it, and copy the mcp-session-id header value into your target request.

Step 5 — Fuzz with Intruder

Right-click any Repeater request → Send to Intruder. Highlight the parameter value, click Add §, load a wordlist, run the attack.


All 31 checks

#CheckSeverityWhat it tests
1enumMEDIUMtools/list accessible without auth
2authCRITICALTool calls succeed with no/invalid token
3idorHIGHCross-user resource access (needs token2)
4injectionHIGHPrompt injection payloads reflected in responses
5schemaMEDIUMType confusion, null bypass, oversized input
6ssrfCRITICALCloud metadata URLs accepted in tool parameters
7publishCRITICALDestructive tool callable without confirmation gate
8rateLOWNo rate limiting on tool calls
9storedCRITICALWrite injection payload, read back unescaped
10scopeHIGHRead-only token reaches write tools
11replayCRITICALSame request accepted twice — no nonce
12context_overflowHIGH50K–100K char payload accepted without truncation
13poison_allCRITICALInjection payload appears in every response field
14tenantCRITICALToken2 reads token1 data — isolation broken
15sessionHIGHWeak or sequential session IDs
16rug_pullCRITICALTool descriptions change between tools/list calls
17headersHIGHCORS wildcard, missing CSP/HSTS, Server header leak
18error_disclosureMEDIUMStack traces, file paths, DB credentials in errors
19tool_poisoningCRITICALHidden Unicode (U+200B/202E) in tool descriptions
20resourcesHIGHresources/list or prompts/list without auth
21cmd_injectionCRITICALShell metacharacters (;id, $(id)) in parameters
22path_traversalCRITICAL../../../etc/passwd in file/path parameters
23jwt_auditCRITICALalg=none, no exp, expired token accepted
24oauth_discoveryLOW/.well-known/oauth-authorization-server exposed
25secret_scanCRITICALAWS keys, GitHub PATs, DB strings in tool responses
26tool_shadowingCRITICALDuplicate tool names, homoglyphs, name/desc mismatch
27samplingCRITICALsampling/createMessage accessible without auth
28schema_leakLOWSensitive field names / enum values in tool schemas
29http_method_confusionMEDIUMGET/DELETE/PUT/PATCH accepted on MCP endpoint
30protocol_downgradeMEDIUMOld protocol versions accepted, server version leaked
31batch_injectionMEDIUMJSON-RPC batch requests, unusual method name injection

MCPTROTTER vs manual testing — what you save

TaskManual in BurpMCPTROTTER
Test auth bypass on every tool10–30 minscan auth — 5s
Test stored injection (write + read)20 minscan stored — 3s
Check all response fields for injection30+ minscan poison_all — 5s
Verify session ID entropy10 minscan session — 2s
Check replay on every tool20 minscan replay — 5s
Full 31-check assessment3–6 hoursscan — under 60s
Inspect tool schema before testing5 min reading docsinspect <tool> — instant
Call a tool with custom payloadSet up in Burp Repeatercall <tool> {"param": "payload"}
Fuzz a parameter with 50 payloadsIntruder setup + runfuzz <tool> <param> sqli — 30s
Test any JSON-RPC method directlyBuild request in Repeaterraw <method> <params>

MCPTROTTER gives you the baseline in under 60 seconds and puts every request in Burp HTTP History. You spend your time on what matters: manually verifying findings in Repeater and chaining them into a demonstrated attack path.


Part of Bugtrotter

MCPTROTTER is the public automated scanner extracted from Bugtrotter — a full red team and application security platform built for modern attack surfaces.

What Bugtrotter adds on top of MCPTROTTER

CapabilityMCPTROTTERBugtrotter
Automated MCP scan (31 checks)✓✓
Manual tool exploration framework✓✓
Chained exploit paths across tools—✓ Full attack chain
SAST review of MCP server code—✓
Burp Suite MCP — business logic abuse—✓ AI-driven
AI agent red teaming—✓ Multi-agent pipelines
Active Directory kill chain—✓ External → DA
Web / API / network pentesting—✓ Full engagement
Final pentest reportMarkdown exportEngagement-grade report

MCPTROTTER inside Bugtrotter:

In Bugtrotter, MCPTROTTER runs as a registered MCP server. Claude Code or Claude Desktop calls it directly:

"Scan https://target.com/mcp for security issues and prioritise findings"
→ Claude calls scan_target tool
→ MCPTROTTER runs all 31 checks
→ Findings returned as structured JSON to Claude
→ Claude reasons over them, chains the critical ones, drafts the report section

No copy-paste. No context switching. The scan output feeds straight into the AI-driven engagement workflow — SSRF finding becomes an SSRF exploit attempt, auth bypass becomes a credential theft chain, stored injection becomes a demonstrated prompt hijack.


Use MCPTROTTER as an MCP server itself

MCPTROTTER can expose its scan capability as tools that any MCP client (Claude Desktop, MCP Inspector, another agent) can call.

mcppt serve-mcp --port 8899

Add to Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "mcptrotter": {
      "command": "mcppt",
      "args": ["serve-mcp", "--port", "8899"]
    }
  }
}

Tools exposed:

  • scan_target — full scan, returns findings JSON
  • list_tools — enumerate tools on any MCP server
  • call_tool — call any tool on any MCP server
  • get_checks — list all 31 checks with descriptions

Author

Gurudeep Mallam — Security Researcher


License

MIT

Ver o original no GitHub

Bom para

Relacionados