Skip to content

aaronlab/mcp-shield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MCP Shield

๐Ÿ›ก๏ธ MCP Shield

Security Auditor & Trust Dashboard for MCP Servers
Scan. Score. Secure โ€” before your AI agent gets compromised.

PyPI Python 3.9+ MIT License GitHub Stars


MCP Shield is a CLI tool that automatically discovers your locally configured MCP (Model Context Protocol) servers, runs 8 categories of security checks, assigns a trust score (Aโ€“F), and generates beautiful reports โ€” all in one command.

$ mcp-shield scan

  โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
  โ•‘                  ๐Ÿ›ก๏ธ  MCP Shield v1.0                        โ•‘
  โ•‘              Security Auditor & Trust Dashboard              โ•‘
  โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  ๐Ÿ“ Discovered 4 MCP servers across 3 config files

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ Server           โ”‚ Score โ”‚ Grade โ”‚ Top Finding              โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚ filesystem       โ”‚  85   โ”‚   A   โ”‚ SCOPE-001: broad perms   โ”‚
  โ”‚ github           โ”‚  72   โ”‚   B   โ”‚ ENV-002: hardcoded token โ”‚
  โ”‚ puppeteer        โ”‚  41   โ”‚   D   โ”‚ NET-001: binds 0.0.0.0   โ”‚
  โ”‚ sketchy-mcp      โ”‚  18   โ”‚   F   โ”‚ KNOWN-001: risky package โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  โš   Overall Trust Score: 54 / 100 (C)
  ๐Ÿ’ก Run `mcp-shield fix <server>` for remediation steps.

MCP is the backbone of AI agent tooling in 2026 โ€” but most servers run with zero security review. MCP Shield changes that.


โšก Quick Start

pip install mcp-shield

# Scan all auto-discovered MCP servers
mcp-shield scan

# Generate an HTML trust dashboard
mcp-shield scan --format html -o report.html

# Get remediation guidance for a specific server
mcp-shield fix filesystem

That's it. No config files, no API keys, no setup.


๐Ÿค” Why MCP Shield?

MCP servers are the new attack surface of the AI agent era. A single misconfigured server can:

  • ๐Ÿ”“ Leak API keys and secrets โ€” hardcoded tokens in env vars or command args
  • ๐ŸŒ Expose local services to the internet โ€” servers binding to 0.0.0.0 without intent
  • ๐Ÿ’‰ Enable command injection โ€” shell invocations in server startup commands
  • ๐Ÿ“ค Exfiltrate your data โ€” servers with both filesystem and network access
  • ๐ŸŽญ Run typosquatted packages โ€” unscoped npx/uvx installs from public registries

Most developers configure MCP servers once and never audit them again. MCP Shield gives you continuous visibility with a single command.


โœจ Features

Feature Description
Auto-Discovery Finds servers from Claude Code, Cursor, and project-level configs automatically
8 Security Check Categories 15+ individual rules across scope, command, env, package, network, exfiltration, known-risk, and privilege checks
Trust Scoring 0โ€“100 score with Aโ€“F letter grades, per-server and overall
Rich CLI Output ASCII art banners, colored tables, severity-coded findings via Rich
HTML Dashboard Glassmorphism dark-theme report with animated SVG trust gauges
JSON Export Machine-readable output for CI/CD pipelines
Guided Remediation mcp-shield fix provides step-by-step fixes for each finding
Zero Config Works out of the box โ€” just install and scan

๐Ÿ“ Auto-Discovery

MCP Shield knows where to look. It automatically scans:

Client Config Paths
Claude Code ~/.claude/settings.json, ~/.claude.json
Cursor ~/.cursor/mcp.json
Project-level .mcp.json, .cursor/mcp.json in current directory

Pass --path to scan any custom config location:

mcp-shield scan --path /path/to/custom/config.json

๐Ÿ” Security Checks Reference

