Skip to content

protect-mcp Setup

Add Cedar policy checks and signed audit receipts to Claude Code tool calls

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
2 files

What it does

Once installed, Claude Code checks every tool call (such as running a shell command, editing a file or fetching a web page) against a Cedar policy file you write, and blocks calls the policy denies. After each tool runs, it records a cryptographically signed receipt naming the tool, so you can later prove with an offline verifier which actions happened and that the log was not altered. It is aimed at projects that need an audit trail of agent actions.

Great for

  • Developers in regulated settings (finance, healthcare, research) who need tamper-evident records of agent tool use
  • Teams that want to restrict which shell commands or file paths Claude Code may touch
  • Anyone comfortable editing policy files and managing a local signing key

Skip it if

  • Casual users who just want Claude Code to help with coding: setup adds hooks, a policy file and a key, and a wrong policy can block legitimate work
  • Situations needing full audit detail: receipts record only the tool name, not its input or output, so they cannot show what a command actually did
  • Use as a complete security boundary: the README's own notes say string matching is best-effort and an allowed npm command runs arbitrary code

Try asking

  • “Set up protect-mcp in this project so every Bash, Edit and Write call is policy-checked and receipted”
  • “Write a Cedar policy that allows read-only tools and git read commands but blocks chaining and redirection”
  • “Verify the receipts in ./receipts/receipts.jsonl and report whether the chain is intact”
  • “Explain what the signed receipt format records and how to rotate the signing key”
Step-by-step guide: how to use protect-mcp SetupInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 2 original files, the MIT licence and an attribution note.

    protect-mcp-setup.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip protect-mcp-setup.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip protect-mcp-setup.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Review ./protect.cedar carefully before use: the sample uses a placeholder path (/path/to/project/*) that must be replaced, and the npm permit runs arbitrary project scripts
  • Add the generated protect-mcp.key to .gitignore as the instructions do and never commit or share it, since anyone with it can forge receipts
  • Pin package versions as given and check the hook scripts in hooks/ before installing the plugin, since they execute on every tool call

What's inside

  • references/receipt-format.md
  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.