mcpsweep
🌐 Website: mcpsweep.com · source in the mcpsweep-site repo
A small, dependency-free discovery and fingerprinting scanner for MCP-over-HTTP
servers - think nmap for MCP. It finds Model Context Protocol endpoints on a
host or network, fingerprints each one (both the legacy initialize handshake
and the modern stateless server/discover of spec 2026-07-28), enumerates
its tools / resources / prompts, and flags risky/poisoned tools, transport
weaknesses, and known-vulnerable versions.
It is strictly read-only by default - handshake and */list calls only, never
tools/call (unless you opt into --active). And it is local-only: mcpsweep
has zero runtime dependencies, uses no LLM and no cloud service, and never
sends your tool names, descriptions, or configs anywhere. The only host it talks
to is the one you point it at.
Authorized use only. Scan hosts you own or are explicitly permitted to test.
📊 Detection coverage → OWASP MCP Top 10 + CVEs · 🧪 vulnlab: a vulnerable MCP server to test against
Why
MCP servers are easy to spin up and often ship with no authentication, over-broad
tools (arbitrary SQL, shell, money movement), or instructions hidden inside a
tool's description (tool poisoning). mcpsweep helps you inventory that surface
- including shadow servers nobody registered - and see the risk at a glance.
Install
pip install mcpsweep
Or from source:
git clone https://github.com/krishnareddypadala/mcpsweep && cd mcpsweep
pip install .
Usage
# scan one host on a known port
mcpsweep 10.10.0.31 --ports 8090
# route everything through Burp for inspection
mcpsweep 10.10.0.31 --ports 8090 --proxy http://127.0.0.1:8080
# sweep a subnet and a port range, also list resources/prompts
mcpsweep 10.10.0.0/28 --ports 8000-9100 --full
# a full URL, and a target list from a file (text or JSON)
mcpsweep http://10.10.0.31:8090/mcp/api
mcpsweep -iL targets.txt --exclude 10.10.0.5
mcpsweep -iL targets.json # ["10.0.0.1", "http://h:8090/mcp"] or {"targets":[...]}
mcpsweep -iL previous-report.json # re-scan the endpoints from an earlier JSON report
mcpsweep -iL claude_desktop_config.json # your MCP client config (mcpServers/servers) - scans the http/sse servers
# stdio servers - spawns them, so it runs third-party code (opt-in ack required)
mcpsweep --stdio "npx -y @scope/mcp" --yes-run-untrusted
mcpsweep -iL claude_desktop_config.json --include-stdio --yes-run-untrusted # also spawn the stdio entries
# authenticated scan (servers that require a token)
mcpsweep 10.10.0.31 --ports 8090 --bearer "$TOKEN"
mcpsweep 10.10.0.31 --ports 8090 -H "X-Api-Key: abc123"
# reports: JSON, Markdown, SARIF (GitHub code-scanning), self-contained HTML
mcpsweep 10.10.0.31 --ports 8090 --format json -o report.json
mcpsweep 10.10.0.31 --ports 8090 --format md -o report.md
mcpsweep 10.10.0.31 --ports 8090 --format sarif -o report.sarif
mcpsweep 10.10.0.31 --ports 8090 --format html -o report.html
# deep vulnerability analysis (parameter sinks, resource/prompt/annotation risks)
mcpsweep 10.10.0.31 --ports 8090 --deep
mcpsweep 10.10.0.31 --ports 8090 --read-resources # also scan resource contents
# baseline as policy: freeze the sanctioned inventory, then gate on drift
mcpsweep 10.10.0.31 --ports 8090 --write-baseline baseline.json
mcpsweep 10.10.0.31 --ports 8090 --baseline baseline.json --fail-on-policy
# CI gates: only show high+, fail the build on any critical
mcpsweep 10.10.0.31 --ports 8090 --severity high --fail-on critical
# active verification - CALLS tools; authorized labs only
mcpsweep 10.10.0.31 --ports 8090 --active --active-dry-run # preview, calls nothing
mcpsweep 10.10.0.31 --ports 8090 --active --i-have-authorization # verify BOLA / secret exposure
# drift detection between two JSON scans (continuous posture monitoring)
mcpsweep diff yesterday.json today.json --fail-on-drift
# transport-security probes run by default (DNS-rebinding, CORS, LAN exposure,
# sibling-endpoint auth gaps); turn them off with:
mcpsweep 10.10.0.31 --ports 8090 --no-transport-probe
# statically lint a local MCP client config for dangerous stdio servers + secrets
mcpsweep lint-config ~/.cursor/mcp.json ~/Library/Application\ Support/Claude/claude_desktop_config.json
Key options
| Flag | Purpose |
|---|---|
--target-file/-iL |
targets from a file: one-per-line text (# comments) or JSON (array, {"targets":[…]}, a prior mcpsweep report, or an MCP client mcpServers/servers config) |
--stdio "CMD" |
spawn a stdio MCP server and scan it (repeatable) |
--include-stdio |
also spawn the stdio servers found in a config (-iL) |
--yes-run-untrusted |
required to spawn stdio servers (they run third-party code) |
--exclude |
comma-separated hosts to skip |
--ports |
ports/ranges, e.g. 8090,8000,9000-9010 |
--paths |
URL paths to probe (defaults cover /mcp, /mcp/api, /sse, …) |
--scheme |
http, https, or both |
--header/-H, --bearer |
custom header(s) / bearer token for authenticated scans |
--proxy |
send all traffic via a proxy (e.g. Burp on 127.0.0.1:8080) |
--insecure/-k |
skip TLS verification |
--full |
also enumerate resources/list and prompts/list |
--no-transport-probe |
skip the read-only transport checks (DNS-rebinding, CORS, LAN exposure) |
--auth-probe |
for auth-gated servers, follow OAuth metadata (RFC 9728/8414) and classify (implied by --full) |
--deep |
classify parameter sinks (cmd/SQLi/path/SSRF), resource/prompt & annotation risks |
--read-resources |
also fetch resource contents and scan for secrets/injection (implies --deep) |
--severity |
only report endpoints at/above a level |
--fail-on |
exit 2 if any endpoint is at/above a level (CI gate) |
--baseline FILE |
evaluate the scan against a JSON baseline/policy (shadow servers, tool allowlist, rules) |
--write-baseline FILE |
generate a baseline from this scan (bootstrap) |
--fail-on-policy |
exit 4 if any baseline/policy violation |
--active |
calls safe-read tools to verify BOLA/secret exposure (needs --i-have-authorization) |
--active-all |
active-probe all tools, not just safe-read (dangerous; labs only) |
--active-dry-run |
preview what active mode would call - calls nothing |
--active-log FILE |
audit log of every active tool call |
--format/-f |
text (default), json, md, sarif, html |
--verbose/-v |
explain probe misses: -v shows HTTP responses that weren't MCP (401, 404, redirect…), -vv also shows connection errors |
--concurrency/-c |
parallel probes (default 16) |
Exit codes: 0 found (or clean), 1 nothing found, 2 --fail-on threshold hit,
3 drift found (diff --fail-on-drift), 4 --fail-on-policy violation.
Drift detection
mcpsweep 10.10.0.31 --ports 8090 -f json -o baseline.json # week 1
mcpsweep 10.10.0.31 --ports 8090 -f json -o current.json # week 2
mcpsweep diff baseline.json current.json
Reports new / removed servers and tools, newly-poisoned descriptions, and risk-level changes - turning point-in-time scans into continuous monitoring.
Windows / Git Bash note: Git Bash (MSYS) rewrites arguments that look like Unix paths, so
--paths /mcp/apibecomes a Windows path before the tool sees it. Either omit--paths(the built-in defaults are unaffected), prefix the command withMSYS_NO_PATHCONV=1, or run from PowerShell /cmd.
What it detects
- Live MCP endpoints across many candidate paths/ports, via the legacy
initializehandshake and the modern statelessserver/discover(spec 2026-07-28) - so modern-only servers aren't missed (Streamable-HTTP and SSE-framed responses). Dual-era servers are tagged. - Transport weaknesses (read-only live probes): DNS-rebinding (foreign
Host/Originaccepted), CORS wildcard/reflected-with-credentials, LAN exposure (unauthenticated on a non-loopback address - NeighborJack), and sibling-endpoint auth gaps (one path protected, a sibling open). - Known-vulnerable versions: matches
serverInfoagainst a bundled, offline advisory DB (no OSV/NVD calls). - Hidden/deceptive metadata: ANSI escapes, zero-width, bidi overrides, and Unicode TAG-block concealment in tool metadata and server instructions.
- Full-schema tool poisoning: injected instructions anywhere in the tool (param names, descriptions, enums, annotations) - not just the description.
- Rug-pulls:
mcpsweep diffflags a tool whose signature changed since the baseline (MCPoison class), plus tool shadowing across servers. - OAuth metadata hygiene: SSRF targets, bad schemes, shell metacharacters, missing issuer, over-broad scopes - and it refuses to fetch a link-local / cloud-metadata / private target itself.
- Dangerous local configs (
lint-config):sh -c,curl|sh, unpinnednpx -y/uvx, inline-eval interpreters, plaintext secrets. - Server fingerprint: name, version, protocol, capabilities, instructions.
- No authentication:
initializethat succeeds with no credentials. - Auth-gated endpoints:
401/403with an MCP/WWW-Authenticatesignature; with--auth-probe, follows the OAuth metadata chain and classifies as OAuth 2.1 protected / non-standard / misconfigured (missing PKCE, open DCR). - Risky tools: name/description heuristics tag
rce,sql,money,destructive,write,secret,pii,filesystem, … - Prompt injection / poisoning in tool descriptions and server
instructions, prompt templates, and resource listings ("ignore previous instructions", "silently", "password_hash", …). - Injection surface: high-impact tools (
sql/rce/…) that accept a free-form string parameter. - HTTP fingerprint:
Server/X-Powered-Byheaders, and server names that hint at an elevated or untrusted purpose. - Deep vulnerability analysis (
--deep): parameter sinks (command-injection, SQLi, path-traversal, SSRF), sensitive-file resources, prompt-injection surface, annotation mismatches, and confused-deputy tool chaining; with--read-resources, scans resource contents for secrets/PII and stored injection. - Verified exploitation (
--active, opt-in): actually calls safe-read tools to confirm unauthenticated BOLA/IDOR and real secret/PII exposure - the one mode that isn't read-only, gated behind--i-have-authorization(or--active-dry-run).
A per-endpoint risk score rolls these up into low / medium / high / critical.
Library use
from mcpsweep import scan
for ep in scan(["10.10.0.31"], ports=[8090], proxy="http://127.0.0.1:8080"):
print(ep.url, ep.server_name, ep.risk_level)
for t in ep.tools:
print(" ", t.name, t.tags, "POISONED" if t.poisoned else "")
Roadmap
Planned features - stdio scanning, OAuth/auth-spec detection, deep vulnerability discovery, policy baselines, and active authz probing - are specced in docs/ROADMAP.md.
License
MIT
Metadata
Release files for mcpsweep 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcpsweep-1.0.1.tar.gz | 60.3 kB | With provenance | Details for mcpsweep-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcpsweep-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for mcpsweep-1.0.1-py3-none-any.whl |
Total release size: 112.5 kB
Release files / mcpsweep-1.0.1.tar.gz
| Download URL | mcpsweep-1.0.1.tar.gz |
|---|---|
| Size | 60.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db2958a6be1ad0a15506f0e1dcd1b29bceabcebbf5ec26735a817e6236742e2c
|
|
BLAKE2b-256 checksum How to use checksums |
0741be92c6d5519c3bd606fdfba1dc5dd863e5634e432d89ed15bfa2ace4ab9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / mcpsweep-1.0.1-py3-none-any.whl
| Download URL | mcpsweep-1.0.1-py3-none-any.whl |
|---|---|
| Size | 52.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f5b5fb366a61d4e00301c97512c65912bbf128494bbc39e1d5edc3221f85bb60
|
|
BLAKE2b-256 checksum How to use checksums |
3add9303d6f474b0d9b8692dffd4efd7ad6c9d9ab309069cd6cc6548aaf795ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for mcpsweep 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mcpsweep-1.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.