MCP Shield
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Shield scan the current directory for security risks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Shield
Security scanner and MCP server for Model Context Protocol servers, tools, prompts, and AI agent projects.
MCP gives agents access to tools. MCP Shield helps you catch the obvious dangerous parts before they reach production: leaked secrets, shell execution, risky tool descriptions, prompt-injection text, and CI-breaking security regressions.
mcp-scan .[HIGH] code.shell_true server.py:42
Shell execution is enabled.
subprocess.run(cmd, shell=True)
[CRITICAL] secret.literal .env:1
Possible hard-coded secret.
OPENAI_API_KEY="sk-..."Why MCP Shield
MCP servers often expose powerful capabilities: filesystem access, shell commands, network calls, credentials, browser automation, databases, and internal tools.
That is exactly where small mistakes become expensive:
a tool description encourages unsafe behavior
a test key becomes a real leaked token
an agent can call a shell command with user-controlled input
a prompt or resource contains injection text
CI has no security gate for MCP-specific risks
MCP Shield is the simple first line of defense: fast static checks, useful output, and a non-zero exit code when risk crosses your threshold.
Related MCP server: Mund
Features
runs as both a CLI and an MCP server
built on the official MCP Python SDK
CI-friendly severity gates
text, JSON, Markdown, and SARIF output
inline suppressions with rule IDs
.mcp-scan-ignorefor fixtures and intentional demos
What It Finds
Risk | Examples |
Hard-coded secrets | API keys, tokens, passwords, private keys |
Process execution |
|
MCP tool risk | tools named or described as delete, shell, token, secret, filesystem |
Environment access |
|
Prompt injection text | "ignore previous instructions", system prompt leakage phrases |
Install
From a local checkout:
pip install .Run without installing:
python -m mcp_security_scanner.cli .MCP Server
Run MCP Shield as a stdio MCP server:
mcp-shield-serverAvailable tools:
scan_path_tool- scan a local MCP server or agent projectlist_rules- list rule IDs and descriptions
Example Claude Desktop-style command:
{
"mcpServers": {
"mcp-shield": {
"command": "mcp-shield-server"
}
}
}Usage
mcp-scan .
mcp-scan path/to/mcp-server
mcp-scan . --format json
mcp-scan . --format markdown --output mcp-security-report.md
mcp-scan . --format sarif --output mcp-shield.sarif
mcp-scan . --fail-on mediumFormats:
textfor humansjsonfor automationmarkdownfor PR comments and reportssariffor GitHub code scanning
Severity gates:
lowmediumhighcritical
--fail-on high exits with code 1 when any high or critical finding exists.
Ignore Files
Create .mcp-scan-ignore in the scanned directory:
tests/
fixtures/
examples/unsafe-demo.pyUse this for intentional fixtures and demos. Do not use it to hide production risks.
Suppressions
Suppress a reviewed finding on the same line:
subprocess.run(cmd) # mcp-shield: ignore code.subprocessUse all only for test fixtures:
subprocess.run(cmd, shell=True) # mcp-shield: ignore allExample
Scan the intentionally unsafe example:
python -m mcp_security_scanner.cli examples/unsafe-mcp-server --fail-on criticalGitHub Actions
name: MCP security scan
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install .
- run: mcp-scan . --fail-on highRoadmap
MCP SDK-aware parsing for Python and TypeScript servers
safer default rule pack for enterprise MCP servers
prompt/resource-specific injection checks
PyPI release for
pipx install mcp-shield
Repository Topics
Add these GitHub topics for discovery:
mcp, model-context-protocol, ai-agents, security, security-tools, scanner, devtools, llm, prompt-injection, static-analysisGitHub recommends repository topics because they help people discover and contribute to projects by purpose and subject area.
Scope
MCP Shield is a static heuristic scanner. It catches common risks early, but it is not a full security audit.
Help It Grow
MCP security is moving fast. The most useful contributions right now are real-world unsafe MCP examples, low-noise detection rules, and CI integrations.
If MCP Shield catches something useful, star the repo so more MCP builders can find it.
Available Tools
2 toolslist_rulesA
List MCP Shield rule IDs and descriptions.
Inputs: no named parameters.
scan_path_toolC
Scan a local MCP server or agent project for security risks.
Inputs: path, fail_on, output_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one lists all rule IDs and descriptions, the other scans a specific path. No overlap in functionality.
Both tools use snake_case and a verb_noun pattern. 'scan_path_tool' has an extra '_tool' suffix, but this is a minor deviation from the pattern of list_rules.
Only 2 tools for a security-focused MCP server is very limited. A typical security tool would require additional actions like rule details, scan results, or configuration.
The server lacks essential operations: ability to get details of individual rules, view scan results, configure scans, or take actions based on findings. Significant gaps for a security scanning server.
Maintenance
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Security scanner for AI agents and MCP servers: injection, jailbreak, tool abuse.
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Security scanner for MCP servers and skills: Unicode injection, patterns, secrets.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceSecurity scanner for MCP servers and AI-generated code. Detects leaked API keys, PII, prompt injection, and MCP misconfigs with A-F security grades.MIT
- AlicenseNot gradedqualityBmaintenanceMCP security scanner for AI agents - detects prompt injection, secrets, PII, and vets MCP servers before installation1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceScans MCP servers for prompt injection, supply chain attacks, excessive permissions, and code execution risks. Includes an offline blacklist that catches known-compromised packages like LiteLLM 1.82.7/1.82.8 and Trivy with zero latency.19MIT
- AlicenseNot gradedqualityCmaintenanceSecurity scanner for MCP servers. Detects prompt injection, command injection, auth bypass, and excessive permissions across tools, resources, and prompts.24 npm3MIT