Consentgate Mcp

io.github.jessepetersondev由 GitHub 账号 jessepetersondev 发布v0.1.1更新于 Oct 24, 2026

Gate AI agent actions behind a consent policy with human approval via Telegram. Fail-closed.

已验证STDIO仅桌面效率与工作流安全与监控

概览

AI 生成的概览

一个本地 MCP 服务器,让 AI 代理在执行操作前按 ConsentGate 同意策略检查,并通过 Telegram 请求人工批准。

可以做什么
按同意规则检查计划中的操作,返回 allow、deny,或在无规则匹配时返回 ask,且不阻塞代理。对高风险操作请求人工批准:向已关联的 Telegram 账号发送批准/拒绝提示,并最多等待约 120 秒。两个工具都采用失败即拒绝:除明确 allow 外一律视为不得继续。
适用场景
当你希望代理在发送消息、花钱、删除数据、公开发布或改变外部状态之前先征得同意,并希望把人工决策点推送到 Telegram 时使用。
运行要求
通过 stdio 在本地运行,通常使用 npx consentgate-mcp,因此需要 Node.js。需要 ConsentGate 账号,并通过环境变量 CONSENTGATE_API_KEY 提供 API 密钥。交互式批准需要 Pro 套餐并关联 Telegram 账号;check_action 适用于任何套餐。可用 CONSENTGATE_BASE_URL 指向自托管实例。
安装前请注意
CONSENTGATE_API_KEY 中的 API 密钥属于机密,不应放入共享配置。批准提示和操作详情会发送到 ConsentGate 与 Telegram,操作元数据会离开本机。交互式批准需要付费的 Pro 套餐。服务器只返回决策,代理是否真的在 deny 时停止取决于其是否遵守失败即拒绝策略。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Consentgate Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

consentgate-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

ToolBlocks?What it does
check_actionnoEvaluates an action against your consent rules. Returns allow, deny, or ask (no rule matched). Use it before any sensitive/irreversible action.
request_approvalyes (≤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

  1. A ConsentGate account and an API key → https://consentgate.fyi/dashboard/keys (cg_…).
  2. For request_approval (interactive approvals): the Pro plan and a linked Telegram account (Dashboard → Telegram → Connect). check_action works on any plan.

Configuration

Environment variables:

VarRequiredDefaultNotes
CONSENTGATE_API_KEY✅—Your cg_… key.
CONSENTGATE_BASE_URL—https://consentgate.fyiOverride for self-hosted instances.

Claude Desktop

Add to claude_desktop_config.json (Settings → Developer → Edit Config):

jsonc
{  "mcpServers": {    "consentgate": {      "command": "npx",      "args": ["-y", "consentgate-mcp"],      "env": { "CONSENTGATE_API_KEY": "cg_your_key_here" }    }  }}

Claude Code

bash
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 of npx consentgate-mcp.

bash
cd mcpnpm install        # also builds via the `prepare` scriptnpm run build      # -> dist/index.jsCONSENTGATE_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 is allow, proceed. If deny, stop. If ask (or the action is high-stakes), call request_approval and proceed only on an explicit allow.

Example (request_approval):

jsonc
{  "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

来源:README.md,提交 3d74d50

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分