Skip to content
Back to search

mcp-audit

Static security audit for MCP configs: plaintext secrets, unpinned servers, broad filesystem access, auto-approve and tool poisoning. Zero dependencies.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/nexqor--mcp-audit/badge.svg)](/listings/nexqor--mcp-audit)

HTML

<a href="/listings/nexqor--mcp-audit"><img src="/api/listings/nexqor--mcp-audit/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

git clone https://github.com/Nexqor/mcp-audit && cd mcp-audit
python mcp_audit.py                                  # auto-discovers known config locations
python mcp_audit.py example_risky_mcp.json          # audit a specific file
python mcp_audit.py --tools example_poisoned_tools.json   # scan a tools/list dump for poisoning

Auto-discovery checks: Claude Desktop (Windows / macOS / Linux), `~/.claude.json`, Cursor (`~/.cursor/mcp.json`, `.cursor/mcp.json`), VS Code (`.vscode/mcp.json`), Windsurf, and `.mcp.json` in the current project.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 101 lines · 1 finding marked
  1. <p align="center">
  2. <img src="https://raw.githubusercontent.com/Nexqor/Nexqor/main/banner.png" alt="Nexqor" width="100%">
  3. </p>
  4. <h1 align="center">mcp-audit 🔍</h1>
  5. <p align="center">
  6. <b>Static security audit for MCP (Model Context Protocol) configs.</b><br/>
  7. Find plaintext secrets, unpinned packages, remote code at launch, over-broad filesystem access,<br/>
  8. insecure transports, auto-approve flags and <b>tool poisoning</b> before your agent does.
  9. </p>
  10. <p align="center">
  11. <img src="https://img.shields.io/badge/python-3.9%2B-c41237?style=for-the-badge&logo=python&logoColor=white" alt="python"/>
  12. <img src="https://img.shields.io/badge/dependencies-0-c41237?style=for-the-badge" alt="deps"/>
  13. <img src="https://img.shields.io/badge/mode-read--only-000000?style=for-the-badge" alt="read-only"/>
  14. <a href="https://nexqor.github.io/playbook.html#mcp"><img src="https://img.shields.io/badge/why-playbook%2009-000000?style=for-the-badge" alt="playbook"/></a>
  15. </p>
  16. ---
  17. ## Why
  18. Every MCP server you add is code that runs with your permissions and text that your model trusts. In 2026, MCP became one of the fastest-growing attack surfaces for AI agents: poisoned tool descriptions, configs auto-loaded from cloned repos, and servers fetched unpinned from npm on every launch.
  19. `mcp-audit` reads your configs **without starting anything** and tells you what to fix.
  20. ## Quick start
  21. ```bash
  22. git clone https://github.com/Nexqor/mcp-audit && cd mcp-audit
  23. python mcp_audit.py # auto-discovers known config locations
  24. python mcp_audit.py example_risky_mcp.json # audit a specific file
  25. python mcp_audit.py --tools example_poisoned_tools.json # scan a tools/list dump for poisoning
  26. ```
  27. Auto-discovery checks: Claude Desktop (Windows / macOS / Linux), `~/.claude.json`, Cursor (`~/.cursor/mcp.json`, `.cursor/mcp.json`), VS Code (`.vscode/mcp.json`), Windsurf, and `.mcp.json` in the current project.
  28. ## What it checks
  29. | Rule | Severity | Finding |
  30. |------|----------|---------|
  31. | `remote-code-at-launch` | 🔴 critical | `curl … \| sh` or remote downloads in the launch command |
  32. | `docker-privileged` | 🔴 critical | MCP container runs `--privileged` |
  33. | `hidden-characters` | 🔴 critical | Unicode tag / zero-width / bidi characters in tool metadata |
  34. | `plaintext-secret` | 🟠 high | API keys and tokens inlined in `env` or `headers` |
  35. | `secret-in-args` / `secret-in-url` | 🟠 high | Credentials on the command line or in the server URL |
  36. | `broad-filesystem` | 🟠 high | Filesystem server pointed at `/`, `~`, `C:\` or your home dir |
  37. | `docker-broad-mount` | 🟠 high | Host root, home or Docker socket mounted into the container |
  38. | `insecure-transport` | 🟠 high | Remote MCP over plain `http://` |
  39. | `auto-approve` | 🟠 high | `alwaysAllow` / `autoApprove` skips human approval |
  40. | `tool-poisoning` | 🟠 high | Override phrases, fake `<IMPORTANT>` tags, secret-file references, exfiltration directives in tool descriptions |
    • Warning: Contains a <important> block, a common wrapper for instructions hidden in a tool description
    • Line 52 on GitHub
  41. | `unpinned-package` | 🟡 medium | `npx` / `uvx` / `bunx` package without an exact version |
  42. | `docker-unpinned` | 🟡 medium | Image without digest or with `:latest` |
  43. | `shell-launcher` | 🟡 medium | Server launched through `bash` / `cmd` / `powershell` |
  44. | `auto-install`, `long-description` | 🔵 low | `-y` auto-install, suspiciously long tool descriptions |
  45. ## Example
  46. Running against [`example_risky_mcp.json`](example_risky_mcp.json) flags, among others:
  47. ```text
  48. [CRITICAL] helper: Launch command downloads and/or executes remote code
  49. [CRITICAL] sandbox: Container runs --privileged
  50. [HIGH ] filesystem: Filesystem access granted to '/'
  51. [HIGH ] github: env.GITHUB_PERSONAL_ACCESS_TOKEN holds a plaintext secret
  52. [HIGH ] remote-notes: Remote MCP server over plain HTTP
  53. [HIGH ] remote-notes: Credential embedded in server URL
  54. [HIGH ] remote-notes: 'alwaysAllow' skips human approval for all tools
  55. [MEDIUM ] filesystem: 'npx @modelcontextprotocol/server-filesystem' runs the latest version on every launch
  56. ```
  57. …while `safe-weather` (pinned `uvx` package, secret referenced from env) passes clean.
  58. And [`example_poisoned_tools.json`](example_poisoned_tools.json) shows the classic tool-poisoning pattern: an innocent `add_numbers` tool whose description tells the model to read `~/.ssh/id_rsa` and hide it from the user.
  59. ## CI usage
  60. ```yaml
  61. - name: Audit MCP configs
  62. run: python mcp_audit.py .vscode/mcp.json .cursor/mcp.json --fail-on high --json mcp-audit.json
  63. ```
  64. ## Hardening checklist
  65. 1. Pin every MCP server to an exact version or image digest.
  66. 2. Keep secrets in env vars backed by a secret store, never inline.
  67. 3. Scope filesystem servers to one project directory.
  68. 4. Never auto-approve tools that write, send or execute.
  69. 5. Disable auto-loading of workspace MCP configs from untrusted repos.
  70. 6. Re-audit tool descriptions on every server update (rug pulls).
  71. Full background: [Playbook 09 · MCP Tool Poisoning](https://github.com/Nexqor/ai-attack-playbook/blob/main/09-mcp-tool-poisoning.md) · [AI Agent Security Checklist](https://nexqor.github.io/checklist.html)
  72. ## Limitations
  73. Static analysis of configs and tool dumps only. It does not connect to servers, verify package integrity, or catch a payload that is paraphrased beyond its heuristics. Treat a clean result as "no known red flags", not "safe".
  74. ---
  75. MIT License · Part of the [Nexqor](https://github.com/Nexqor) AI security toolkit · [@whyNexqor](https://x.com/whyNexqor)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.