jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Protect MCP Governance

protect-mcp-governance

MCPツール連携時のガバナンスを強化し、ポリシー作成から適用、検証までを安全に管理するSkill。

⏱ ライブラリ調査+組込 半日 → 1時間

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Agent governance skill for MCP tool calls — Cedar policy authoring, shadow-to-enforce rollout, and Ed25519 receipt verification.

🇯🇵 日本人クリエイター向け解説

一言でいうと

MCPツール連携時のガバナンスを強化し、ポリシー作成から適用、検証までを安全に管理するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o protect-mcp-governance.zip https://jpskill.com/download/3335.zip && unzip -o protect-mcp-governance.zip && rm protect-mcp-governance.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3335.zip -OutFile "$d\protect-mcp-governance.zip"; Expand-Archive "$d\protect-mcp-governance.zip" -DestinationPath $d -Force; ri "$d\protect-mcp-governance.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して protect-mcp-governance.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → protect-mcp-governance フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Protect MCP Governance を使って、最小構成のサンプルコードを示して
  • Protect MCP Governance の主な使い方と注意点を教えて
  • Protect MCP Governance を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] protect-mcp-governance

protect-mcp を使用した MCP エージェント ガバナンス

概要

Cedar ポリシーと Ed25519 署名付きレシートを使用して、AI エージェントのツール呼び出しを管理するためのガイダンスです。このスキルでは、MCP サーバーのアクセス制御ポリシーの作成方法、監視のためにシャドウモードで実行する方法、および暗号監査証跡の検証方法を説明します。

このスキルを使用する状況

  • エージェントが呼び出すことができる MCP ツールと、その条件を制御する必要がある場合に使用します。
  • エージェントのツール実行に対する改ざん防止監査証跡が必要な場合に使用します。
  • ガバナンスポリシーを段階的に展開する場合(まずシャドウモード、次に強制)に使用します。
  • MCP ツールアクセス制御用の Cedar ポリシーを作成する場合に使用します。
  • レシートまたは監査バンドルが改ざんされていないことを確認する場合に使用します。

このスキルを使用しない状況

  • 一般的なアプリケーションセキュリティ監査が必要な場合(@security-auditor を使用してください)。
  • 脆弱性のためにコードをスキャンする必要がある場合(@security-audit を使用してください)。
  • エージェント固有のガバナンスなしでコンプライアンスフレームワークのガイダンスが必要な場合。

仕組み

protect-mcp は MCP ツール呼び出しをインターセプトし、Cedar ポリシー(AWS Verified Permissions で使用されているのと同じポリシーエンジン)に対して評価し、すべての決定を Ed25519 レシートとして署名します。レシートは、特定のポリシーが特定のツール呼び出しに対して特定の時間に評価されたことを示す暗号証明です。

Agent → protect-mcp → Cedar policy evaluation → MCP Server
                ↓
        Ed25519 signed receipt

3つの動作モードがあります。

  1. シャドウモード(デフォルト)— ブロックせずに決定をログに記録します。ポリシーを強制する前に、ポリシーが何をするかを観察するために使用します。
  2. 強制モード — ポリシーに違反するツール呼び出しをブロックします。シャドウモードでの検証後に使用します。
  3. フックモード — Claude Code フックと統合し、ツール呼び出し前後のガバナンスを実現します。

コアコンセプト

Cedar ポリシー

Cedar は、認可のために設計されたポリシー言語です。ポリシーは WASM を介してローカルで評価されます。ネットワーク呼び出しは不要です。

// Allow read-only file operations
permit(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name in ["read_file", "list_directory", "search_files"]
};

// Deny destructive operations
forbid(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name in ["execute_command", "delete_file", "write_file"]
  && resource has args
  && resource.args.contains("rm -rf")
};

署名付きレシート

すべてのポリシー決定は署名付きレシートを生成します。

{
  "payload": {
    "type": "protectmcp:decision",
    "tool_name": "read_file",
    "decision": "allow",
    "policy_digest": "sha256:9d0fd4c9e72c1d5d",
    "issued_at": "2026-04-05T14:32:04.102Z",
    "issuer_id": "sb:issuer:de073ae64e43"
  },
  "signature": {
    "alg": "EdDSA",
    "kid": "sb:issuer:de073ae64e43",
    "sig": "2a3b5022..."
  }
}

レシート形式は IETF Internet-Draft draft-farley-acta-signed-receipts に準拠しています。

ステップバイステップガイド

1. プロジェクトのガバナンスを初期化する

# Install and initialize hooks (Claude Code integration)
npx protect-mcp init-hooks

# Or run as a standalone MCP gateway
npx protect-mcp serve

これにより、プロジェクトのルートに protect-mcp.config.json とスターター Cedar ポリシーが作成されます。

