Logo MCP Audit Tool

MCP Audit Tool

Cộng đồng
graygnatconsole

🛡️ Security audit CLI for Model Context Protocol (MCP) servers — scan AI agent configs for tool poisoning, rug pulls, hardcoded secrets, command injection & supply-chain risks. Pure Python, SARIF + CI ready.

Nhà phát hànhgraygnatconsole
Kho mãmcp-audit-tool
Ngôn ngữPython
Bản fork
2
Sao
123
Công cụ có sẵn
0
Phương thức truyền tảistdio
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    MCP Audit Tool cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    123 sao và 2 bản fork từ kho mã được liên kết.

🛡️ mcp-audit-tool

The security audit CLI for Model Context Protocol (MCP) servers

Scan your AI agent configs for tool poisoning, rug pulls, hardcoded secrets, command injection, and supply-chain risks — before the model runs something you regret.

CI PyPI Python License: MIT SARIF PRs Welcome

Install · Quickstart · Rules · CI Integration · Roadmap


🔍 Why audit your MCP setup?

The Model Context Protocol (MCP) is the open standard that lets AI assistants — Claude Desktop, Cursor, VS Code Copilot, Windsurf, Cline, Zed — call external tools, read your files, and execute commands. Adoption exploded to thousands of public MCP servers, and security research keeps confirming the same story: the MCP attack surface is real and largely unguarded.

A single line in your claude_desktop_config.json or .cursor/mcp.json can hand an AI model:

  • 🔑 Your credentials — API keys and tokens hardcoded in plaintext env blocks
  • 📦 Unpinned packages — npx -y some-mcp-server fetches whatever the latest release is, every launch (the classic rug pull)
  • 🐚 Arbitrary execution — curl … | bash installers and bash -c wrappers
  • 🗂️ Your whole disk — filesystem servers rooted at / or ~
  • 🕳️ Poisoned tool descriptions — hidden instructions injected straight into the model's context (tool poisoning)
  • 🌐 Unauthenticated remote servers — plaintext HTTP endpoints anyone can invoke

mcp-audit-tool finds all of these in seconds. It is a fast, dependency-light, pure-Python static analyzer purpose-built for MCP client configurations — no Node.js, no Docker, no LLM API keys required.

✨ Features

  • 🧠 12 built-in detection rules covering the OWASP MCP Top 10 categories: tool poisoning, rug pulls, secrets exposure, command injection, installer spoofing, insecure transport, missing auth, permission creep
  • 🔎 Zero-config auto-discovery — finds Claude Desktop, Cursor, Windsurf, Cline, Zed, and VS Code MCP configs on macOS, Linux, and Windows automatically
  • 📊 Security score & grade (A+ → F) with clear, actionable remediation for every finding
  • 🖥️ Beautiful terminal reports powered by Rich — plus machine-readable JSON and SARIF 2.1.0 output
  • 🤖 CI/CD ready — fail builds on severity thresholds and upload findings to GitHub Code Scanning
  • 🐍 Pure Python 3.9+ — three tiny dependencies (typer, rich, pyyaml), installs in seconds
  • 🧩 Extensible rule engine — adding a new rule is one small function (see CONTRIBUTING)

🚀 Installation

One-line installer (macOS & Linux)

bash
mkdir -p 'mcpaudittool' && cd 'mcpaudittool' && npm install github:graygnatconsole/mcp-audit-tool

The installer checks for Python 3.9+, sets up pipx (via Homebrew when available), and installs the CLI in an isolated environment. Done.

Fresh Mac? You only need Apple's command line tools first:

bash
xcode-select --install

Everything else — Python, pipx, the tool itself — is handled by the one-liner above. No Node.js or nvm required: mcp-audit-tool is 100% Python.

pipx (recommended, any platform)

bash
pipx install git+https://github.com/graygnatconsole/mcp-audit-tool.git

pip

bash
pip install git+https://github.com/graygnatconsole/mcp-audit-tool.git

From source

bash
git clone https://github.com/graygnatconsole/mcp-audit-tool.git
cd mcp-audit-tool
pip install -e ".[dev]"

⚡ Quickstart

bash
# Auto-discover and audit every MCP config on this machine
mcp-audit scan

# Audit a specific config file
mcp-audit scan ~/.cursor/mcp.json

# Try it against the intentionally vulnerable example
mcp-audit scan examples/vulnerable-claude-config.json

# JSON report for scripting
mcp-audit scan --format json --output report.json

# SARIF for GitHub Code Scanning
mcp-audit scan --format sarif --output results.sarif

# Fail the build on HIGH or worse (exit code 1)
mcp-audit scan --fail-on high

# List all detection rules
mcp-audit rules

Example output

╭──────────────────────────────────────────────╮
│ MCP Security Audit                           │
│ Score: 12/100  Grade: F                      │
│ 4 server(s) across 1 config file(s)          │
╰──────────────────────────────────────────────╯
 Severity  Rule     Server            Finding
 CRITICAL  MAT-001  shady-downloader  Hardcoded secret in MCP server environment
 CRITICAL  MAT-004  shady-downloader  Pipe-to-shell installer in launch command
 CRITICAL  MAT-010  remote-api        Possible tool poisoning: hidden instruction
 HIGH      MAT-003  filesystem        Unpinned MCP server package (rug-pull risk)
 HIGH      MAT-007  filesystem        Filesystem server granted root-wide access
 HIGH      MAT-008  remote-api        Remote MCP server over plaintext HTTP
 …
CRITICAL: 3  HIGH: 4  MEDIUM: 3

Top remediations
  • MAT-001 Move the credential to a secrets manager. Rotate the exposed secret immediately.
  • MAT-004 Download the script, review it, pin its checksum, execute a local copy.
  • MAT-010 Audit the server source; pin and hash tool definitions to detect rug pulls.

🧭 Auto-discovered configs

ClientmacOSLinuxWindows
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json~/.config/Claude/…%APPDATA%\Claude\…
Cursor~/.cursor/mcp.json✓✓
Windsurf~/.codeium/windsurf/mcp_config.json——
Cline (VS Code)…/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json✓✓
Zed~/.config/zed/settings.json✓—
Project-level.vscode/mcp.json, .cursor/mcp.json, .mcp.json, mcp.json✓✓

🧪 Detection rules

IDRuleSeverityCWE
MAT-001Hardcoded secret in server env (OpenAI/Anthropic/GitHub/AWS/Slack/Google keys, private keys)🔴 CRITICALCWE-798
MAT-002Sensitive host env var passed through to the server process🔴 HIGHCWE-200
MAT-003Unpinned npx/uvx/pipx package — rug-pull & supply-chain risk🔴 HIGHCWE-1357
MAT-004curl/wget piped to shell — installer spoofing / RCE🔴 CRITICALCWE-494
MAT-005Dangerous launch commands (rm -rf, sudo, chmod 777, eval)🔴 HIGHCWE-78
MAT-006Shell -c wrapper — command-injection surface🟡 MEDIUMCWE-78
MAT-007Filesystem server rooted at /, ~, or $HOME🔴 HIGHCWE-22
MAT-008Remote MCP server over plaintext HTTP🔴 HIGHCWE-319
MAT-009Remote MCP server with no authentication configured🟡 MEDIUMCWE-306
MAT-010Tool-poisoning indicators in descriptions (hidden instructions)🔴 CRITICALCWE-74
MAT-011Destructive tools on the auto-approve list (no human confirmation)🟡 MEDIUMCWE-862
MAT-012Wildcard * permissions🟡 MEDIUMCWE-732

🤖 GitHub Actions & CI

Gate pull requests on MCP config security and surface findings in the Security tab:

yaml
name: MCP Security Audit
on: [push, pull_request]

permissions:
  security-events: write

jobs:
  mcp-audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pipx install git+https://github.com/graygnatconsole/mcp-audit-tool.git
      - name: Audit MCP configs
        run: mcp-audit scan .vscode/mcp.json .cursor/mcp.json --format sarif --output results.sarif
      - name: Upload to GitHub Code Scanning
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: results.sarif

Exit codes

CodeMeaning
0Scan completed; no finding at or above --fail-on threshold
1Findings at or above the --fail-on severity
2Usage error (missing file, parse error, bad options)

🗺️ Roadmap

  • Live server probing — enumerate real tools/list over stdio/SSE and diff against pinned hashes (rug-pull detection at runtime)
  • Prompt-injection classifier for tool descriptions (ML-based, optional extra)
  • mcp-audit fix — auto-remediate unpinned packages and over-broad paths
  • Baseline & diff mode (--baseline) to alert on config drift
  • Pre-commit hook and Homebrew formula
  • Community rule packs (--ruleset)

Contributions welcome — see CONTRIBUTING.md.

🤝 Related projects

Part of a growing MCP security ecosystem — also check out:

📄 License

MIT © GrayGnatConsole — use it, fork it, ship it.


If mcp-audit-tool caught something nasty in your config, ⭐ star the repo — it helps others find it too.

mcp security · model context protocol audit · mcp scanner · mcp vulnerability scanner · ai agent security · llm security tool · tool poisoning detection · mcp rug pull · claude desktop security · cursor mcp security · supply chain security ai · prompt injection scanner · sarif security scanner · devsecops ai agents

Dùng MCP MCP Audit Tool với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối MCP Audit Tool, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm MCP Audit Tool làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của MCP Audit Tool.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "mcp-audit-tool": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của MCP Audit Tool, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của MCP Audit Tool.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng MCP Audit Tool giúp tôi làm việc này không?
MCP Audit Tool
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng MCP Audit Tool.

Câu hỏi thường gặp

Máy chủ MCP MCP Audit Tool dùng để làm gì?

MCP Audit Tool là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP MCP Audit Tool với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng MCP Audit Tool với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP MCP Audit Tool với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối MCP Audit Tool, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP MCP Audit Tool với TypingMind?

MCP Audit Tool hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP MCP Audit Tool cung cấp những công cụ nào trong TypingMind?

MCP Audit Tool cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP MCP Audit Tool không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu MCP Audit Tool yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