Enterprise MCP Security Scanner + AI Security Copilot
MCP Shield helps teams detect prompt injection, tool poisoning, secret leakage, dangerous permissions, scope creep, and tool shadowing in Model Context Protocol (MCP) tool/server JSON — before AI agents trust those tools.
Upload a config → get a deterministic risk score, OWASP-mapped findings, attack-path simulation, deployment recommendation, and an AI copilot that explains the results.
Advisory only — your config is never modified.
MCP lets AI agents call external tools. Tool descriptions and permissions are trusted inputs. Attackers can hide instructions in descriptions, request over-broad permissions, or embed secrets — turning a helpful integration into a credential-leak or command-injection path.
Most teams still install MCP tools the same way they install npm packages: fast, and with little security review.
| Without review | With MCP Shield |
|---|---|
| Developer downloads MCP | Developer uploads MCP |
| Agent executes untrusted description | AI + rule scan runs |
| Prompt injection / secret exfil | Threats flagged with evidence |
| Business impact | Risk report + trust decision |
MCP Shield is a production-style security workflow for MCP configs:
- Scan — deterministic detectors + scoring engine
- Enrich — explanations / suggested fixes (templated or LLM-assisted)
- Decide — AI trust decision + deployment recommendation
- Explain — AI Security Copilot chat grounded in the scan result
- Harden (advisory) — suggested safer description + real re-scan of a clone
flowchart LR
A[MCP JSON Upload / Sample] --> B[POST /api/scan]
B --> C[String Extraction]
C --> D[Detectors]
D --> E[Scoring + Combos]
E --> F[Attack Simulation]
F --> G[Trust Decision]
G --> H[Enrichment]
H --> I[Copilot Insights]
I --> J[Results Dashboard]
J --> K[POST /api/copilot/chat]
J --> L[POST /api/copilot/harden]
- Deterministic core — findings, scores, combinations, attack simulation, trust decision always come from the scanner.
- Optional LLM — when
LLM_PROVIDERisfeatherless(orgroq) with the matching API key, enrichment / insights / harden / chat use a real model. On any failure, engines fall back to templated logic. - Hackathon default path — Featherless.ai via OpenAI-compatible
https://api.featherless.ai/v1(docs). - Offline demo —
LLM_PROVIDER=mockruns with zero API keys.
- Parse & validate MCP config
- Extract strings / fields
- Run detectors (injection, secrets, permissions, scope, command, shadowing)
- Score + grade + combination risks
- Simulate attack path
- Produce trust decision & recommendations
- Generate copilot insights / executive review
- Present dashboard (export JSON, chat, advisory harden)
- AI Trust Decision (Trusted / Review Required / Not Trusted)
- Deterministic risk score & security grade
- Prompt injection & tool poisoning detection
- Secret / credential leakage detection
- Permission & combination-risk analysis
- Scope creep & command-injection signals
- Tool shadowing detection
- OWASP MCP category mapping
- Attack-path simulation
- Business impact categories
- Executive summary & deployment recommendation
- AI Security Copilot chat (scan-grounded)
- Advisory hardened rewrite + re-scan
- JSON export; browser print for PDF-like output
- Five Acme DevTools samples with verifyable ground truth
| Layer | Tech |
|---|---|
| App | Next.js 16 (App Router), React 19, TypeScript |
| UI | Tailwind CSS 4, shadcn/ui, Framer Motion, Lucide |
| Validation | Zod |
| Scanner | Custom TypeScript rule engines |
| AI | Featherless.ai or Groq (optional), deterministic fallbacks |
| Samples | samples/acme_devtools/* |
git clone https://github.com/shlokbainee23/MCPshield.git
cd MCPshield
# if the app lives in a subdirectory:
# cd mcp-shield
npm install
cp .env.example .env.local
npm run devnpm run dev # local development
npm run build # production build
npm run start # serve production build
npm run verify:samples # assert sample score/trust ground truth
npm run lint # eslintCopy .env.example → .env.local:
| Variable | Required | Description |
|---|---|---|
LLM_PROVIDER |
No | mock, featherless (hackathon), or groq |
FEATHERLESS_API_KEY |
For featherless |
Key from Featherless API keys |
FEATHERLESS_MODEL |
No | Default meta-llama/Meta-Llama-3.1-8B-Instruct |
GROQ_API_KEY |
For groq |
Groq API key |
GROQ_MODEL |
No | Defaults to llama-3.3-70b-versatile |
Never commit .env.local.
| Method | Path | Purpose |
|---|---|---|
POST |
/api/scan |
Full scan + copilot insights |
POST |
/api/copilot/chat |
Chat grounded in a ScanResult |
POST |
/api/copilot/harden |
Advisory harden + re-scan of a clone |
GET |
/api/samples/[name] |
Load a sample MCP JSON |
All advisory responses include "copilot_mode": "advisory_only".
src/
app/ # App Router pages + API routes
scanner/ # Detectors, scoring, trust, attack simulation
aiCopilot/ # Insights, chat, harden, forecast, LLM client
enrichment/ # Finding explanations / suggested fixes
components/
landing/ # Enterprise landing experience
dashboard/ # Scan results dashboard
aiCopilot/ # Copilot UI
scan/ # Shared ScanPanel
types/contract.ts # Contract v1 — single source of truth
lib/ # Schemas, helpers
samples/acme_devtools/ # Demo MCP configs
scripts/verify-samples.ts
| File | OWASP | Score | Grade | Trust |
|---|---|---|---|---|
| doc_lookup | — | 8–15 | A+ | Trusted |
| code_assistant | MCP03 | 82–92 | F | Not Trusted |
| file_manager | MCP02 | 55–68 | C | Review Required |
| deploy_runner | MCP05 | 70–80 | D | Review Required |
| env_configurator | MCP01 | 75–88 | D–F | Not Trusted |
npm run verify:samples asserts every sample lands in its documented range.
- Problem — landing “Why MCP Security Matters” attack timeline
- Attack example — select
code_assistant(MCP03 poisoning) - Upload / scan — watch the scan progress stages
- AI analysis — trust decision, score, grade
- Threat detection — findings table + evidence spans
- Executive report — summary, business impact, deployment call
- Copilot — ask “What’s the highest risk?”
- Harden (advisory) — generate safer description + compare re-scan
- Conclusion — export JSON; emphasize advisory-only guarantee
Add deployed screenshots here before submission:
- Landing hero
- Attack timeline
- Results dashboard (Not Trusted example)
- AI Copilot chat
- Hardened rewrite panel
- Never modifies the uploaded config — advisory only
- Every finding carries an
evidence_spanfrom the actual config text - API responses include
"copilot_mode": "advisory_only" - No “Apply Fix” that mutates the user’s file
- Finding IDs are per-scan:
{scan_id}_F001, … - Contract v1 snake_case field names
- Dedicated PDF report pipeline (browser print available today)
- CI / GitHub Action for MCP config scanning
- Multi-tool suite comparison view
- Optional MITRE / CVE enrichment providers (architecture-ready; not wired without credentials)
- Team workspaces & audit history
Built for an AI-first hackathon focused on real MCP security risk.
Private / hackathon submission unless otherwise specified by the authors.