2. 最初のポリシーを作成する

プロジェクトに policy.cedar を作成します。

// Start permissive — allow everything in shadow mode
permit(
  principal,
  action == Action::"call_tool",
  resource
);

3. シャドウモードで実行する(まず観察する)

# Shadow mode is the default — logs decisions without blocking
npx protect-mcp --policy policy.cedar -- node your-mcp-server.js

制限的なポリシーを作成する前に、シャドウログを確認してエージェントが何をしているかを理解してください。

4. 厳格化して強制する

ツール呼び出しのパターンを理解したら、特定のポリシーを作成します。

// Allow file reads, deny writes outside src/
permit(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name == "read_file"
};

permit(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name == "write_file"
  && resource has args
  && resource.args.path like "src/*"
};

// Deny everything else
forbid(
  principal,
  action == Action::"call_tool",
  resource
);

強制モードに切り替えます。

npx protect-mcp --policy policy.cedar --enforce -- node your-mcp-server.js

5. レシートを検証する

# Verify a single receipt
npx @veritasacta/verify receipt.json --key <public-key-hex>

# Verify an audit bundle (multiple receipts + keys)
npx @veritasacta/verify bundle.json --bundle

# Self-test the verifier (proves it works offline)
npx @veritasacta/verify --self-test

終了コード: 0 = 署名が有効(真正性が証明された)、1 = 署名が無効(改ざんが証明された)、2 = 検証エラー(入力が不正)。

例 1: Claude Code セッションのガバナンス

# Initialize hooks
npx protect-mcp init-hooks

# Claude Code now generates a signed receipt for every tool call.
# Receipts are stored in .protect-mcp/receipts/

説明: 初期化後、Claude Code が行うすべてのツール呼び出しは、署名付きレシートとともにログに記録されます。ツール呼び出しはブロックされません(シャドウモード)。

例 2: 本番 MCP サーバーを制限する

// Only allow approved tools with rate limiting
permit(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name in [
    "get_customer",
    "search_orders",
    "list_products"
  ]
};

forbid(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name in [
    "delete_customer",
    "modify_payment",
    "execute_sql"
  ]
};

説明: 顧客データを処理する本番 MCP サーバーです。読み取り専用操作は許可され、破壊的な操作はブロックされます。

例 3: インシデント後の監査バンドルを検証する

# Export the session's audit bundle
npx protect-mcp export-bundle --session sess
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

MCP Agent Governance with protect-mcp

Overview

Guidance for governing AI agent tool calls using Cedar policies and Ed25519 signed receipts. This skill teaches how to write access-control policies for MCP servers, run them in shadow mode for observation, and verify the cryptographic audit trail.

When to Use This Skill

  • Use when you need to control which MCP tools an agent can call and under what conditions
  • Use when you want a tamper-evident audit trail for agent tool executions
  • Use when rolling out governance policies gradually (shadow mode first, then enforce)
  • Use when authoring Cedar policies for MCP tool access control
  • Use when verifying that a receipt or audit bundle has not been tampered with

Do Not Use This Skill

  • When you need general application security auditing (use @security-auditor)
  • When you need to scan code for vulnerabilities (use @security-audit)
  • When you need compliance framework guidance without agent-specific governance

How It Works

protect-mcp intercepts MCP tool calls, evaluates them against Cedar policies (the same policy engine used by AWS Verified Permissions), and signs every decision as an Ed25519 receipt. The receipt is a cryptographic proof that a specific policy was evaluated against a specific tool call at a specific time.

Agent → protect-mcp → Cedar policy evaluation → MCP Server
                ↓
        Ed25519 signed receipt

Three modes of operation:

  1. Shadow mode (default) — logs decisions without blocking. Use this to observe what your policies would do before enforcing them.
  2. Enforce mode — blocks tool calls that violate policy. Use after shadow-mode validation.
  3. Hooks mode — integrates with Claude Code hooks for pre/post tool-call governance.

Core Concepts

Cedar Policies

Cedar is a policy language designed for authorization. Policies are evaluated locally via WASM — no network calls required.

// Allow read-only file operations
permit(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name in ["read_file", "list_directory", "search_files"]
};

// Deny destructive operations
forbid(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name in ["execute_command", "delete_file", "write_file"]
  && resource has args
  && resource.args.contains("rm -rf")
};

Signed Receipts

Every policy decision produces a signed receipt:

{
  "payload": {
    "type": "protectmcp:decision",
    "tool_name": "read_file",
    "decision": "allow",
    "policy_digest": "sha256:9d0fd4c9e72c1d5d",
    "issued_at": "2026-04-05T14:32:04.102Z",
    "issuer_id": "sb:issuer:de073ae64e43"
  },
  "signature": {
    "alg": "EdDSA",
    "kid": "sb:issuer:de073ae64e43",
    "sig": "2a3b5022..."
  }
}

