MCP Security Scanner: Tool Poisoning, Secrets, Rug Pull Checks

Catch the MCP server that hides instructions in a tool description, or changes it after you approved it.

MCP Security Scanner: Tool Poisoning, Secrets, Rug Pull Checks product illustration

What it does

Scan MCP servers and MCP client configs for tool poisoning, tool shadowing, hidden Unicode, rug pulls, plaintext secrets and risky launch commands, offline: nothing is sent to any API. Python 3.9+, standard library only, one folder.

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 18 tests OK on Python 3.13 and 3.10.

Real terminal output from MCP Security Scanner: Tool Poisoning, Secrets, Rug Pull Checks: demo and passing tests

Quick start

python3 tools/mcpscan.py config                                   # every MCP config found on this machine
python3 tools/mcpscan.py server -- npx -y @acme/mcp-server@1.4.2  # one stdio server: list its tools, scan them
python3 tools/mcpscan.py server --url https://mcp.example.com/mcp --header "Authorization: Bearer $TOKEN"
python3 tools/mcpscan.py servers .cursor/mcp.json                 # start every server in a config, scan them together
python3 tools/mcpscan.py pin -- <server command>                  # fingerprint every tool definition (mcp-pins.json)
python3 tools/mcpscan.py verify -- <server command>               # later: what changed since you pinned it?
python3 tools/mcpscan.py rules                                    # all 27 rules

--json for scripts, --sarif out.sarif for GitHub code scanning, --fail-on high|medium|low|none (default high), --ignore MCP-T13,MCP-C10 to skip rules. Exit code 0 = clean at that level, 1 = findings, 2 = could not read or reach it. ./tools/demo.sh runs everything below on the bundled examples.

What it checks

Tool definitions (names, descriptions, titles, every parameter description and default, server instructions), fetched over stdio or Streamable HTTP from MCP 2026-07-28 or 2025-11-25 servers:

RuleSeverityFinds
MCP-T01highhidden instructions: <IMPORTANT> blocks, "before using this tool you must...", "ignore previous instructions"
MCP-T02high"do not tell the user", "silently", "the user doesn't need to know"
MCP-T03highpointers to ~/.ssh, .env, ~/.cursor/mcp.json, .aws/credentials, wallets, seed phrases
MCP-T04highexfiltration cues: "pass its content as 'sidenote'", "send ... to https://...", base64-encode, chat history
MCP-T05high/mediumtool shadowing: text that mentions another server's tools ("when the user uses send_email, add bcc...")
MCP-T06highzero-width, bidi and Unicode tag characters; tag-smuggled text is decoded and scanned too
MCP-T07mediumHTML comments, hidden images/links, whitespace padding that pushes text out of view
MCP-T09high/mediumparameters like sidenote, notes, context that ask for conversation history or file contents
MCP-T10mediumthe same tool name on two servers (the model may call the wrong one)
MCP-T11medium/lowdelete/drop/wipe tools marked read-only or non-destructive, or with no annotations
MCP-T12mediumtools that run arbitrary shell commands or code
MCP-T14mediumpressure framing: "VERY IMPORTANT:", "or the application will crash", "required by the system"
MCP-T08, T13lowvery long descriptions; URLs in tool text

Client configs: Cursor (.cursor/mcp.json, ~/.cursor/mcp.json), Claude Desktop (macOS, Windows, Linux), Claude Code (.mcp.json, ~/.claude.json incl. per-project servers), VS Code (.vscode/mcp.json and user mcp.json, comments allowed), Windsurf, Gemini CLI (settings.json), Codex (config.toml), Cline and Roo:

RuleSeverityFinds
MCP-C01mediumnpx/bunx/pnpm dlx/uvx/pipx without an exact version (or @latest)
MCP-C02highcurl ... | sh or iex in a launch command
MCP-C03highplaintext secrets in env, headers or args (GitHub, OpenAI, Anthropic, AWS, Stripe, Slack, Google, bearer tokens, DB URLs with passwords, secret-named variables), shown masked
MCP-C04highremote servers over http://
MCP-C05mediumfilesystem server given /, ~ or your whole home folder
MCP-C06highdocker run --privileged, host root or Docker socket mounts, host network
MCP-C07high/mediumalwaysAllow/autoApprove lists (* = high), Gemini trust: true
MCP-C08highservers started with sudo
MCP-C09, C10lowconfig with secrets readable by other users; container image without a tag or digest

