mcp-shield  by riseandignite

CLI tool for MCP server security scanning

created 3 months ago
494 stars

Top 63.5% on sourcepulse

GitHubView on GitHub
Project Summary

MCP-Shield is a security scanner designed to detect vulnerabilities in Model Context Protocol (MCP) server configurations. It targets developers and security auditors working with MCP, helping them identify risks like prompt injection, data exfiltration, and cross-origin violations before deploying or during audits. The tool enhances analysis by optionally integrating with Anthropic's Claude AI.

How It Works

MCP-Shield parses MCP configuration files (typically .mcp/*.json or claude_desktop_config.json) to analyze tool definitions. It looks for malicious patterns such as hidden instructions within tool descriptions, parameters that could be used for data exfiltration, and instructions that modify the behavior of other tools (tool shadowing). The core advantage is its ability to detect subtle, prompt-level attacks that might bypass traditional code-based security checks.

Quick Start & Requirements

  • Primary install / run command: npx mcp-shield
  • Prerequisites: Node.js and npm/npx. Optional: Anthropic Claude API key for enhanced analysis.
  • Links: Official Docs

Highlighted Details

  • Detects hidden instructions, data exfiltration channels, tool shadowing, and cross-origin violations.
  • Supports configuration files for Cursor, Claude Desktop, Windsurf, VSCode, and Codeium.
  • Offers optional AI-powered analysis using Anthropic Claude.
  • Includes a "safe list" feature to exclude specific servers from scans.

Maintenance & Community

  • Contributions are welcome via Pull Requests.
  • Inspired by security research from Invariant Labs.

Licensing & Compatibility

  • License: MIT License.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

The tool's effectiveness relies on the accuracy of its pattern matching and AI analysis. It may not detect all novel or highly sophisticated attack vectors. The "identify-as" flag is for testing potential bait-and-switch scenarios and requires careful interpretation.

Health Check
Last commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
40 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.