approval-gate-mcp

v0.4.1
io.github.itcustomsolution/approval-gate-mcp Checked 3 days ago Published 1 month ago

Fail-closed human approval gates for AI agent actions.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

request_approval

Register a consequential action for human approval BEFORE performing it. Returns a request id. The action is NOT executed by this server; status 'approved' does NOT authorize anything by itself. Right before acting, call consume_approval with the same id, the exact action text and the same operation/payload if you supplied them; proceed only on ok:true. Anything else means no (fail closed).

ParameterTypeDescription
action *stringPrecise description of the action you intend to take, e.g. 'send email to alice@example.com with subject X'
reason *stringWhy this action is needed right now
operationstringOptional operation name a trusted executor must present, e.g. 'smtp.send' (A-Z a-z 0-9 . _ : / -)
payloadOptional JSON payload the action will execute (at most 32768 bytes canonical). The human reviews it; consume must present an identical payload.
requested_bystringIdentifier of the requesting agent or workflow (self-reported, not authenticated)
ttl_secondsintegerHow long the request stays valid, pending or approved (default 1 hour)

check_approval

Check the current status of an approval request. Informational only: no status here authorizes execution (authorizesExecution is always false). See effectiveStatus (approved_unconsumed, approved_expired, consumed, revoked, ...). Only consume_approval ok:true authorizes.

ParameterTypeDescription
id *stringThe request id returned by request_approval

wait_for_approval

Block until a human decides the request, it expires, or the timeout elapses. Returns the final (or still-pending) request. Informational only; it never authorizes execution. A timeout returns 'pending' (not approved). After 'approved', call consume_approval and proceed only on ok:true.

ParameterTypeDescription
id *stringThe request id returned by request_approval
poll_secondsintegerPolling interval
timeout_secondsintegerMaximum time to wait (default 5 minutes)

list_pending

List approval requests awaiting a human decision, oldest first, one page at a time. Returns {items, nextCursor}; nextCursor is present only when more requests exist (pass it back as cursor). Items omit payload text; use check_approval for one full request.

ParameterTypeDescription
cursorstringnextCursor from the previous page
limitintegerPage size, 1-100 (default 50)

decide_approval

Deny a pending request, or revoke an approved-but-unconsumed one. Approvals are not possible through MCP; a human must run `approval-gate approve <id>` in their own terminal.

ParameterTypeDescription
approve *booleantrue to approve (refused unless enabled by the operator), false to deny
id *stringThe request id returned by request_approval
reasonstringHuman's stated reason, verbatim

consume_approval

Call this IMMEDIATELY before performing an approved action. Succeeds exactly once per request, only if the request is approved, not past its expiry, `action` is byte-for-byte the text that was approved, and operation/payload (if the request had them) are identical. ok:false for any reason means do NOT proceed. An approval cannot be reused for a second or different action. The returned JSON is not a transferable credential: no other component may accept it as proof of approval.

ParameterTypeDescription
action *stringThe exact action text you passed to request_approval
id *stringThe request id returned by request_approval
operationstringOptional operation name a trusted executor must present, e.g. 'smtp.send' (A-Z a-z 0-9 . _ : / -)
payloadOptional JSON payload the action will execute (at most 32768 bytes canonical). The human reviews it; consume must present an identical payload.