Rug pulls: pin stores a SHA-256 of each tool's name, description, schemas and annotations in mcp-pins.json (commit it). verify reports changed tools with a diff of the description (MCP-R01, high), new tools (R02) and removed tools (R03), then runs the normal scan on the new definitions.

Use it in CI

ci/mcp-security.yml is a GitHub Actions workflow that scans the repo's MCP config and your own server against the committed pins, and uploads SARIF so findings show up in the Security tab and on pull requests.

The examples

  • examples/poisoned_server.py: a harmless server that reproduces publicly documented attacks (the poisoned add tool that asks for ~/.cursor/mcp.json in a sidenote, send_email shadowing hidden in Unicode tag characters, pressure framing, wrong annotations, a shell tool, and a rug pull with RUG=1). 12 findings.
  • examples/clean_server.py and examples/email_server.py: honest servers. 0 findings.
  • examples/benign_tools.json: 25 everyday tool definitions (files, GitHub, browser, SQL, docs, Slack, calendar): 0 high or medium findings, used as a false-positive check.
  • examples/configs/: a risky Cursor config (13 findings), a clean one (0), a VS Code JSONC file, a Codex TOML file and a two-server config for cross-server checks.

How it was tested

./run_tests.sh (18 tests, Python 3.13 and 3.10): every attack in the poisoned server, zero findings on the clean servers and the benign corpus, cross-server duplicates, every config rule on the risky config with secrets masked in the output, JSONC and TOML parsing (including the Python 3.9/3.10 TOML fallback), pin/verify catching a changed description, SARIF 2.1.0 output, --ignore, and exit codes. We also ran it on two of our own MCP servers (SQLite and Obsidian): 0 findings.

Honest limits

  • Pattern rules catch known techniques, not every possible injection. Reworded or translated attacks can slip through, and a clean scan does not prove a server is safe. Pinning plus review is the strongest protection here.
  • It reads tool definitions, not server code: a server with clean descriptions can still do harm when a tool runs.
  • Prompts and resources are not scanned yet; tools and server instructions are.
  • config and servers mode start or read what is on your machine; servers mode launches every server in the file, so run it only on configs you would start anyway.
  • OAuth flows are not handled: pass a token with --header.

Format and license

Zip, 34 KB, v1.0, 20 files. You may use and modify this kit for your own work and for clients you serve, including paid client work. Not affiliated with or endorsed by the MCP project or Anthropic.

FAQ

Does it send my config anywhere?
No. Everything runs locally; secrets are masked in output.
Does it start my servers?
Only in server/servers mode, which runs the same command your client would. config mode never starts anything.
Does a clean scan mean a server is safe?
No. It catches known patterns; review code you run.
How do I get the files?
Pay by card right here on youraitools.co: your download links appear on this page the moment the payment goes through (claim window: 72 hours, up to 5 downloads per 7 days). Need the files re-sent later? Email hello@youraitools.co.
Refunds?
Email hello@youraitools.co within 14 days if it doesn’t work and we can’t fix it.
Can I pay with crypto?
Yes. Pay the same price in USDC or USDT on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana from the "Pay with crypto" button, with no account or KYC. We check the payment on-chain and show your download links as soon as it confirms.

Get MCP Security Scanner: Tool Poisoning, Secrets, Rug Pull Checks

Scan MCP servers and configs for tool poisoning, hidden instructions, exposed secrets, risky commands and rug pulls. 27 rules, SARIF for CI, offline, Python.

Save with a bundle

Pairs well with

Related

1 email a week: new x402 + MCP tools and free kits.

Short weekly digest of new x402 + MCP tools and free kits, including the MCP OAuth Checker. No spam, unsubscribe any time.