MCP Shield logo

MCP Shield

by rob925

Scans MCP servers and agent projects for secrets, unsafe execution, risky tools, environment access, and prompt-injection text.

Install MCP Shield

Run the project’s own setup commands, in order.

Setup steps from the project

rob925/mcp-shield installs with its own commands rather than a config we can generate, so these are copied as-is. Run them in order in a terminal. Source: github.com

  1. 1. Install
    pip install .
    
  2. 2. Start the server
    mcp-shield-server
    
  3. 3. Install
    pipx install mcp-shield
    

Overview

The rob925/mcp-shield MCP server scans local MCP servers and AI agent projects for common security risks. It runs as a Python CLI or stdio MCP server, exposing tools to scan a path and list detection rules. Findings can be emitted as text, JSON, Markdown, or SARIF, with severity thresholds for CI failure. Reach for it before deployment or in pull-request checks when you need heuristic checks for secrets, process execution, environment access, risky tool descriptions, and prompt-injection phrases.

Use cases

  • Scan an MCP project before deployment
  • Gate pull requests on high-severity findings
  • Export SARIF results for GitHub code scanning
  • Review tool descriptions for risky language
  • Suppress known fixture findings by rule ID

Key features

  • Static checks for secrets and credentials
  • Detection of shell and process execution
  • Checks for environment-variable access
  • Prompt-injection phrase detection
  • Text, JSON, Markdown, and SARIF reports
  • CLI and stdio MCP interfaces

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

17/18 checks healthy over the last 91d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
Last commit4mo agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Shield works

What rob925/mcp-shield MCP server does

The rob925/mcp-shield MCP server performs static, heuristic checks against local MCP server code and AI agent projects. It looks for hard-coded API keys, tokens, passwords, and private keys; process execution patterns such as Python subprocess, Node.js child_process, and shell=True; and access to environment variables through patterns such as os.environ and process.env.

The scanner also evaluates MCP-related tool names and descriptions for terms associated with deletion, shells, tokens, secrets, and filesystem access. It checks text for prompt-injection language, including requests to ignore earlier instructions or expose system prompts. Results carry severities from low through critical and can be used as a CI gate.

How it works

Install the Python package from a local checkout, then scan a directory with mcp-scan . or provide a narrower project path. The command can print human-readable text or write JSON, Markdown, or SARIF reports. SARIF is intended for code-scanning workflows, while Markdown can be used in pull-request reports.

A --fail-on threshold makes the command return exit code 1 when findings at that level or above are present. For example, a high threshold fails on high and critical findings. This makes the rob925/mcp-shield MCP server suitable for a GitHub Actions step that installs the package and scans the checked-out repository.

The scanner supports .mcp-scan-ignore files for paths such as tests, fixtures, and deliberately unsafe examples. Individual reviewed findings can also be suppressed on the same source line with a rule ID. The all suppression is documented for test fixtures only.

Setup and configuration

Python 3.10 or newer is required. Install from the repository with pip install ., or run the module directly with python -m mcp_security_scanner.cli . without installing the command-line entry point.

To expose the rob925/mcp-shield MCP server to an MCP client, start mcp-shield-server as a stdio process. A Claude Desktop configuration can register that command under an mcpServers entry.

For CI, add a workflow step that checks out the repository, installs Python, installs the package, and runs mcp-scan . --fail-on high. Select the output format and destination with the corresponding CLI options.

Tools and capabilities

The stdio MCP interface provides two tools:

  • scan_path_tool scans a local MCP server or agent project.
  • list_rules returns the available rule IDs and their descriptions.

The command-line interface accepts a path, output format, output file, and severity threshold. Supported formats are text, JSON, Markdown, and SARIF. Rule identifiers can be used in inline suppression comments, allowing a reviewed exception to target one finding rather than disabling the complete scan.

Limitations and notes

rob925/mcp-shield is a static heuristic scanner, not a complete security audit. Its documented scope is catching common risks early, so a clean result should not be treated as proof that a project is safe. The roadmap mentions future MCP SDK-aware parsing for Python and TypeScript, additional enterprise rules, and more targeted prompt and resource injection checks; those items should not be assumed to be available now.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Shield

rob925/mcp-shield is an MCP server that connects MCP clients to a local static security scanner for MCP servers and AI agent projects. Its main tools are scan_path_tool, which scans a project path, and list_rules, which lists rule IDs and descriptions. It detects secrets, unsafe execution, risky tools, environment access, and prompt-injection text.

Install it from a local checkout with `pip install .`, then start it with `mcp-shield-server`. You can also run the scanner module directly using `python -m mcp_security_scanner.cli .` without installing the command-line entry point. Python 3.10 or newer is required.

Run `mcp-scan . --fail-on high` after checking out the repository and installing the package. The command returns exit code 1 when high or critical findings are present. JSON, Markdown, and SARIF output options are available for automation and reporting.

It scans for hard-coded secrets, process execution, shell-enabled commands, risky MCP tool names and descriptions, environment access, and prompt-injection phrases. The scanner is static and heuristic, so it catches common risks but does not replace a full security audit.

Yes. Claude Desktop can launch it as a stdio MCP server using the `mcp-shield-server` command in an `mcpServers` configuration. The provided setup does not describe any required environment variables or external credentials.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Shield AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/rob925-mcp-shield?style=directory)](https://allmcps.com/mcp/rob925-mcp-shield)
HTML Embed
<a href="https://allmcps.com/mcp/rob925-mcp-shield"><img src="https://allmcps.com/api/badge/rob925-mcp-shield?style=directory" alt="MCP Shield on AllMCPs" /></a>