The receipt format follows IETF Internet-Draft draft-farley-acta-signed-receipts.

Step-by-Step Guide

1. Initialize Governance for a Project

# Install and initialize hooks (Claude Code integration)
npx protect-mcp init-hooks

# Or run as a standalone MCP gateway
npx protect-mcp serve

This creates a protect-mcp.config.json and a starter Cedar policy in your project root.

2. Write Your First Policy

Create policy.cedar in your project:

// Start permissive — allow everything in shadow mode
permit(
  principal,
  action == Action::"call_tool",
  resource
);

3. Run in Shadow Mode (Observe First)

# Shadow mode is the default — logs decisions without blocking
npx protect-mcp --policy policy.cedar -- node your-mcp-server.js

Review the shadow log to understand what your agent is doing before writing restrictive policies.

4. Tighten and Enforce

Once you understand the tool-call patterns, write specific policies:

// Allow file reads, deny writes outside src/
permit(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name == "read_file"
};

permit(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name == "write_file"
  && resource has args
  && resource.args.path like "src/*"
};

// Deny everything else
forbid(
  principal,
  action == Action::"call_tool",
  resource
);

Switch to enforce mode:

npx protect-mcp --policy policy.cedar --enforce -- node your-mcp-server.js

5. Verify Receipts

# Verify a single receipt
npx @veritasacta/verify receipt.json --key <public-key-hex>

# Verify an audit bundle (multiple receipts + keys)
npx @veritasacta/verify bundle.json --bundle

# Self-test the verifier (proves it works offline)
npx @veritasacta/verify --self-test

Exit codes: 0 = signature valid (proven authentic), 1 = signature invalid (proven tampered), 2 = verifier error (malformed input).

Examples

Example 1: Governance for a Claude Code Session

# Initialize hooks
npx protect-mcp init-hooks

# Claude Code now generates a signed receipt for every tool call.
# Receipts are stored in .protect-mcp/receipts/

Explanation: After initialization, every tool call Claude Code makes is logged with a signed receipt. No tool calls are blocked (shadow mode).

Example 2: Restrict a Production MCP Server

// Only allow approved tools with rate limiting
permit(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name in [
    "get_customer",
    "search_orders",
    "list_products"
  ]
};

forbid(
  principal,
  action == Action::"call_tool",
  resource
) when {
  resource.tool_name in [
    "delete_customer",
    "modify_payment",
    "execute_sql"
  ]
};

Explanation: A production MCP server that serves customer data. Read-only operations are permitted; destructive operations are blocked.

Example 3: Verify an Audit Bundle After an Incident

# Export the session's audit bundle
npx protect-mcp export-bundle --session sess_abc123 --out audit.json

# Verify every receipt in the bundle
npx @veritasacta/verify audit.json --bundle

# Expected output:
# ✓ Bundle: VALID
#   Total:    47
#   Passed:   47
#   Failed:   0

Explanation: After an incident, export the audit bundle and verify that no receipts have been tampered with. The bundle contains all receipts from the session plus the signing keys needed for verification.

Best Practices

  • Do: Start in shadow mode and observe before enforcing
  • Do: Use policy_digest to track which policy version produced each decision
  • Do: Store receipts alongside your application logs for correlation
  • Do: Pin the verifier version when integrating into CI (@veritasacta/verify@0.2.5)
  • Don't: Skip shadow mode and go straight to enforce in production
  • Don't: Trust claimed_issuer_tier without independent verification
  • Don't: Treat a valid signature as proof the signer is trustworthy — it only proves the receipt has not been tampered with since signing

Troubleshooting

Problem: Receipts fail verification with no_public_key

Symptoms: npx @veritasacta/verify receipt.json returns exit 2 with no_public_key Solution: Provide the public key explicitly: --key <64 hex chars>. The receipt does not embed the public key by default. Check protect-mcp.config.json for the issuer's public key.

Problem: Shadow mode shows unexpected denials

Symptoms: Shadow log shows deny decisions for tools you expected to be allowed Solution: Check your Cedar policy ordering. Cedar evaluates forbid rules before permit rules — a broad forbid will override specific permit rules.

Problem: Enforce mode blocks a legitimate tool call

Symptoms: Agent reports a tool call was denied after switching to enforce mode Solution: Add the tool to your permit policy or switch back to shadow mode: remove --enforce flag. Review the receipt's deny_reason field for the specific policy violation.

Related Skills

  • @security-auditor — General security auditing and compliance
  • @security-audit — Code vulnerability scanning
  • @mcp-development — MCP server development patterns

Additional Resources

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.