ID Category Severity What It Detects
SCOPE-001 Scope ๐Ÿ”ด High Wildcard (*) in permission allow-lists
SCOPE-002 Scope ๐ŸŸก Medium Missing permission allow-list entirely
CMD-001 Command ๐Ÿ”ด High Shell invocation (sh -c, bash -c, cmd /c)
CMD-002 Command ๐ŸŸก Medium Command injection risk via string interpolation
ENV-001 Environment ๐ŸŸก Medium Sensitive env var names (*_KEY, *_SECRET, *_TOKEN)
ENV-002 Environment ๐Ÿ”ด High Hardcoded secrets (API keys, tokens in plaintext)
PKG-001 Package ๐ŸŸก Medium Unscoped npx package (typosquatting risk)
PKG-002 Package ๐ŸŸก Medium Unscoped uvx package (typosquatting risk)
NET-001 Network ๐Ÿ”ด High Server binding to 0.0.0.0 (all interfaces)
NET-002 Network ๐ŸŸก Medium Explicit port exposure in arguments
EXFIL-001 Exfiltration ๐Ÿ”ด High Combined filesystem + network access (data exfil risk)
EXFIL-002 Exfiltration ๐ŸŸก Medium Write access to sensitive paths with outbound network
KNOWN-001 Known Risk ๐Ÿ”ด High Package found in known-risky MCP server database
PRIV-001 Privilege ๐Ÿ”ด High sudo in server command
PRIV-002 Privilege ๐Ÿ”ด High Running as root
PRIV-003 Privilege ๐Ÿ”ด High Docker --privileged flag

๐ŸŽฏ Usage Examples

Basic scan

mcp-shield scan

HTML trust dashboard

mcp-shield scan --format html -o report.html

Generates a dark-theme glassmorphism dashboard with animated SVG trust-score gauges, per-server breakdowns, and finding details. Open report.html in any browser.

JSON output for CI/CD

mcp-shield scan --format json

# Use in CI pipelines โ€” fail if overall grade is below B
mcp-shield scan --format json | jq -e '.overall_grade <= "B"'

Scan a specific config

mcp-shield scan --path ~/.cursor/mcp.json

Get remediation steps

mcp-shield fix puppeteer
  ๐Ÿ”ง Remediation for: puppeteer

  NET-001 (High) โ€” Server binds to 0.0.0.0
  โ”œโ”€ Risk:  Exposes server to all network interfaces
  โ”œโ”€ Fix:   Change bind address to 127.0.0.1
  โ””โ”€ Where: args: ["--host", "0.0.0.0"] โ†’ ["--host", "127.0.0.1"]

  SCOPE-001 (High) โ€” Wildcard permission allow-list
  โ”œโ”€ Risk:  Server has unrestricted tool access
  โ”œโ”€ Fix:   Explicitly list only the tools you need
  โ””โ”€ Ref:   https://modelcontextprotocol.io/docs/security

๐Ÿ—๏ธ Trust Scoring

Each server receives a 0โ€“100 trust score based on weighted findings:

Grade Score Meaning
A 90โ€“100 Excellent โ€” minimal or no issues
B 80โ€“89 Good โ€” minor issues only
C 65โ€“79 Fair โ€” moderate risks present
D 50โ€“64 Poor โ€” significant security concerns
F 0โ€“49 Failing โ€” critical risks, immediate action needed

Scoring weights: ๐Ÿ”ด High findings deduct 15 pts, ๐ŸŸก Medium deduct 5 pts, ๐Ÿ”ต Low deduct 2 pts.


๐Ÿ› ๏ธ Installation

Requirements: Python 3.9+

# From PyPI (recommended)
pip install mcp-shield

# From source
git clone https://github.com/aaronagent/mcp-shield.git
cd mcp-shield
pip install -e .

The only runtime dependency is rich for CLI output.


๐Ÿค Contributing

Contributions are welcome! Here's how to get involved:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/new-check)
  3. Commit your changes (git commit -m 'Add new security check')
  4. Push to the branch (git push origin feat/new-check)
  5. Open a Pull Request

Areas where help is wanted

  • ๐Ÿ†• New security check rules
  • ๐ŸŒ Support for more MCP clients (VS Code, Windsurf, etc.)
  • ๐Ÿงช Test coverage
  • ๐Ÿ“– Documentation and translations
  • ๐Ÿ› Bug reports and feature requests

Please see CONTRIBUTING.md for detailed guidelines.


๐Ÿ“„ License

MIT ยฉ AARON AGENT


โญ Star History

If MCP Shield helped secure your AI agent setup, consider giving it a โญ โ€” it helps others discover the project.

Star on GitHub

ไธญๆ–‡่ฏดๆ˜Ž

๐Ÿ›ก๏ธ MCP Shield โ€” MCP ๆœๅŠกๅ™จๅฎ‰ๅ…จๅฎก่ฎกๅทฅๅ…ท

MCP Shield ๆ˜ฏไธ€ๆฌพๅ‘ฝไปค่กŒๅทฅๅ…ท๏ผŒไธ“ไธบ AI Agent ็”Ÿๆ€ไธญ็š„ MCP๏ผˆๆจกๅž‹ไธŠไธ‹ๆ–‡ๅ่ฎฎ๏ผ‰ๆœๅŠกๅ™จ ๆไพ›ๅฎ‰ๅ…จๆ‰ซๆๅ’Œไฟกไปป่ฏ„ไผฐใ€‚

