{
  "markdown": "# consentgate-mcp\n\nA [Model Context Protocol](https://modelcontextprotocol.io) server that lets any\nMCP-capable agent (Claude Desktop, Claude Code, Cursor, custom agents, …) gate its own\nactions behind a human's consent policy via [ConsentGate](https://consentgate.fyi).\n\nThe agent asks **before** it acts; you stay in control. High-stakes actions can block on an\nexplicit **Approve / Deny** tap delivered to your Telegram.\n\n## Tools\n\n| Tool | Blocks? | What it does |\n|------|---------|--------------|\n| `check_action` | no | Evaluates an action against your consent rules. Returns `allow`, `deny`, or `ask` (no rule matched). Use it before any sensitive/irreversible action. |\n| `request_approval` | yes (≤120s) | Sends an Approve/Deny prompt to your Telegram and blocks until you tap or it times out. Returns `allow` only on an explicit human Approve; everything else (deny, timeout, not-available) is `deny`. |\n\nBoth **fail closed**: anything other than an explicit `allow` means *do not proceed*.\n\n## Prerequisites\n\n1. A ConsentGate account and an API key → **https://consentgate.fyi/dashboard/keys** (`cg_…`).\n2. For `request_approval` (interactive approvals): the **Pro** plan **and** a linked Telegram\n   account (Dashboard → Telegram → Connect). `check_action` works on any plan.\n\n## Configuration\n\nEnvironment variables:\n\n| Var | Required | Default | Notes |\n|-----|----------|---------|-------|\n| `CONSENTGATE_API_KEY` | ✅ | — | Your `cg_…` key. |\n| `CONSENTGATE_BASE_URL` | — | `https://consentgate.fyi` | Override for self-hosted instances. |\n\n### Claude Desktop\n\nAdd to `claude_desktop_config.json` (Settings → Developer → Edit Config):\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"consentgate\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"consentgate-mcp\"],\n      \"env\": { \"CONSENTGATE_API_KEY\": \"cg_your_key_here\" }\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add consentgate --env CONSENTGATE_API_KEY=cg_your_key_here -- npx -y consentgate-mcp\n```\n\n### Generic MCP client\n\nRun `npx -y consentgate-mcp` (stdio transport) with `CONSENTGATE_API_KEY` in the environment.\n\n## Run from source\n\n> Until the package is published to npm, point your client at the built file\n> (`node /abs/path/to/mcp/dist/index.js`) instead of `npx consentgate-mcp`.\n\n```bash\ncd mcp\nnpm install        # also builds via the `prepare` script\nnpm run build      # -> dist/index.js\nCONSENTGATE_API_KEY=cg_… npm run smoke   # lists tools + a live check_action\n```\n\n## How an agent should use it\n\nA good agent policy:\n\n> Before performing any action that sends messages, spends money, deletes data, posts\n> publicly, or changes external state, call `check_action`. If the result is `allow`,\n> proceed. If `deny`, stop. If `ask` (or the action is high-stakes), call `request_approval`\n> and proceed only on an explicit `allow`.\n\nExample (`request_approval`):\n\n```jsonc\n{\n  \"action\": \"transfer_funds\",\n  \"category\": \"spending\",\n  \"metadata\": { \"amount\": \"$500\", \"to\": \"Acme Corp\" },\n  \"wait_seconds\": 90\n}\n// -> blocks; you tap Approve in Telegram -> { \"decision\": \"allow\", \"resolved_by\": \"human\" }\n```\n\n## License\n\nMIT\n",
  "bytes": 3107,
  "sha": "b0cfb4572520b062b8fd33b3f7a449585d0c5bf15b3dedeea1505e028de1003e",
  "repo_slug": "jessepetersondev/consentgate-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_jessepetersondev_consentgate_m_70f51ed6/readme"
}