Skip to main content

Security audit CLI for MCP (Model Context Protocol) configurations. Find leaked API keys, excessive permissions, and vulnerable servers before attackers do.

Project description

๐Ÿ›ก๏ธ mcp-guard

Security audit CLI for MCP (Model Context Protocol) configurations.

Find leaked API keys, excessive permissions, and vulnerable servers before attackers do.

pip install mcp-vigil
mcp-vigil scan

Demo

$ mcp-vigil scan

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘       MCP GUARD โ€” Security Audit     โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ“„ ~/.cursor/mcp.json
   Servers: 5  |  Findings: 0 critical, 3 high, 1 other  |  Score: 67/100 (C)

๐ŸŸ  [HIGH] Excessive filesystem access: /
   Server 'filesystem' has --directory set to / โ€” entire disk exposed.
   Fix: Restrict to a specific subdirectory.

๐ŸŸ  [HIGH] Secret in env block of MCP config
   Server 'github', env: GITHUB_PERSONAL_ACCESS_TOKEN
   Contains a hardcoded secret value in the config file.
   Fix: Move to .env file.

๐ŸŸ  [HIGH] Secret in env block of MCP config
   Server 'slack', env: SLACK_BOT_TOKEN
   Contains a hardcoded secret value in the config file.
   Fix: Move to .env file.

๐ŸŸก [MEDIUM] MCP server using HTTP without TLS
   Server 'insecure-remote' connects via http:// โ€” data not encrypted.
   Fix: Use https:// instead.

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Files scanned:  1
  Total findings: 4  (3 HIGH, 1 MEDIUM)

โš ๏ธ  High-severity issues found โ€” fix soon

mcp-vigil demo


What it does

Scans your MCP configuration files and finds:

  • ๐Ÿ”ด Hardcoded API keys โ€” GitHub tokens, OpenAI keys, AWS credentials in plain text
  • ๐ŸŸ  Excessive filesystem access โ€” Servers with access to / or /home
  • ๐ŸŸ  Untrusted server sources โ€” MCP servers from pastebin, raw GitHub gists, etc
  • ๐ŸŸ  Known CVEs โ€” Checks against CVE-2025-49596, CVE-2025-6514, and more
  • ๐ŸŸก Unpinned versions โ€” npx packages without version pins (supply chain risk)
  • ๐ŸŸก Insecure transport โ€” HTTP without TLS for remote servers
  • ๐Ÿ”ต Missing environment variables โ€” Referenced but undeclared env vars

Quick Start

# Install
pip install mcp-guard

# Scan all found MCP configs
mcp-guard scan

# Scan a specific file
mcp-guard scan --path ~/.cursor/mcp.json

# JSON output (for CI/CD)
mcp-guard scan --json

# Fail CI if critical issues found
mcp-guard scan --ci

Supported Config Locations

Auto-discovers MCP configs in:

  • Cursor: ~/.cursor/mcp.json
  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Claude Code: ~/.claude/mcp.json, .claude/mcp.json
  • VS Code: .vscode/mcp.json
  • Windsurf: ~/.windsurf/mcp.json

Example Output

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘       MCP GUARD โ€” Security Audit     โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ“„ /Users/dev/.cursor/mcp.json
   Servers: 5  |  Findings: 2 critical, 1 high, 3 other  |  Score: 42/100 (D)

๐Ÿ”ด [CRITICAL] Hardcoded GitHub Personal Access Token found
   /Users/dev/.cursor/mcp.json:12
   Found hardcoded credential: ghp_***Ab12. Anyone with access can use this key.
   Fix: Replace with environment variable reference: ${GITHUB_TOKEN}

๐ŸŸ  [HIGH] Excessive filesystem access: /
   /Users/dev/.cursor/mcp.json (server: filesystem)
   MCP server 'filesystem' has access to Root directory โ€” entire disk exposed.
   Fix: Restrict to a specific subdirectory.

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Files scanned:  1
  Total servers:  5
  Total findings: 5
    2 CRITICAL
    1 HIGH
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

โš ๏ธ  CRITICAL ISSUES FOUND โ€” fix immediately

GitHub Action (CI/CD)

- uses: mcp-guard/action@v1
  with:
    fail-on: critical

Add this to your CI pipeline to block merges if MCP security issues are introduced.


Why this exists

10,000+ MCP servers exist. 53% use static API keys. Developers add MCP servers to their AI coding tools daily โ€” often without reading the source code or checking permissions.

As AI agents get access to terminals, files, and APIs through MCP, a single misconfigured server becomes a critical attack vector.

mcp-guard is npm audit for the MCP ecosystem.


Roadmap

  • Auto-fix mode (mcp-guard fix)
  • VS Code extension (real-time warnings in editor)
  • Web dashboard for team management (paid)
  • Custom rule support (company security policies)
  • Integration with Smithery/PulseMCP registry for trust verification

License

MIT ยฉ 2026

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_vigil-0.3.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_vigil-0.3.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_vigil-0.3.0.tar.gz.

File metadata

  • Download URL: mcp_vigil-0.3.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mcp_vigil-0.3.0.tar.gz
Algorithm Hash digest
SHA256 729e5e4fc6a2e48238f6bf1056775da84902b35dc65602736ee0b7119d74d87a
MD5 7be32df90e7e5b15b065cb4d46f29020
BLAKE2b-256 de2a161883f393d36ab9614d551cc2314299b3becd56544b65fa87e002a682d0

See more details on using hashes here.

File details

Details for the file mcp_vigil-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_vigil-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mcp_vigil-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ebcb3ff386284c41172d42b0943458074d00e5cf42ed92c6dd5ec6a07fd26bc
MD5 0fd07e8e486ccc4c05cf586609c3ea5a
BLAKE2b-256 7f83fc2bd2c6d6b4047b9412058c5bddc6085c263bad71f92624fdab0d9aafb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page