Skip to main content
Glama

npm version npm downloads License: MIT IETF Draft MCP Registry PyPI: protect-mcp-adk

protect-mcp

MCP 서버 및 Claude Code 훅을 위한 엔터프라이즈 보안 게이트웨이입니다. 서명된 영수증, Cedar 정책, 스웜 인식 감사 추적 기능을 제공합니다.

Microsoft Agent Governance Toolkit에 통합됨 | IETF 인터넷 초안 | 라이브 데모: acta.today/wiki

빠른 시작 — Claude Code

두 개의 명령어만 사용하면 됩니다. 모든 도구 호출은 영수증이 발급됩니다.

# 1. Generate hooks, keys, Cedar policy, and /verify-receipt skill
npx protect-mcp init-hooks

# 2. Start the hook server
npx protect-mcp serve

동일한 프로젝트에서 Claude Code를 엽니다. 이제 모든 도구 호출이 가로채기, 평가 및 서명됩니다.

init-hooks가 생성하는 것

파일

목적

.claude/settings.json

훅 설정 (PreToolUse, PostToolUse 및 9개의 수명 주기 이벤트)

keys/gateway.json

Ed25519 서명 키 쌍 (자동으로 gitignore 처리됨)

policies/agent.cedar

시작용 Cedar 정책 — 필요에 따라 사용자 정의

protect-mcp.json

서명 + 속도 제한이 포함된 JSON 정책

.claude/skills/verify-receipt/SKILL.md

Claude Code용 /verify-receipt 스킬

아키텍처

Claude Code  →  POST /hook  →  protect-mcp (Cedar + sign)  →  response
                                    ↓
                            .protect-mcp-log.jsonl
                            .protect-mcp-receipts.jsonl
  • PreToolUse: 동기식 Cedar 정책 검사 → 거부 시 도구 차단

  • PostToolUse: 비동기식 영수증 서명 → 지연 시간 영향 없음

  • 거부(deny)는 아키텍처적으로 최종적입니다 — 모델이나 다른 훅에 의해 재정의될 수 없습니다.

엔드포인트

메서드

경로

설명

POST

/hook

Claude Code 훅 엔드포인트

GET

/health

서버 상태, 정책 정보, 서명자 정보

GET

/receipts

최근 서명된 영수증

GET

/receipts/latest

가장 최근 영수증

GET

/suggestions

자동 생성된 Cedar 정책 수정 제안

GET

/alerts

설정 변조 감지 알림

영수증 검증

# Inside Claude Code:
/verify-receipt

# From terminal:
curl http://127.0.0.1:9377/receipts/latest | jq .
npx protect-mcp receipts

# Check policy suggestions:
curl http://127.0.0.1:9377/suggestions | jq .

Related MCP server: verify-mcp

빠른 시작 — MCP 서버 래퍼

모든 stdio MCP 서버를 투명한 프록시로 래핑합니다:

# Shadow mode — log every tool call, enforce nothing
npx protect-mcp -- node my-server.js

# Enforce mode with policy
npx protect-mcp --policy protect-mcp.json --enforce -- node my-server.js

# Generate keys + config template
npx protect-mcp init

작동 원리

protect-mcp는 모든 도구 호출을 정책(JSON, Cedar 또는 외부 PDP)에 따라 평가하고, 결정을 Ed25519 영수증으로 서명하며, 결과를 기록합니다.

두 가지 통합 모드:

모드

전송

사용 사례

훅 서버

HTTP (npx protect-mcp serve)

Claude Code, 에이전트 스웜

Stdio 프록시

stdin/stdout (npx protect-mcp -- ...)

Claude Desktop, Cursor, 모든 MCP 클라이언트

세 가지 정책 엔진:

엔진

설정

참고

JSON

--policy policy.json

간단한 도구별 규칙

Cedar

--cedar ./policies/

@cedar-policy/cedar-wasm을 통한 로컬 WASM 평가

외부 PDP

policy_engine: "external"

OPA, Cerbos 또는 모든 HTTP PDP

스웜 추적

다중 에이전트 세션에서 protect-mcp는 자동으로 스웜 토폴로지를 추적합니다.

처리되는 11가지 훅 이벤트:

이벤트

유형

설명

PreToolUse

동기식

