Skip to content

Guide · Agent skill

How to use the protect-mcp Setup agent skill for Claude Code

Updated · written with AI from the project's own documentation and checked against our catalogue data

The protect-mcp-setup skill is an agent skill for Claude Code that helps you configure policy enforcement and signed records for the tools Claude Code uses. Once set up, each tool call is checked against a Cedar policy file you write, and each completed call produces an Ed25519-signed receipt. This guide explains what the skill does, how to install it, how to ask for it in plain language, and what to watch for before you rely on it.

protect-mcp Setupwshobson/agents · MIT

Quick start

  1. 1Install the plugin. Run the plugin install command so the hooks and skill are added to your project. Confirm that the PreToolUse and PostToolUse hooks are present.
  2. 2Create the Cedar policy. Create protect.cedar at the project root and adjust the file paths to your own project before using it.
  3. 3Create the signing key. Generate ./protect-mcp.key only if it does not already exist, then add it to .gitignore.
  4. 4Use Claude Code normally. Each tool call is now evaluated against the policy, and each completed call adds a signed receipt to ./receipts/receipts.jsonl.
  5. 5Verify the receipts. Run the offline verifier with the public key from your key file and check the exit code.

What is an agent skill, and what does this one do?

An agent skill is a folder of instructions that Claude can load when a task matches the skill's description. This skill, protect-mcp-setup, is for projects that need a record of what the agent did and a way to stop certain actions before they run.

By default, Claude Code runs tools such as Bash, Edit, Write and WebFetch with no audit trail and no policy check. The protect-mcp setup closes those gaps in three ways: a Cedar policy is evaluated before each tool call, a signed receipt is written after each call, and a third party can verify the receipts offline without access to your system.

  • Cedar policies (AWS's open authorization language) can allow or deny a tool call before it executes. A Cedar deny is authoritative.
  • Ed25519 receipts record the name of each tool that ran, signed with your key.
  • Verification runs locally with npx @veritasacta/verify and needs no server or account.

Install the skill from a ZIP or the Claude apps

You can add the skill to Claude Code by copying its folder into a skills directory. Download the ZIP from the agents directory page and unzip it into ~/.claude/skills/ to make it available to you in every project, or into .claude/skills/ inside a single project to limit it to that project.

If you use the Claude apps instead, open Settings, go to Capabilities, then Skills, and upload the ZIP there.

  • Personal install: unzip into ~/.claude/skills/
  • Project install: unzip into .claude/skills/ in the project root
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Set up the policy enforcement and hooks

The skill describes the full setup, and the enforcement itself comes from the plugin. Installing the plugin adds two hooks: PreToolUse, which evaluates each call against your policy before it runs, and PostToolUse, which signs a receipt after it finishes. The plugin's hook scripts are the parts that actually check and sign calls.

Then create a Cedar policy file named protect.cedar at the project root. The source includes a sample policy that allows read-only tools, allows a list of safe Bash commands, forbids chaining, redirection and rm -rf, and limits Write and Edit to paths inside the project. Adapt the paths to your own project before you rely on it.

Create a signing key once. The skill's guidance is to generate it only if ./protect-mcp.key does not already exist, because an existing key is never replaced. Add the key to .gitignore so it is not committed.

  • Create ./protect.cedar at the project root and edit the paths in it.
  • Keep ./protect-mcp.key private and listed in .gitignore.
  • Receipts are written to ./receipts/receipts.jsonl by default.
  • If the policy file is missing, the PreToolUse hook prints a warning and allows the call.
claude plugin install wshobson/agents/protect-mcp

Ask for the skill with natural requests

You do not need a special command to trigger the skill. Claude loads it when your request matches its description, which concerns setting up projects that need cryptographic audit trails, policy-gated tool execution, or compliance-ready evidence of agent actions.

Requests that describe one of those goals are the most likely to trigger it. Be specific about what you want restricted or recorded so the setup matches your project.

  • Set up protect-mcp in this project so every tool call gets a signed receipt.
  • Write a Cedar policy that only lets Claude Code run git status, git diff and git log.
  • Help me restrict file writes to this repository and block any path with .. in it.
  • Add an audit trail of agent actions for this project that I can verify later.

Verify the receipts later

Verification checks every receipt against the public key in your key file, so you do not need to trust the person who ran the agent. Exit code 0 means every receipt verified, 1 means a receipt failed because it was tampered with, the wrong key was used, or a line was malformed, and 2 means the file could not be read.

Inside Claude Code, the plugin's slash commands do the same job. /verify-receipt checks a single receipt in its own file, and /audit-chain --last 20 reviews recent entries.

  • Exit 0: every receipt verified
  • Exit 1: a receipt failed (tampered, wrong key, or malformed line)
  • Exit 2: the file could not be read
PUB=$(node -p 'JSON.parse(require("fs").readFileSync("./protect-mcp.key")).publicKey') && npx @veritasacta/verify@0.9.2 --replay-chain ./receipts/receipts.jsonl --key "$PUB"

Know the limits before relying on it

A receipt records only the tool name. It does not record the tool's input or output, so it can show that a command ran but not what it did. Receipts also have no link to the previous receipt, which means a deleted line would go undetected.

Policy matching is best-effort. The Cedar like checks compare the raw command string, not a resolved path, and an allowed npm command runs arbitrary code. The skill is not a complete security boundary.

  • Receipts show the tool name only, not input or output.
  • A deleted receipt line is not detected by the chain itself.
  • String matching can be bypassed; treat policies as a guardrail, not a sandbox.
  • Setup needs Node.js and npm, and the first run fetches packages from the internet.

What people use it for

  • Restricting which shell commands Claude Code may run, such as allowing git status and git log but blocking file redirection.
  • Limiting Write and Edit to paths inside a single repository.
  • Keeping a signed record of tool use in a regulated project so a reviewer can check it later.
  • Auditing the last set of agent actions with /audit-chain.

Frequently asked questions

Is the protect-mcp-setup skill free to use?

The skill is published under the MIT licence. The source does not list any price, so check the repository for the current terms of any related packages you use.

What do I need to install protect-mcp-setup?

You need Claude Code with plugin support, Node.js and npm, a shell environment with bash and standard Unix tools, and internet access for the first run to fetch npm packages. The hook scripts also run on your machine.

Does the skill block risky commands?

It can, if your Cedar policy denies them. A deny from Cedar blocks the tool call before it runs. However, string matching is best-effort, so the policy is not a complete security boundary.

Can the receipts show exactly what a command did?

No. Receipts record only the tool name, not its input or output. If you need full detail of what a command did, this setup does not provide it.

What if I lose or change my signing key?

The skill says an existing key is never replaced when you run the setup step. Rotation is covered in the receipt format reference, so read that before changing keys.

How is this different from the normal Claude Code session log?

The session log is mutable and unsigned, so anyone with access can edit it. Signed receipts let a third party verify records offline without trusting whoever holds the log.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you work on a project that needs tamper-evident records of agent tool use and you are comfortable writing and maintaining Cedar policy files and a local signing key. If you only want Claude Code's help with everyday coding, or you need full records of command input and output, pick a simpler setup or a different tool.

Download the skill