ไธบไป€ไนˆ้œ€่ฆ MCP Shield๏ผŸ

2026 ๅนด๏ผŒMCP ๅทฒๆˆไธบ AI Agent ๅทฅๅ…ท้“พ็š„ๆ ธๅฟƒๅ่ฎฎใ€‚็„ถ่€Œ๏ผŒๅคงๅคšๆ•ฐๅผ€ๅ‘่€…ๅœจ้…็ฝฎ MCP ๆœๅŠกๅ™จๅŽไปŽๆœช่ฟ›่กŒ่ฟ‡ๅฎ‰ๅ…จๅฎก่ฎกใ€‚ไธ€ไธช้”™่ฏฏ้…็ฝฎ็š„ๆœๅŠกๅ™จๅฏ่ƒฝๅฏผ่‡ด๏ผš

  • ๐Ÿ”‘ API ๅฏ†้’ฅๅ’Œๅ‡ญๆฎๆณ„้œฒ
  • ๐ŸŒ ๆœฌๅœฐๆœๅŠกๆ„ๅค–ๆšด้œฒๅˆฐๅ…ฌ็ฝ‘
  • ๐Ÿ’‰ ๅ‘ฝไปคๆณจๅ…ฅๆ”ปๅ‡ป
  • ๐Ÿ“ค ๆ•ๆ„Ÿๆ•ฐๆฎ่ขซ็ชƒๅ–
  • ๐ŸŽญ ๆถๆ„ๅŒ…้€š่ฟ‡ typosquatting ๅ…ฅไพต

ๆ ธๅฟƒๅŠŸ่ƒฝ

  • ่‡ชๅŠจๅ‘็Žฐ โ€” ่‡ชๅŠจๆ‰ซๆ Claude Codeใ€Cursor ็ญ‰ๅฎขๆˆท็ซฏ็š„ MCP ้…็ฝฎๆ–‡ไปถ
  • 8 ๅคง็ฑปๅฎ‰ๅ…จๆฃ€ๆŸฅ โ€” ่ฆ†็›–ๆƒ้™ใ€ๅ‘ฝไปคใ€็Žฏๅขƒๅ˜้‡ใ€ๅŒ…็ฎก็†ใ€็ฝ‘็ปœใ€ๆ•ฐๆฎๅค–ๆณ„ใ€ๅทฒ็Ÿฅ้ฃŽ้™ฉใ€็‰นๆƒๆๅ‡
  • ไฟกไปป่ฏ„ๅˆ† โ€” 0โ€“100 ๅˆ†๏ผŒAโ€“F ็ญ‰็บง่ฏ„ไผฐ
  • ๅคš็ง่พ“ๅ‡บๆ ผๅผ โ€” ๅฝฉ่‰ฒ็ปˆ็ซฏ่กจๆ ผใ€HTML ๅฏ่ง†ๅŒ–ไปช่กจ็›˜ใ€JSON๏ผˆๆ”ฏๆŒ CI/CD ้›†ๆˆ๏ผ‰
  • ไฟฎๅคๆŒ‡ๅผ• โ€” ้€ๆญฅๆŒ‡ๅฏผไฟฎๅคๆฏไธ€้กนๅฎ‰ๅ…จๅ‘็Žฐ

ๅฟซ้€Ÿๅผ€ๅง‹

pip install mcp-shield

# ๆ‰ซๆๆ‰€ๆœ‰ๅทฒๅ‘็Žฐ็š„ MCP ๆœๅŠกๅ™จ
mcp-shield scan

# ็”Ÿๆˆ HTML ๆŠฅๅ‘Š
mcp-shield scan --format html -o report.html

# ๆŸฅ็œ‹ไฟฎๅคๅปบ่ฎฎ
mcp-shield fix <server-name>

ๅ‚ไธŽ่ดก็Œฎ

ๆฌข่ฟŽๆไบค Issue ๅ’Œ Pull Request๏ผ่ฏฆ่ง CONTRIBUTING.mdใ€‚


Built with ๐Ÿ”’ by AARON AGENT
Securing the AI agent ecosystem, one MCP server at a time.

About

๐Ÿ›ก๏ธ MCP Server Security Auditor & Trust Dashboard โ€” Scan, audit, and visualize your MCP server attack surface with trust scores (A-F), Rich CLI, and glassmorphism HTML reports

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages