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 分