# protect-mcp [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/scopeblind/scopeblind-gateway  
**GitHub Stars:** 10  
**npm Downloads (last month):** 7138  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/protect-mcp

## Description
Fail-closed Cedar policy gate + Ed25519 signed receipts for agent tool calls. Denies on any error.

## Tools
Capabilities this server exposes over MCP:

- **evaluate_action** — Decide whether a proposed agent tool call is allowed by a Cedar policy, fail-closed. Evaluates the call against the policy the same way the protect-mcp gate does at runtime, and on any policy error the decision is DENY (never a silent allow). Inputs: tool (the tool name, e.g. "Bash" or "send_email"), input (the tool's arguments object; the policy sees it at context.input.*), and policy (inline Cedar source text). Returns JSON { allowed: boolean, decision: "allow" | "deny", reason: string, policy_digest: string (sha256 prefix of the policy) }. A missing or unparseable policy denies. Use this before an agent acts; pair with sign_decision to make the decision auditable.
- **sign_decision** — Turn a gate decision into an Ed25519 signed receipt (Veritas Acta format, JCS-canonical). A denial signs a gateway_restraint artifact; an allow signs a decision_receipt. This is what makes 'what the agent was blocked from doing' provable after the fact. Inputs: tool (required), decision ("allow" | "deny", required), reason_code (optional), policy_digest (optional), and private_key_hex (optional 64-hex Ed25519 secret; if omitted, an ephemeral keypair is generated and its public key is returned so the receipt still verifies). Returns JSON { receipt: object (the signed artifact), artifact_type: "decision_receipt" | "gateway_restraint", public_key: string (hex, pass this to verify_receipt or pin it), ephemeral: boolean }. Writes nothing to disk and contacts no network.
- **verify_receipt** — Verify a signed receipt offline against a public key. No network, no accounts: the Ed25519 signature is checked over the canonical bytes. Inputs: receipt (the signed artifact object, required) and public_key_hex (optional; falls back to a public_key embedded in the receipt payload). Returns JSON { valid: boolean, error: string | null (e.g. "invalid_signature", "no_public_key"), type: string, kid: string | null, issuer: string | null }. For authenticity you should verify against a key you pinned out of band, not only the one carried inside the receipt.
- **self_test** — Prove the gate works, end to end, with no inputs. Runs a known-forbidden action (rm -rf) against a sample deny policy and asserts it is DENIED, then signs a decision and verifies the receipt round-trips. Returns JSON { ok: boolean, gate_denies_forbidden: boolean, sign_verify_roundtrip: boolean, details: object }. This is the 'a gate that cannot prove it denies does not start' check, exposed as a callable tool. Contacts no network.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "protect-mcp": {
    "command": "npx",
    "args": ["-y","protect-mcp","mcp"]
  }
}
```

## Documentation

## What protect-mcp does

protect-mcp applies Cedar policy decisions to proposed AI agent tool calls and can record those decisions in signed receipts. It supports wrapping an existing MCP server, using a local HTTP gateway, connecting the evaluator as MCP tools, or applying enforcement through coding-agent hooks.

The gateway can allow or deny calls based on the selected policy. In fail-closed enforcement, missing policies, policy-engine failures, and evaluation errors result in denial. The MCP wrapper starts in shadow mode, allowing you to inspect observed calls before enabling blocking.

Receipts use Ed25519 signatures and include the decision and policy digest. The separate `@veritasacta/verify` package can validate receipt bytes with a trusted public key and replay linked receipt records.

## How it works

Initialize a configuration and starter policy, then evaluate proposed calls with the CLI or place the wrapper in front of an MCP server. A wrapped server is started with its command after the policy options, for example:

```sh
npx --yes protect-mcp@latest --policy ./protect-mcp.json -- node your-mcp-server.js
```

Use `--enforce` after reviewing shadow-mode results. The `wrap` command prints client configuration and exits; it is not the process used to launch the wrapped server. Coding-agent plugins and standalone hooks provide additional routes for enforcement, including Claude Code project integrations and a Cursor project preview.

Signing evaluates the call again and appends the resulting receipt to a JSON Lines file. Verification checks signatures and, for a replay chain, the supplied links. A failed verification can result from an incorrect expected public key as well as from altered data, and chain replay does not prove that the supplied file contains the complete history.

## Setup and configuration

The local quickstart requires Node.js 22 and npm. Install `protect-mcp`, initialize a starter policy and private key, then run evaluations or start the wrapper. Keep the generated private key confidential; use only the public key when verifying another party's records, obtained through an independently trusted channel.

A typical setup includes:

1. Run `protect-mcp init`, optionally with `--starter`.
2. Review the Cedar policy and observed calls.
3. Use `evaluate` for local policy checks or start the MCP wrapper with a server command.
4. Add `--enforce` when the policy is ready to block calls.
5. Use `sign` to create receipts and `@veritasacta/verify` to check them.

The starter shell rules inspect command text. They may miss alternate spellings and can match harmless text inside quoted arguments, so their coverage should be reviewed before relying on them for enforcement.

## Tools and capabilities

- Initialize configuration, starter policy, and signing material.
- Evaluate proposed tool calls against Cedar policies.
- Wrap existing MCP servers over stdio.
- Run a local HTTP gateway.
- Expose the policy evaluator as MCP tools.
- Sign decisions with Ed25519 receipts and verify receipt chains.
- Apply enforcement through Claude Code hooks or plugin routes.

## Limitations and notes

Coverage applies only to calls routed through the gateway or selected hook. The project is not an operating-system sandbox. A valid signed receipt records a decision; it does not prove that an action executed or that no action was omitted.

Shadow mode is the default for the MCP wrapper, so blocking requires explicit enforcement. The Claude Code plugin blocks routed calls while its local gate is unavailable, and the project advises choosing either that plugin or standalone project hooks to avoid recording the same call twice. Local evaluation and verification do not require a ScopeBlind account or send decision telemetry.

_Full upstream README: https://allmcps.com/mcp/protect-mcp/readme_

