Mcp Approval Queue

io.github.OpafexPublished by GitHub account Opafexv0.2.0Updated Oct 26, 2026

Human approval gate for AI agents: risk-scored requests that only a person can approve

The publisher's own server: Approval Studio

Overview

AI-generated overview

A local human-in-the-loop approval gate that lets an AI agent request permission for risky actions and wait for a person to decide.

What you can do
  • Request approval for a risky action, with risk scored from the action name and estimated cost
  • Check the status of a submitted request and read whether it may proceed
  • List requests still waiting for a human, newest first, optionally by risk level
  • List the auto-approval rules a human has created (read-only)
  • Read server metadata, plus resources for decision stats, rules and recent history
When to use it
Use it when an agent can delete data, send messages, spend money or deploy, and you want a person to confirm each such step. It suits cooperative agents where you want a record of what was allowed, ideally paired with client-side tool permissions.
Requirements
Node.js 20 or newer, run locally via npx over stdio. Optional environment variables APPROVAL_QUEUE_STATE_DIR (state directory shared with the CLI) and APPROVAL_QUEUE_TTL_HOURS (default 24). Approvals come from the MCP client's elicitation form or from the bundled CLI.
Before you install
It only gates actions the agent chooses to ask about and honours; it is not a sandbox. An agent with shell or file access can reach the CLI and state file, so deny it the approve and rules commands and the state directory in client permissions. High and critical risk always need a person; unanswered requests expire. The guarantee that an answer came from a person depends on the client's rendering of the form.

Installation

In SourceWeft

  1. Open Mcp Approval Queue in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@opafex/mcp-approval-queue

A human-in-the-loop approval gate for AI agents, as an MCP server.

The agent calls request_approval before doing something risky. The action is risk-scored, and unless a rule you set covers it, you decide — in a form your MCP client shows you (MCP elicitation), or from a terminal. The agent gets a proceed: true|false it can act on.

The agent can ask; only a human can approve. There is no approve, reject or add-rule tool for the model to call. An approval gate the gated agent can open is not a gate.

Requires Node.js 20+.

Quick start

Add to your client's MCP config (for Claude Code, .mcp.json in your project root):

json
{  "mcpServers": {    "approval-queue": {      "command": "npx",      "args": ["-y", "@opafex/mcp-approval-queue"]    }  }}

Then tell the agent when to use it, for example in your project instructions:

Before deleting data, sending email, spending money or deploying, call request_approval and only continue if proceed is true.

How a request is decided

  1. Risk is scored from the action name — bulk_delete_users is a delete wherever the word sits — plus params.estimatedCost. The agent may pass a category, but it can only raise the score, never lower it.

  2. A rule may auto-approve it — only low or medium risk, only rules a human created. High and critical risk always go to a person.

  3. Otherwise a person decides:

    • In the client — if the client supports elicitation, the server asks you directly with the action, risk, parameters and the agent's reason, and waits for your answer. The answer goes to the server, not to the model. Approve, reject, or tick Always approve (low/medium risk only) to create a rule. Dismissing the form leaves the request pending.

    • In a terminal — otherwise the request waits, and the agent is told to poll check_status:

      bash
      npx @opafex/mcp-approval-queue pendingnpx @opafex/mcp-approval-queue approve appr_3f9c1a2b4d5e --reason "checked the recipient list"npx @opafex/mcp-approval-queue reject  appr_3f9c1a2b4d5e
  4. Unanswered requests expire after 24 hours (APPROVAL_QUEUE_TTL_HOURS) and can no longer be approved.

After five human approvals of the same action with no rejection, the next form suggests always approve. Auto-approvals do not count towards that — the system agreeing with itself is not evidence.

Tools (what the agent sees)

ToolDescription
request_approvalSubmit an action (action, optional params, context, category, wait). Returns status, proceed, risk, and what to do next.
check_statusRe-read a request by id.
list_pendingRequests still waiting for a human, newest first.
list_rulesThe auto-approval rules a human has set (read-only).

status is one of pending, approved, rejected, auto_approved, expired. Proceed only when proceed is true.

Resources

URIContents
approval://statsCounts by status and the average time a human took to decide
approval://rulesCurrent auto-approval rules
approval://historyLast 50 decisions

CLI

mcp-approval-queue                       start the MCP server (stdio)mcp-approval-queue pending               list requests waiting for a decisionmcp-approval-queue show <id>             one request in fullmcp-approval-queue approve <id> [--always] [--reason <text>]mcp-approval-queue reject <id> [--reason <text>]mcp-approval-queue rules                 list rulesmcp-approval-queue rules add <pattern> --max-risk <low|medium> [--description <text>]mcp-approval-queue rules remove <id>mcp-approval-queue history [limit]

Patterns are globs: * matches anything, ? one character, case-insensitive. A rule can never cover high or critical risk.

Configuration

VariableDefaultDescription
APPROVAL_QUEUE_STATE_DIR~/.opafex/approval-queueWhere state.json (requests, rules, history) lives. The server and the CLI must point at the same directory.
APPROVAL_QUEUE_TTL_HOURS24Hours before an undecided request expires

State is one JSON file, written atomically under a lock file, so the server and the CLI can run at the same time.

What it does not protect against

Be clear about this before relying on it:

  • An agent with a shell or file access can reach the terminal channel. The CLI and state.json are a human channel only if the agent cannot run the command or write the file. Coding agents such as Claude Code usually can. In that setup rely on the elicitation channel, and deny the agent the CLI and the state directory in your client's permission settings — for Claude Code, deny Bash(npx @opafex/mcp-approval-queue approve:*), Bash(npx @opafex/mcp-approval-queue rules:*), and edits under ~/.opafex/.
  • It only gates what the agent asks about. The agent has to call request_approval, and has to honour proceed: false. This is a protocol for a cooperative agent and a record of what was allowed, not a sandbox. Pair it with your client's own tool permissions for anything that must be enforced.
  • Elicitation is shown by the client. The guarantee that the answer came from a person is only as good as the client's rendering of the form.

Library use

ts
import { ApprovalQueueService, StateStore, assessRisk } from '@opafex/mcp-approval-queue';
const queue = new ApprovalQueueService(new StateStore('/var/lib/my-app/approvals'));const { request } = await queue.requestApproval({ action: 'refund_order', params: { estimatedCost: 40 } });

Development

bash
npm installnpm run buildnpm test

License

MIT — see LICENSE.

Source: packages/approval-queue/README.md at commit f85607b

Tools

5

request_approval

Ask a human for permission before doing something risky. Call this BEFORE the action, and only proceed when the result has proceed=true. The risk is scored from the action name (and your category, if it is riskier). A matching rule auto-approves low/medium risk actions; otherwise the human is asked directly in their client, or the request waits for them to decide with the CLI — then poll check_status.

Parameterswaitactionrequiredparamscontextcategory

check_status

Check whether an approval request has been decided. Proceed only when proceed=true.

Parametersidrequired

list_pending

List approval requests still waiting for a human, newest first, optionally filtered by risk level.

ParameterslimitriskLevel

list_rules

List the auto-approval rules a human has set. Read-only: rules are created by a human choosing "always approve" or with the CLI.

Takes no parameters.

server_info

Returns server metadata: name, version, registered tools, and registered resources. Useful for introspection and health checks.

Takes no parameters.

Version history

1
  1. v0.2.0LatestOct 25, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Approval integrations