
Protect Mcp
io.github.tomjwxfPublished by GitHub account tomjwxfv0.5.3Updated Oct 24, 2026
Signed receipts and Cedar policies for AI agent tool calls. Claude Code hooks, MCP gateway.
Overview
A local policy gate that checks AI agent tool calls against Cedar rules, blocks violations, and signs verifiable receipts of each decision.
- What you can do
- Evaluate tool calls against Cedar policies and deny or allow them, with fail-closed behavior on errors and a boot self-test before enforcing mode starts. Wrap MCP servers or Claude Code hooks so every call passes through the gate, and draft a reviewable policy from observed calls. Sign each decision into an Ed25519 receipt and view, export, or offline-verify receipts and audit bundles locally. Manage credentials in the gateway so the agent sees only a label, injecting the value into a header, query, or environment variable at dispatch. Optionally anchor receipt digests to a hosted service and run coordination tools for shared invoice or repository-review tasks.
- When to use it
- Use it when you run an AI agent with tool access and want a local, fail-closed guardrail that blocks forbidden actions and leaves signed evidence of every decision. Also relevant if you need offline-verifiable audit trails or want to keep API secrets out of the agent's context.
- Requirements
- Runs locally as an npm package via npx (Node.js). Setup generates an Ed25519 keypair and policy files. Optional hosted features need a ScopeBlind account, a SCOPEBLIND_TOKEN environment variable, and network access; the gateway itself reads secrets from environment variables of its own process.
Installation
In SourceWeft
- Open Protect Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
protect-mcp
Local policy enforcement and signed decision receipts for AI agent tool calls.
[npm version] [Monthly npm downloads] [Node.js compatibility] [Package checks] [MIT license]
Developer page · Quickstart · Agent setup · Policy packs · Sample record · Integrations · Documentation · Contribute
Put the gateway between an MCP client and its tool server, or use its hooks in a coding agent. Review a Cedar policy, enable enforcement, and keep a signed record of the decisions. Local evaluation and verification need no ScopeBlind account and send no decision telemetry.
- Enforce at the tool boundary. Cedar denies on missing policies, engine
errors or evaluation errors in fail-closed mode. Shadow mode is the default
for the MCP wrapper: use
--enforcewhen ready to block. - Check what was signed. Ed25519 receipts include the decision and policy digest. @veritasacta/verify checks the bytes against the public key you trust.
- Start with existing tools. Use MCP stdio, the HTTP gateway or coding-agent hooks. Optional hosted collaboration has its own permissions and data flows.
A gateway covers calls routed through it. It is not an OS sandbox, and a signed receipt does not establish that an action executed or that no action was omitted. The security policy describes the boundary and reporting process.
See the result
A real local run: evaluate two proposed calls, sign the decisions, verify the receipts, then change a signed decision and check it again.
Watch the 14-second walkthrough
[Animated result summary of the same five steps, based on captured CLI output.]
Text walkthrough and reproduction · Captured results
Try it without an agent
Use Node.js 22 and npm in a new directory. Install the pinned gateway and verifier:
This example evaluates two proposed calls and signs their decisions. It does not
execute either tool or run git push. Everything after installation is local.
Expected: allow, then deny; both original receipt signatures and their link
verify; the modified receipt reports invalid_signature. Keep protect-mcp.key
private. To verify someone else's record, obtain their expected public key
through an independent trusted channel.
Verifier exit codes are 0: valid, 1: invalid, 2: not checked/error. An invalid result is not necessarily tampering: the wrong expected key can also fail verification. Chain replay checks the supplied links; it does not establish that you received the entire history.
CI runs this exact example against the packed candidate and the pinned published verifier. See validation and releases.
Connect your agent
Choose the integration that matches your host and the coverage you need.
Installing guidance skills does not enable enforcement. doctor checks local
configuration; confirm the selected route with a real allowed and blocked call.
For the Claude Code plugin, first prepare and start the local gate, then install it in your project (Claude Code 2.1.295 or later):
The plugin blocks routed tool calls while its gate is unavailable. Choose the plugin or standalone project hooks, so the same call is not recorded twice.
Host compatibility and release status separates adapter tests from real-host validation. The Cursor and assistant packages are previews, not public directory listings. The standalone hook-format fixes ship in 0.32.4; its changelog lists what changed for each format. A format flag alone does not establish a working Codex, Gemini or Hermes integration.
For an existing MCP server, initialize its configuration in a separate directory from the example above, then run the wrapper with your server command:
This starts in shadow mode. Review the observed calls and policy before
adding --enforce. wrap prints client configuration and exits; it is not the
launch command. Full setup instructions.
Starter shell rules inspect command text. They are useful guardrails, but can miss alternate command spellings and can match harmless quoted text. Review the starter policy's coverage and limits before relying on it.
Integrations and contributions
Sources, versions and check coverage.
Upgrading from 0.31
0.32.0 closes several ways around the gate. Some of them change how you start it:
--httplistens on 127.0.0.1, and every request exceptGET /healthneedsAuthorization: Bearer <token>. Set the samePROTECT_MCP_HTTP_TOKEN(at least 32 characters) for the gateway and for the client or ingress that calls it. Use--hostonly when you mean to expose the port beyond this machine.--enforcerefuses to start when signing is configured but its key is missing or unreadable, and refuses an allowed call whose receipt cannot be signed.--cedarwith--policyapplies both: a call needs a Cedar permit and must also pass that file'sblock,require_approval, rate limits andmin_tier. Signing and credentials come from that file.- The dashboard accepts a change only from its own page, which carries a per-launch token.
- Signing keys are written 0600 in a 0700 folder. For a key made by an earlier
version, run
chmod 600 keys/gateway.json; the gateway warns until you do. - A once approval at
POST /approvenames the exact action: the Request ID the gateway prints,tool:payload_hash. The approval nonce is on the gateway's stderr only.
See the changelog for every change.
Documentation
- Local gateway guide: policies, hooks, dashboard, credentials and receipt compatibility.
- Host compatibility: enforcement versus guidance, supported routes, test scope and release status.
- Receipt and disclosure guide: local records, selective disclosure and optional hosted digest anchoring.
- Command reference.
- Reproducible visual demo: captured results and rendering scripts.
- Integrations and contributions: source links, versions and the scope of published interoperability checks.
- Hosted coordination: separate human approvals, invoice sandbox and repository review workflows.
- Release validation and provenance.
- Changes by version.
Contribute
Start with a bounded help-wanted task: one real host capture, another clean-package runtime, or one tested policy recipe.
Bug reports, minimal reproductions, documentation fixes and compatibility tests are welcome. See CONTRIBUTING.md for setup and checks, and GOVERNANCE.md for maintainership. Report vulnerabilities privately through SECURITY.md, not a public issue.
The shared conformance corpus records compatibility results across receipt producers. A passing corpus is bounded interoperability evidence, not a security certification.
MIT licensed; see LICENSE and the existing patent notice. Maintained by Tom Farley at ScopeBlind. Receipt format: Acta individual Internet-Draft.
Source: README.md at commit 0736060
Tools
0Version history
1- v0.5.3LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
