About consentgate-mcp
consentgate-mcp is an MCP server for agents that checks actions against consent rules and can wait for human approval through Telegram. It fails closed, so only an explicit allow permits an action.
Key features
- 01Check actions against consent rules
- 02Request approval through Telegram
- 03Wait for approval or timeout
- 04Block anything without explicit approval
Use cases
- 01Check permission before sending messages
- 02Require human approval for fund transfers
- 03Gate data deletion or external changes
MCP support
It exposes the `check_action` and `request_approval` tools to MCP agents.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y consentgate-mcpCONSENTGATE_API_KEYSecretConsentGate API key (cg_…) from https://consentgate.fyi/dashboard/keysCONSENTGATE_BASE_URLOverride the API base URL (defaults to https://consentgate.fyi)Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
2Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| action | string | Yes | The specific action you intend to take, e.g. "send_email", "delete_file", "transfer_funds". |
| category | string | Yes | Action category. Built-in categories: email, social_post, message, file_write, file_delete, api_call, spending, calendar, system, custom. Any short label (<=50 chars) is accepted. |
| metadata | object | No | Structured details of the action (e.g. recipient, amount, path, url). Used by the owner's rules and shown in any approval prompt. Max 10KB. |
Details
From the project READMEconsentgate-mcp
A Model Context Protocol server that lets any MCP-capable agent (Claude Desktop, Claude Code, Cursor, custom agents, …) gate its own actions behind a human's consent policy via ConsentGate.
The agent asks before it acts; you stay in control. High-stakes actions can block on an explicit Approve / Deny tap delivered to your Telegram.
Tools
| Tool | Blocks? | What it does |
|---|---|---|
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. |
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. |
Both fail closed: anything other than an explicit allow means do not proceed.
Prerequisites
- A ConsentGate account and an API key → https://consentgate.fyi/dashboard/keys (
cg_…). - For
request_approval(interactive approvals): the Pro plan and a linked Telegram account (Dashboard → Telegram → Connect).check_actionworks on any plan.
Configuration
Environment variables:
| Var | Required | Default | Notes |
|---|---|---|---|
CONSENTGATE_API_KEY | ✅ | — | Your cg_… key. |
CONSENTGATE_BASE_URL | — | https://consentgate.fyi | Override for self-hosted instances. |
Claude Desktop
Add to claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"consentgate": {
"command": "npx",
"args": ["-y", "consentgate-mcp"],
"env": { "CONSENTGATE_API_KEY": "cg_your_key_here" }
}
}
}
Claude Code
claude mcp add consentgate --env CONSENTGATE_API_KEY=cg_your_key_here -- npx -y consentgate-mcp
Generic MCP client
Run npx -y consentgate-mcp (stdio transport) with CONSENTGATE_API_KEY in the environment.
Run from source
Until the package is published to npm, point your client at the built file (
node /abs/path/to/mcp/dist/index.js) instead ofnpx consentgate-mcp.
cd mcp
npm install # also builds via the `prepare` script
npm run build # -> dist/index.js
CONSENTGATE_API_KEY=cg_… npm run smoke # lists tools + a live check_action
How an agent should use it
A good agent policy:
Before performing any action that sends messages, spends money, deletes data, posts publicly, or changes external state, call
check_action. If the result isallow, proceed. Ifdeny, stop. Ifask(or the action is high-stakes), callrequest_approvaland proceed only on an explicitallow.
Example (request_approval):
{
"action": "transfer_funds",
"category": "spending",
"metadata": { "amount": "$500", "to": "Acme Corp" },
"wait_seconds": 90
}
// -> blocks; you tap Approve in Telegram -> { "decision": "allow", "resolved_by": "human" }
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.