https://github.com/aaronlab/mcp-shield
๐ก๏ธ 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
https://github.com/aaronlab/mcp-shield
ai-agent claude claude-code cli cybersecurity mcp mcp-server model-context-protocol python security security-audit trust-score
Last synced: 1 day ago
JSON representation
๐ก๏ธ 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
- Host: GitHub
- URL: https://github.com/aaronlab/mcp-shield
- Owner: aaronlab
- License: mit
- Created: 2026-04-02T02:23:20.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-02T02:23:22.000Z (2 months ago)
- Last Synced: 2026-05-09T15:53:22.449Z (25 days ago)
- Topics: ai-agent, claude, claude-code, cli, cybersecurity, mcp, mcp-server, model-context-protocol, python, security, security-audit, trust-score
- Language: Python
- Size: 30.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
๐ก๏ธ MCP Shield
Security Auditor & Trust Dashboard for MCP Servers
Scan. Score. Secure โ before your AI agent gets compromised.
---
MCP Shield is a CLI tool that **automatically discovers** your locally configured [MCP (Model Context Protocol)](https://modelcontextprotocol.io) 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 ` 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
```bash
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](https://github.com/Textualize/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:
```bash
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
```bash
mcp-shield scan
```
### HTML trust dashboard
```bash
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
```bash
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
```bash
mcp-shield scan --path ~/.cursor/mcp.json
```
### Get remediation steps
```bash
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+
```bash
# 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`](https://github.com/Textualize/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](CONTRIBUTING.md) for detailed guidelines.
---
## ๐ License
MIT ยฉ [AARON AGENT](https://github.com/aaronagent)
---
## โญ Star History
If MCP Shield helped secure your AI agent setup, consider giving it a โญ โ it helps others discover the project.
---
## ไธญๆ่ฏดๆ
### ๐ก๏ธ 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 ้ๆ๏ผ
- **ไฟฎๅคๆๅผ** โ ้ๆญฅๆๅฏผไฟฎๅคๆฏไธ้กนๅฎๅ
จๅ็ฐ
### ๅฟซ้ๅผๅง
```bash
pip install mcp-shield
# ๆซๆๆๆๅทฒๅ็ฐ็ MCP ๆๅกๅจ
mcp-shield scan
# ็ๆ HTML ๆฅๅ
mcp-shield scan --format html -o report.html
# ๆฅ็ไฟฎๅคๅปบ่ฎฎ
mcp-shield fix
```
### ๅไธ่ดก็ฎ
ๆฌข่ฟๆไบค Issue ๅ Pull Request๏ผ่ฏฆ่ง [CONTRIBUTING.md](CONTRIBUTING.md)ใ
---
Built with ๐ by AARON AGENT
Securing the AI agent ecosystem, one MCP server at a time.