mcppt 1.0.2__tar.gz → 3.0.0__tar.gz

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.
Files changed (33) hide show
  1. {mcppt-1.0.2 → mcppt-3.0.0}/.github/workflows/ci.yml +2 -5
  2. {mcppt-1.0.2 → mcppt-3.0.0}/PKG-INFO +109 -101
  3. {mcppt-1.0.2 → mcppt-3.0.0}/README.md +106 -99
  4. mcppt-3.0.0/docs/STUDY_GUIDE.md +299 -0
  5. mcppt-3.0.0/mcppt/__init__.py +1 -0
  6. {mcppt-1.0.2 → mcppt-3.0.0}/mcppt/checks.py +210 -91
  7. {mcppt-1.0.2 → mcppt-3.0.0}/mcppt/cli.py +1 -1
  8. {mcppt-1.0.2 → mcppt-3.0.0}/mcppt/core.py +72 -59
  9. mcppt-3.0.0/mcppt/shell.py +888 -0
  10. {mcppt-1.0.2 → mcppt-3.0.0}/pyproject.toml +3 -2
  11. {mcppt-1.0.2 → mcppt-3.0.0}/requirements.txt +1 -0
  12. {mcppt-1.0.2 → mcppt-3.0.0}/smoke_test.py +2 -2
  13. {mcppt-1.0.2 → mcppt-3.0.0}/tests/test_core.py +4 -4
  14. {mcppt-1.0.2 → mcppt-3.0.0}/vuln_server.py +3 -3
  15. mcppt-1.0.2/mcppt/__init__.py +0 -1
  16. mcppt-1.0.2/mcppt/shell.py +0 -508
  17. {mcppt-1.0.2 → mcppt-3.0.0}/.gitignore +0 -0
  18. {mcppt-1.0.2 → mcppt-3.0.0}/LICENSE +0 -0
  19. {mcppt-1.0.2 → mcppt-3.0.0}/OPERATOR_GUIDE.md +0 -0
  20. {mcppt-1.0.2 → mcppt-3.0.0}/app.py +0 -0
  21. {mcppt-1.0.2 → mcppt-3.0.0}/docs/MCPTROTTER_ARTICLE.md +0 -0
  22. {mcppt-1.0.2 → mcppt-3.0.0}/docs/MCPTROTTER_MEDIUM.md +0 -0
  23. {mcppt-1.0.2 → mcppt-3.0.0}/docs/mcptrotter.jpeg +0 -0
  24. {mcppt-1.0.2 → mcppt-3.0.0}/mcppt/report.py +0 -0
  25. {mcppt-1.0.2 → mcppt-3.0.0}/mcppt/server.py +0 -0
  26. {mcppt-1.0.2 → mcppt-3.0.0}/mcppt/tui.py +0 -0
  27. {mcppt-1.0.2 → mcppt-3.0.0}/test_report.md +0 -0
  28. {mcppt-1.0.2 → mcppt-3.0.0}/test_server.log +0 -0
  29. {mcppt-1.0.2 → mcppt-3.0.0}/test_server.py +0 -0
  30. {mcppt-1.0.2 → mcppt-3.0.0}/tests/__init__.py +0 -0
  31. {mcppt-1.0.2 → mcppt-3.0.0}/tests/test_checks.py +0 -0
  32. {mcppt-1.0.2 → mcppt-3.0.0}/wbs_mcppt_result.md +0 -0
  33. {mcppt-1.0.2 → mcppt-3.0.0}/wbs_scan_report.md +0 -0
@@ -64,17 +64,14 @@ jobs:
64
64
  needs: build
65
65
  runs-on: ubuntu-latest
66
66
  if: startsWith(github.ref, 'refs/tags/v')
67
- environment:
68
- name: pypi
69
- url: https://pypi.org/project/mcppt/
70
- permissions:
71
- id-token: write # trusted publishing (no API key needed)
72
67
  steps:
73
68
  - uses: actions/download-artifact@v4
74
69
  with:
75
70
  name: dist
76
71
  path: dist/
77
72
  - uses: pypa/gh-action-pypi-publish@release/v1
73
+ with:
74
+ password: ${{ secrets.PYPI_API_TOKEN }}
78
75
 
79
76
  # ── Create GitHub Release on version tag ───────────────────────────────────
80
77
  release:
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcppt
3
- Version: 1.0.2
4
- Summary: MCPTROTTER — MCP Pentest Tool: 28 automated security checks for MCP servers
3
+ Version: 3.0.0
4
+ Summary: MCPTROTTER — MCP Security Framework: 31 automated checks + manual exploration shell
5
5
  Project-URL: Homepage, https://github.com/gurudeepmallam-cmd/mcppt
6
6
  Project-URL: Repository, https://github.com/gurudeepmallam-cmd/mcppt
7
7
  Project-URL: Issues, https://github.com/gurudeepmallam-cmd/mcppt/issues
@@ -21,6 +21,7 @@ Classifier: Topic :: Internet :: WWW/HTTP
21
21
  Classifier: Topic :: Security
22
22
  Requires-Python: >=3.10
23
23
  Requires-Dist: flask>=3.0
24
+ Requires-Dist: requests>=2.28.0
24
25
  Requires-Dist: rich>=13.0
25
26
  Provides-Extra: ai
26
27
  Requires-Dist: anthropic>=0.25; extra == 'ai'
@@ -29,7 +30,7 @@ Provides-Extra: ui
29
30
  Requires-Dist: streamlit>=1.30; extra == 'ui'
30
31
  Description-Content-Type: text/markdown
31
32
 
32
- # MCPTROTTER — MCP Pentest Tool
33
+ # MCPTROTTER — MCP Security Framework
33
34
 
34
35
  <p align="center">
35
36
  <img src="https://raw.githubusercontent.com/gurudeepmallam-cmd/mcppt/main/docs/mcptrotter.jpeg" alt="MCPTROTTER" width="380"/>
@@ -38,7 +39,7 @@ Description-Content-Type: text/markdown
38
39
  <p align="center">
39
40
  <img src="https://img.shields.io/pypi/v/mcppt?label=PyPI&color=orange"/>
40
41
  <img src="https://img.shields.io/badge/python-3.10%2B-blue"/>
41
- <img src="https://img.shields.io/badge/checks-28-red"/>
42
+ <img src="https://img.shields.io/badge/checks-31-red"/>
42
43
  <img src="https://img.shields.io/badge/license-MIT-green"/>
43
44
  <img src="https://img.shields.io/badge/part%20of-Bugtrotter-black"/>
44
45
  </p>
@@ -50,19 +51,15 @@ Description-Content-Type: text/markdown
50
51
 
51
52
  ---
52
53
 
53
- ## What it does
54
+ ## What it is
54
55
 
55
- MCPTROTTER is a command-line security scanner for **MCP (Model Context Protocol)** servers. Point it at any MCP endpoint and it runs 28 automated checks across:
56
+ MCPTROTTER is a **security framework** for testing MCP (Model Context Protocol) servers. It works two ways:
56
57
 
57
- - Authentication bypass and token abuse
58
- - Prompt injection (direct, stored, poison-all fields)
59
- - SSRF, command injection, path traversal
60
- - Session entropy and replay attacks
61
- - Tenant isolation and IDOR
62
- - Tool poisoning and rug pulls
63
- - Transport misconfigurations and secret leaks
58
+ **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.
64
59
 
65
- Works against any MCP server using Streamable HTTP transport (POST + SSE response). Integrates with Burp Suite for manual follow-up. Exports pentest-ready Markdown reports.
60
+ **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.
61
+
62
+ Both modes route through Burp Suite so you see every request in HTTP History and can follow up in Repeater.
66
63
 
67
64
  ---
68
65
 
@@ -106,29 +103,26 @@ python test_server.py
106
103
  mcppt
107
104
  ```
108
105
 
109
- You'll see:
110
106
  ```
111
107
  __ __ ___ ___ _____ ____ ___ _____ _____ ___ ___
112
108
  | \/ | / __|| _ \|_ _| _ \ / _ \_ _|_ _| __| _ \
113
109
  | |\/| || (__| _/ | | | / | (_) || | | | | _|| /
114
110
  |_| |_| \___||_| |_| |_|_\ \___/ |_| |_| |___|_|_\
115
111
 
116
- MCP Pentest Tool v2.1 -- 16 automated security checks
112
+ MCP Pentest Framework v3.0 -- 31 checks + manual exploration
117
113
 
118
114
  by Gurudeep Mallam
119
- github : https://github.com/gurudeepmallam-cmd
120
- linkedin: https://in.linkedin.com/in/mallam-gurudeep-7734941aa
121
-
122
- type 'help' for commands, 'exit' to quit
123
115
 
124
- mcppt>
116
+ Quick start: target <url> → connect → list → scan
117
+ Manual test: call <tool> <args> | raw <method> | fuzz <tool> <param> <type>
125
118
  ```
126
119
 
127
120
  **Paste these commands one by one:**
128
121
  ```
129
122
  target http://127.0.0.1:8888/mcp
130
123
  token valid-token-abc123
131
- status
124
+ connect
125
+ list
132
126
  scan
133
127
  findings
134
128
  report demo.md
@@ -138,10 +132,10 @@ report demo.md
138
132
 
139
133
  ## Expected output — demo server scan
140
134
 
141
- Running `scan` with token set produces this (6.7 seconds):
135
+ Running `scan` with token set produces this (under 60 seconds):
142
136
 
143
137
  ```
144
- Duration: 6.7s Findings: 6 CRITICAL 6 HIGH 13 MEDIUM 3 LOW
138
+ Duration: ~45s Findings: 6 CRITICAL 6 HIGH 13 MEDIUM 3 LOW
145
139
  ```
146
140
 
147
141
  | Severity | Check | Finding |
@@ -168,43 +162,80 @@ Duration: 6.7s Findings: 6 CRITICAL 6 HIGH 13 MEDIUM 3 LOW
168
162
 
169
163
  ---
170
164
 
171
- ## All commands (interactive shell)
165
+ ## All commands
172
166
 
167
+ ### Setup
168
+ ```
169
+ target <url> Set MCP server URL
170
+ token <bearer> Set primary auth token
171
+ token2 <bearer> Set second user token (IDOR / scope / tenant checks)
172
+ noverify Toggle SSL verification skip (needed for self-signed certs)
173
+ proxy <url|off> Set Burp proxy: proxy http://127.0.0.1:8080
174
+ verbose Toggle raw HTTP request/response logging
175
+ status Show current session configuration
173
176
  ```
174
- Setup
175
- target <url> Set MCP server URL
176
- token <bearer> Set primary auth token
177
- token2 <bearer> Set second user token (IDOR / scope / tenant checks)
178
- noverify Toggle SSL verification skip (needed for self-signed certs)
179
- proxy <url|off> Set Burp proxy: proxy http://127.0.0.1:8080
180
- status Show current config before scanning
181
177
 
182
- Enumerate
183
- list List all tools the server exposes (names, params, descriptions)
184
- call <tool> [json] Manually call any tool
185
- call get_notes
186
- call get_user {"id": 1}
187
- call save_note {"text": "hello"}
178
+ ### Manual exploration
179
+ ```
180
+ connect Test connection + show server name, version, capabilities
181
+ list List all tools the server exposes (names, schemas, params)
182
+ inspect <tool> Show full JSON schema for a specific tool
183
+ call <tool> [json] Call any tool directly with your own arguments
184
+ call get_notes
185
+ call get_user {"id": 1}
186
+ call save_note {"text": "test injection payload"}
187
+ raw <method> [params] Send any raw JSON-RPC method
188
+ raw tools/list
189
+ raw resources/list
190
+ raw sampling/createMessage {...}
191
+ resources [read <uri>] List resources or read a specific URI
192
+ prompts [get <name>] List prompts or get a specific prompt
193
+ headers Show HTTP response headers from the last request
194
+ ```
188
195
 
189
- Scan
190
- scan Run all checks
191
- scan auth ssrf idor Run specific checks only
192
- scan stored injection Mix and match any check names
196
+ ### Targeted testing
197
+ ```
198
+ fuzz <tool> <param> <type|file> Fuzz a specific tool parameter
199
+
200
+ Built-in wordlists:
201
+ sqli SQL injection payloads
202
+ xss XSS and template injection
203
+ traversal Path traversal (../etc/passwd, encoded variants)
204
+ cmd OS command injection (; id, $(id), | whoami)
205
+ ssrf SSRF targets (169.254.169.254, localhost)
206
+ ssti Server-side template injection
207
+ inject Prompt injection payloads for LLM tools
208
+
209
+ Custom: fuzz read_file path /path/to/payloads.txt
210
+
211
+ Examples:
212
+ fuzz get_user id sqli
213
+ fuzz save_note text inject
214
+ fuzz read_file path traversal
215
+ ```
193
216
 
194
- Results
195
- findings Colour-coded findings table
196
- clear Clear findings from last scan
197
- report out.md Export Markdown report
198
- report out.json Export JSON report
217
+ ### Automated scan
218
+ ```
219
+ scan Run all 31 checks
220
+ scan auth ssrf idor Run specific checks only
221
+ scan stored injection Mix and match any check names
222
+ ```
199
223
 
200
- AI analysis (optional — paste your key first)
201
- ai claude sk-ant-... Configure Claude for analysis
202
- ai openai sk-... Configure OpenAI GPT-4o
203
- analyze Attack narrative + remediation priority from findings
224
+ ### Findings
225
+ ```
226
+ note <sev> <check> <title> [| detail] Manually log a finding
227
+ note HIGH manual_test Input reflected | seen in 500 response
228
+ findings Colour-coded findings table (scan + manual notes)
229
+ clear Clear findings and tool cache
230
+ report out.md Export Markdown report
231
+ report out.json Export JSON report
232
+ ```
204
233
 
205
- Shell
206
- help Full command reference
207
- exit Quit
234
+ ### AI analysis (optional)
235
+ ```
236
+ ai claude sk-ant-... Configure Claude for analysis
237
+ ai openai sk-... Configure OpenAI GPT-4o
238
+ analyze Attack narrative + remediation priority from findings
208
239
  ```
209
240
 
210
241
  ---
@@ -237,7 +268,7 @@ Burp Suite → **Proxy → Proxy Settings**
237
268
 
238
269
  Confirm the listener is `127.0.0.1:8080` (it is by default). No changes needed.
239
270
 
240
- ### Step 2 — Run scan through proxy
271
+ ### Step 2 — Run through proxy
241
272
 
242
273
  Inside the shell:
243
274
  ```
@@ -257,9 +288,11 @@ mcppt scan --url https://target.com/mcp --token eyJ... --proxy http://127.0.0.1:
257
288
 
258
289
  Burp → **Proxy → HTTP History**
259
290
 
260
- Every MCP tool call appears as a `POST /mcp` request. Each row shows the JSON-RPC method and the response. You'll see one row per check — `initialize`, `tools/list`, `tools/call` for each tool tested.
291
+ 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.
292
+
293
+ ### Step 4 — Send to Repeater for manual testing
261
294
 
262
- Click any row to see the full request and response body:
295
+ Right-click any request **Send to Repeater** (`Ctrl+R`).
263
296
 
264
297
  ```
265
298
  POST /mcp HTTP/1.1
@@ -270,42 +303,17 @@ Content-Type: application/json
270
303
  {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_notes","arguments":{}}}
271
304
  ```
272
305
 
273
- ### Step 4 Send to Repeater for manual testing
274
-
275
- In HTTP History, right-click any request → **Send to Repeater** (or `Ctrl+R`).
276
-
277
- Switch to the **Repeater** tab. You'll see the exact request MCPTROTTER sent.
278
-
279
- **To keep the connection alive and replay successfully:**
280
-
281
- 1. Check the **Host** field matches your target (e.g. `127.0.0.1` port `8888` for demo server, or your real target host/port)
282
- 2. If targeting HTTP (not HTTPS), make sure the **lock icon** in Repeater shows unlocked — click it to toggle if needed
283
- 3. The MCP session ID in `mcp-session-id` header may expire — if you get a session error, re-initialize:
284
- - Copy the `initialize` request from HTTP History into Repeater first
285
- - Send it, copy the `mcp-session-id` from the response header
286
- - Paste it into the header of your target request
287
- 4. Click **Send** — response appears on the right
288
-
289
- **Modifying requests in Repeater:**
290
-
291
- ```json
292
- {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{
293
- "name":"get_user",
294
- "arguments":{"id": 2}
295
- }}
296
- ```
306
+ Change `"id": 2` to `"id": 1` to test IDOR. Swap the token to another user's. Modify `"name"` to call a different tool.
297
307
 
298
- Change `"id": 2` to `"id": 1` to test IDOR. Change the token in Authorization to another user's token. Modify `"name"` to call a different tool. Repeater sends exactly what you write.
308
+ 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.
299
309
 
300
310
  ### Step 5 — Fuzz with Intruder
301
311
 
302
- Right-click a request in Repeater → **Send to Intruder**.
303
-
304
- Highlight the value you want to fuzz (e.g. a tool parameter), click **Add §**. Load a wordlist (Burp's built-in fuzzing strings, or a custom injection list). Run the attack and sort by response length or status code to spot anomalies.
312
+ Right-click any Repeater request → **Send to Intruder**. Highlight the parameter value, click **Add §**, load a wordlist, run the attack.
305
313
 
306
314
  ---
307
315
 
308
- ## All 28 checks
316
+ ## All 31 checks
309
317
 
310
318
  | # | Check | Severity | What it tests |
311
319
  |---|---|---|---|
@@ -337,6 +345,9 @@ Highlight the value you want to fuzz (e.g. a tool parameter), click **Add §**.
337
345
  | 26 | `tool_shadowing` | CRITICAL | Duplicate tool names, homoglyphs, name/desc mismatch |
338
346
  | 27 | `sampling` | CRITICAL | `sampling/createMessage` accessible without auth |
339
347
  | 28 | `schema_leak` | LOW | Sensitive field names / enum values in tool schemas |
348
+ | 29 | `http_method_confusion` | MEDIUM | GET/DELETE/PUT/PATCH accepted on MCP endpoint |
349
+ | 30 | `protocol_downgrade` | MEDIUM | Old protocol versions accepted, server version leaked |
350
+ | 31 | `batch_injection` | MEDIUM | JSON-RPC batch requests, unusual method name injection |
340
351
 
341
352
  ---
342
353
 
@@ -349,9 +360,13 @@ Highlight the value you want to fuzz (e.g. a tool parameter), click **Add §**.
349
360
  | Check all response fields for injection | 30+ min | `scan poison_all` — 5s |
350
361
  | Verify session ID entropy | 10 min | `scan session` — 2s |
351
362
  | Check replay on every tool | 20 min | `scan replay` — 5s |
352
- | Full 28-check assessment | 3–6 hours | `scan` — 30s |
363
+ | Full 31-check assessment | 3–6 hours | `scan` — under 60s |
364
+ | Inspect tool schema before testing | 5 min reading docs | `inspect <tool>` — instant |
365
+ | Call a tool with custom payload | Set up in Burp Repeater | `call <tool> {"param": "payload"}` |
366
+ | Fuzz a parameter with 50 payloads | Intruder setup + run | `fuzz <tool> <param> sqli` — 30s |
367
+ | Test any JSON-RPC method directly | Build request in Repeater | `raw <method> <params>` |
353
368
 
354
- MCPTROTTER gives you the baseline in 30 seconds. You spend your time on what matters: manually verifying findings in Burp Repeater and chaining them into a demonstrated attack path.
369
+ 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.
355
370
 
356
371
  ---
357
372
 
@@ -363,8 +378,8 @@ MCPTROTTER is the public automated scanner extracted from **Bugtrotter** — a f
363
378
 
364
379
  | Capability | MCPTROTTER | Bugtrotter |
365
380
  |---|---|---|
366
- | Automated MCP scan (28 checks) | ✓ | ✓ |
367
- | Manual finding verification | You do it in Burp | Guided playbooks |
381
+ | Automated MCP scan (31 checks) | ✓ | ✓ |
382
+ | Manual tool exploration framework | | |
368
383
  | Chained exploit paths across tools | — | ✓ Full attack chain |
369
384
  | SAST review of MCP server code | — | ✓ |
370
385
  | Burp Suite MCP — business logic abuse | — | ✓ AI-driven |
@@ -373,27 +388,25 @@ MCPTROTTER is the public automated scanner extracted from **Bugtrotter** — a f
373
388
  | Web / API / network pentesting | — | ✓ Full engagement |
374
389
  | Final pentest report | Markdown export | Engagement-grade report |
375
390
 
376
- **MCPTROTTER in fingertips inside Bugtrotter:**
391
+ **MCPTROTTER inside Bugtrotter:**
377
392
 
378
393
  In Bugtrotter, MCPTROTTER runs as a registered MCP server. Claude Code or Claude Desktop calls it directly:
379
394
 
380
395
  ```
381
396
  "Scan https://target.com/mcp for security issues and prioritise findings"
382
397
  → Claude calls scan_target tool
383
- → MCPTROTTER runs all 28 checks
398
+ → MCPTROTTER runs all 31 checks
384
399
  → Findings returned as structured JSON to Claude
385
400
  → Claude reasons over them, chains the critical ones, drafts the report section
386
401
  ```
387
402
 
388
403
  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.
389
404
 
390
- That's the difference: MCPTROTTER finds the candidates in 30 seconds. Bugtrotter turns the candidates into proven, chained, client-ready findings.
391
-
392
405
  ---
393
406
 
394
407
  ## Use MCPTROTTER as an MCP server itself
395
408
 
396
- MCPTROTTER can become an MCP server — exposing its scan capability as tools that any MCP client (Claude Desktop, MCP Inspector, another agent) can call.
409
+ MCPTROTTER can expose its scan capability as tools that any MCP client (Claude Desktop, MCP Inspector, another agent) can call.
397
410
 
398
411
  ```bash
399
412
  mcppt serve-mcp --port 8899
@@ -415,12 +428,7 @@ Tools exposed:
415
428
  - `scan_target` — full scan, returns findings JSON
416
429
  - `list_tools` — enumerate tools on any MCP server
417
430
  - `call_tool` — call any tool on any MCP server
418
- - `get_checks` — list all 28 checks with descriptions
419
-
420
- Inspect with MCP Inspector:
421
- ```bash
422
- npx @modelcontextprotocol/inspector http://127.0.0.1:8899/mcp
423
- ```
431
+ - `get_checks` — list all 31 checks with descriptions
424
432
 
425
433
  ---
426
434