Skip to main content

A permission layer for AI agent tool calls — wrap any MCP server and enforce allow/deny/ask policy with full audit.

Project description

ShieldClaw-MCP

A permission layer for AI agent tool calls. Wrap any MCP server so every tools/call is checked against a policy — allowed, denied, or held for approval — and audited. We don't ask models to behave. We technically restrict what they can do.

  agent (Claude / GPT / any MCP client)
        │  tools/call: shell_exec "rm -rf /"
        ▼
  ┌───────────────┐
  │ ShieldClaw-MCP│  ──►  🚫 blocked by policy (never reaches the server)
  └───────────────┘
        │  tools/call: read_file
        ▼
  your real MCP server

Install

pip install shieldclaw-mcp

Use

Write a policy (policy.json):

{
  "default": "deny",
  "rules": {
    "read_file": "allow",
    "web_search": "allow",
    "db_delete": "deny",
    "shell_exec": "deny",
    "send_email": "ask",
    "*_secret": "ask"
  }
}

Wrap your MCP server. Wherever your agent/client launches the server, put shieldclaw-mcp wrap in front of it:

shieldclaw-mcp wrap --policy policy.json -- python my_mcp_server.py

For example, in a Claude Desktop mcpServers config, change the command from python my_mcp_server.py to shieldclaw-mcp wrap --policy /path/policy.json -- python my_mcp_server.py.

Decisions

Decision Effect
allow Forwarded to the server unchanged
deny Blocked; the agent gets a JSON-RPC error, the server never sees it
ask Blocked too (fail-closed) and tagged "requires approval"

Rules match exact tool names first, then glob patterns (db_*, *_secret), then fall back to default. The default default is deny.

Audit

Every decision is appended to ~/.shieldclaw-mcp/audit.jsonl. Tool arguments are never logged in full — only a short sha256 fingerprint, so you can correlate without leaking secrets. Set SHIELDCLAW_CONTROL_PLANE (or --control-plane URL) to also stream events to a dashboard.

Other commands

shieldclaw-mcp check --policy policy.json shell_exec   # -> deny
shieldclaw-mcp version

How it works

ShieldClaw-MCP is a transparent stdio proxy. The client launches it instead of the real server; it spawns the real server as a child and relays the newline-delimited JSON-RPC traffic both ways, intercepting only tools/call. Everything else (initialize, tools/list, notifications) passes through untouched, so it works with any compliant MCP server.

Develop

pip install -e ".[dev]"
pytest -q

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shieldclaw_mcp-0.2.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shieldclaw_mcp-0.2.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file shieldclaw_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: shieldclaw_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for shieldclaw_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 06c8448465eb67e9b9322aff3522262574e922cdfa3cc11f1bb1f8f6a393bddb
MD5 bdd64852224f03a8e4ec376203ced853
BLAKE2b-256 8cd009ef9ab9e581957e77c84b58d4f02144874b5d7675a6eae08601482a6db9

See more details on using hashes here.

File details

Details for the file shieldclaw_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: shieldclaw_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for shieldclaw_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc948d2f6deb2a594aaa9dfaf027d51aac103aa7dba658bbabceb0fb3b12bf1c
MD5 e1537da72b2eb5f200d279ce4074bc36
BLAKE2b-256 164b81eaa2fa8f237e9cbb9e4c22b57cea650d972384d33d9067344d9adb0ded

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page