도구 실행 전 Cedar/정책 평가

PostToolUse

비동기식

도구 실행 후 영수증 서명

SubagentStart / SubagentStop

수명 주기

워커 에이전트 생성/완료

TaskCreated / TaskCompleted

수명 주기

코디네이터 작업 할당

SessionStart / SessionEnd

수명 주기

샌드박스 감지가 포함된 세션 수명 주기

TeammateIdle

수명 주기

에이전트 활용도 모니터링

ConfigChange

보안

.claude/settings.json에 대한 변조 감지

Stop

수명 주기

종료 + 정책 제안 요약

각 영수증에는 다음이 포함됩니다:

  • swarm.agent_id, swarm.agent_type, swarm.team_name

  • timing.tool_duration_ms, timing.hook_latency_ms

  • payload_digest (1KB 초과 페이로드에 대한 SHA-256 해시)

  • deny_iteration (거부 후 재시도 횟수)

  • sandbox_state (활성화/비활성화/사용 불가)

  • OpenTelemetry otel_trace_idotel_span_id

정책 파일

{
  "default_tier": "unknown",
  "tools": {
    "dangerous_tool": { "block": true },
    "admin_tool": { "min_tier": "signed-known", "rate_limit": "5/hour" },
    "read_tool": { "require": "any", "rate_limit": "100/hour" },
    "*": { "rate_limit": "500/hour" }
  },
  "signing": {
    "key_path": "./keys/gateway.json",
    "issuer": "protect-mcp",
    "enabled": true
  }
}

Cedar 정책

Cedar 거부 결정은 권위적이며 재정의할 수 없습니다.

// Allow read-only tools
permit(
  principal,
  action == Action::"MCP::Tool::call",
  resource == Tool::"Read"
);

// Block destructive tools
forbid(
  principal,
  action == Action::"MCP::Tool::call",
  resource == Tool::"delete_file"
);

도구가 거부되면 protect-mcp는 GET /suggestions를 통해 최소한의 Cedar permit() 규칙을 자동 제안합니다.

CVE 기반 정책 팩

각 정책은 실제 공격을 방지합니다:

정책

사고

OWASP

clinejection.json

CVE-2025-6514: MCP OAuth 프록시 하이재킹 (437K 환경)

A01, A03

terraform-destroy.json

자율 Terraform 에이전트가 프로덕션 환경 파괴

A05, A06

github-mcp-hijack.json

조작된 GitHub 이슈를 통한 프롬프트 인젝션

A01, A02, A03

data-exfiltration.json

아웃바운드 도구 남용을 통한 에이전트 데이터 탈취

A02, A04

financial-safe.json

승인되지 않은 금융 거래

A05, A06

Cedar 대응 정책은 policies/cedar/에서 확인할 수 있습니다.

MCP 클라이언트 설정

Claude Desktop

{
  "mcpServers": {
    "my-protected-server": {
      "command": "npx",
      "args": [
        "-y", "protect-mcp",
        "--policy", "/path/to/protect-mcp.json",
        "--enforce",
        "--", "node", "my-server.js"
      ]
    }
  }
}

Cursor / VS Code

동일한 패턴입니다. 서버 명령어를 protect-mcp로 래핑하여 교체하십시오.

CLI 명령어

Commands:
  serve             Start HTTP hook server for Claude Code (port 9377)
  init-hooks        Generate Claude Code hook config + skill + sample Cedar policy
  quickstart        Zero-config onboarding: init + demo + show receipts
  init              Generate Ed25519 keypair + config template
  demo              Start a demo server wrapped with protect-mcp
  doctor            Check your setup: keys, policies, verifier, connectivity
  trace <id>        Visualize the receipt DAG from a given receipt_id
  status            Show tool call statistics from the decision log
  digest            Generate a human-readable summary of agent activity
  receipts          Show recent persisted signed receipts
  bundle            Export an offline-verifiable audit bundle
  simulate          Dry-run a policy against recorded tool calls
  report            Generate a compliance report from an audit bundle

Options:
  --policy <path>   Policy/config JSON file
  --cedar <dir>     Cedar policy directory
  --enforce         Enable enforcement mode (default: shadow)
  --port <port>     HTTP server port (default: 9377 for serve)
  --verbose         Enable debug logging

결정 로그

모든 도구 호출은 구조화된 JSON을 stderr로 출력합니다:

[PROTECT_MCP] {"v":2,"tool":"read_file","decision":"allow","reason_code":"cedar_allow","policy_digest":"a1b2c3...","mode":"enforce","hook_event":"PreToolUse","timing":{"hook_latency_ms":1},"otel_trace_id":"..."}

서명이 설정되면 서명된 영수증이 .protect-mcp-receipts.jsonl에 저장됩니다.

감사 번들

npx protect-mcp bundle --output audit.json

영수증 + 서명 키가 포함된 오프라인 검증 가능 번들입니다. npx @veritasacta/verify로 검증하십시오.

검증된 지식 베이스 (acta.today/wiki)

protect-mcp의 영수증 서명 기능은 acta.today/wiki에서 세계 최초의 검증된 다중 모델 지식 베이스를 구동합니다.

모든 지식 단위(Knowledge Unit)는 4개의 최첨단 모델이 3번의 적대적 라운드를 거쳐 도출하며, 모든 모델 응답에 Ed25519 영수증이 포함됩니다. 현재 라인업:

모델

제공자

원산지

Claude Opus 4.6

Anthropic

미국

GPT-5.4

OpenAI

미국

Grok 4.20

xAI

미국

Gemini 3.1 Pro

Google

미국

DeepSeek V3.2

DeepSeek

중국

MiniMax M2.7

MiniMax

중국

Kimi K2.5

Moonshot

중국

Qwen 2.5 72B

Alibaba

중국

모든 KU는 독립적으로 검증 가능합니다: npx @veritasacta/verify receipt.json

생태계 통합

프로젝트

별점

통합

상태

Microsoft Agent Governance Toolkit

600+

Cedar 정책 브리지 + 영수증 서명

병합됨 (PR #667)

Mission Control

3,700+

MCP 감사 파이프라인을 위한 Ed25519 영수증 서명

PR #556 제출됨

Assay

증거 소스로서의 서명된 영수증

활발한 논의 중 (#1029)

Hermes Agent

24,500+

스킬 실행을 위한 암호화 감사 추적

이슈 #5041

DeerFlow

57,600+

지속성 계층을 위한 암호화 무결성

논의 #1855

Pro-Workflow

1,500+

MCP 설정 권장 사항

PR #41

Zeroshot

1,400+

검증자 판결을 위한 암호화 영수증

이슈 #464

표준 및 IP

  • IETF 인터넷 초안:

  • 특허 상태: 결정 영수증(구성 가능한 공개, 도구 호출 게이트웨이, 에이전트 매니페스트, 휴대용 ID 포함)과 관련된 4개의 호주 가특허 출원 중 (2025-2026)

  • 검증: Apache-2.0 — npx @veritasacta/verify --self-test

  • Microsoft AGT 통합: PR #667 — 에이전트 거버넌스 툴킷을 위한 Cedar 정책 브리지

관련 저장소

저장소

설명

VeritasActa/Acta

다툴 수 있는 공공 기록을 위한 오픈 프로토콜 (Apache-2.0)

VeritasActa/drafts

IETF 인터넷 초안 소스 파일

ScopeBlind/examples

통합 예제: Claude Code 훅, Express API, MCP 서버 서명

@veritasacta/verify

오프라인 영수증 검증기 (Apache-2.0)

@scopeblind/passport

에이전트 ID SDK (Apache-2.0)

protect-mcp-adk

Google ADK 영수증 서명 플러그인 (MIT, Python)

기여

이슈와 풀 리퀘스트를 환영합니다. 중요한 변경 사항은 먼저 이슈를 열어주십시오.

  • 버그 리포트: protect-mcp 버전, Node.js 버전 및 재현 단계를 포함하십시오.

  • Cedar 정책: policies/cedar/ 디렉토리에 PR을 통해 재사용 가능한 정책을 공유하십시오.

  • 통합 예제: ScopeBlind/examples에 추가하십시오.

라이선스

MIT — 제한 없이 자유롭게 사용, 수정, 배포 및 구축할 수 있습니다.

scopeblind.com · npm · veritasacta.com · IETF 초안

-
security - not tested
A
license - permissive license
-
quality - not tested

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/ScopeBlind/scopeblind-gateway'

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