Nofax

io.github.AKzar1el由 GitHub 帳號 AKzar1el 發布v0.2.48更新於 Nov 6, 2026

Human-in-the-loop approvals and notifications for AI coding agents through a local stdio MCP server.

概覽

AI 產生的概覽

本機 stdio MCP 伺服器,讓 AI 編碼代理傳送手機通知,並暫停等待人工明確的允許/拒絕、選項或文字修改決定。

可以做什麼
  • 傳送不需回覆的單向手機通知
  • 向手機請求允許/拒絕、最多三個明確選項或自由文字修改
  • 對持久化請求 ID 進行長輪詢,直到收到人工終態回覆
  • 檢視單一請求的安全中繼資料,或在中斷後列出未解決的請求
適用情境
當代理工作流程遇到需要人做決定的界線,而你希望決定來自手機而不是沉默或逾時時使用。適合需要在受保護動作前取得明確核准的編碼代理,或需要推送進度通知的情境。
執行需求
需要 Node.js 20 或更新版本,透過 npx 並附上 mcp 參數執行。先執行 nofax init 建立本機設定與通知主題,再於 ntfy 手機應用程式訂閱該主題。僅在需要驗證發布 ntfy 時設定 NOFAX_NTFY_TOKEN 環境變數;自訂 ntfy 伺服器必須使用 HTTPS。
安裝前請注意
待處理、逾時、斷線與傳輸失敗都不會被視為核准,因此沒有回覆會阻擋動作。通知主題與一次性回覆主題等同憑證,公開 ntfy 服務端不提供端對端加密,自由文字中的敏感資訊遮蔽僅為盡力而為。不要把 NOFAX_NTFY_TOKEN 寫入設定檔、Git、命令列參數或日誌。它只是傳輸元件,不是授權政策引擎,不會賦予代理原本沒有的權限。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Nofax,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Nofax

[CI] [License: MIT] [Node.js >=20] [MCP]

Human-in-the-loop approvals and notifications for AI coding agents, without running a Nofax SaaS.

Nofax is a small open-source bridge between an agent and a human. Local mode can pause an AI workflow, notify your phone, and return an explicit decision. An optional self-deployed Cloudflare Worker exposes a deliberately narrower remote MCP surface for one-way notifications and safe request inspection.

No Nofax account. No paid model API. No inbound port on your machine. MIT licensed.

Current status: local Nofax is on the stable 0.2.x line. The optional Cloudflare Worker is the upcoming 0.3.0 remote surface and is developed alongside the local package.

Why Nofax

Agent workflows increasingly need a clean answer to one question: when automation reaches a human decision boundary, how does it ask without pretending that silence means approval?

Nofax keeps that boundary explicit:

  • pending is never approval;
  • timeout and transport failure fail closed;
  • the first accepted terminal response wins;
  • agent-specific hook schemas stay isolated in adapters;
  • remote access is intentionally narrower than local access;
  • Nofax does not grant authority the calling agent did not already have.

Two operating modes

CapabilityLocal Nofax 0.2Remote Worker 0.3
Transportstdio / CLI hooksMCP Streamable HTTP
One-way notificationYesYes
Allow / DenyYesNo
Explicit choicesYesNo
Free-text refinementYesNo
Wait for human responseYesNo
Read request metadataYesYes
Durable stateLocal filesExisting SQLite Durable Object rows
Hosted by NofaxNoNo — self-deployed Worker
Remote authenticationLocal process boundaryPrivate bearer key

The remote Worker is not a hosted remote-approval service. It can send an informational notification and inspect existing request state, but it has no approval callback, choice, refinement, wait, webhook, or arbitrary remote-write endpoint.

Quick start

1. Install

bash
npm install -g nofax

Requires Node.js 20 or newer.

2. Initialize

bash
nofax init

Nofax creates ~/.nofax/config.json and generates a high-entropy notification topic. With the default transport, subscribe to the displayed topic in the ntfy mobile app.

3. Test

bash
nofax test

4. Use it

bash
nofax notify --title "Build finished" "All tests passed"nofax approve --title "Deploy?" "Release 1.4.0 is ready"nofax refine --title "Refine draft" "Tell me what to change"

An approval resolves to stable terminal JSON:

json
{"decision":"allow"}

or:

json
{"decision":"deny"}

If the request is still pending, times out, disconnects, or hits a transport error, Nofax never converts that condition into approval.

For scripts using nofax approve, exit status 0 means explicit allow, 2 means explicit deny, 3 means timeout, and 1 means an error or unrecognized decision. The terminal JSON decision remains unchanged. Never treat a denied request as successful based solely on receipt of a response.

ntfy client compatibility: On iOS, the ntfy app may leave an HTTP action notification visible after you tap Allow or Deny, even when the action requests clear: true (upstream ntfy issue #1728). A still-visible notification does not prove whether Nofax recorded a decision: rely on Nofax's terminal allow/deny response or pending/timeout state, not on whether the notification disappears. If you use the ntfy web app instead of the mobile app, HTTP action buttons in notifications are supported in Chrome, Edge, and Opera but not Firefox or Safari; cross-origin callbacks also need the target server to allow CORS (ntfy web-app support).

Windows PowerShell with restricted script execution

If PowerShell reports that npm.ps1 or npx.ps1 cannot be loaded because scripts are disabled, invoke npm's Windows .cmd launchers explicitly. The usual global install creates a nofax.cmd launcher too:

powershell
npm.cmd install --global nofaxnofax.cmd initnofax.cmd test

For a one-off local MCP launch without a global Nofax installation, use npx.cmd -y nofax mcp (the final mcp argument is required). An MCP client that launches npx through PowerShell can set its command to npx.cmd with arguments ["-y", "nofax", "mcp"]. These are executable launchers, not a request to disable or bypass your organization's PowerShell execution policy. If executable launches themselves are restricted, follow your administrator's policy instead. See Microsoft's PowerShell execution policy reference.

MCP

Start the local stdio MCP server:

bash
nofax mcp

Connect an MCP client

Claude Code can launch the published local MCP server directly:

bash
claude mcp add nofax -- npx -y nofax mcp

Codex CLI can register the same stdio server:

bash
codex mcp add nofax -- npx -y nofax mcp

Gemini CLI can register it in user settings:

bash
gemini mcp add --scope user --transport stdio nofax npx -- -y nofax mcp

Gemini CLI may mark configured servers Disabled when the current workspace is untrusted. Review and trust only workspaces you control through Gemini's normal trust flow; do not use --trust to bypass MCP tool-call confirmations. Registering an MCP server does not automatically install the separate permission hooks documented below.

VS Code can register Nofax in its user-profile MCP configuration. Open the Command Palette, choose MCP: Open User Configuration, and add this entry to mcp.json:

json
{  "servers": {    "nofax": {      "type": "stdio",      "command": "npx",      "args": ["-y", "nofax", "mcp"]    }  }}

Merge the nofax entry with any existing servers rather than replacing them. Review VS Code's normal server-trust prompt before starting it; MCP registration does not install separate permission hooks.

For other stdio MCP clients, set the command to npx with arguments ["-y", "nofax", "mcp"]. The final mcp argument is required: running npx -y nofax without it prints the CLI usage and exits instead of starting a server. On Windows, use npx.cmd when a PowerShell script-execution policy prevents the .ps1 shim from running. Complete the Quick start configuration before using notification or approval tools.

Local MCP exposes:

  • nofax_notify
  • nofax_request_approval
  • nofax_request_choice
  • nofax_request_refinement
  • nofax_wait_for_response
  • nofax_get_request
  • nofax_list_pending

Interactive requests return a durable request ID. nofax_wait_for_response performs a bounded wait; callers must repeat the wait while the request remains pending rather than infer approval.

Agent integrations

Claude Code

Use Nofax as a local PermissionRequest hook in ~/.claude/settings.json:

json
{  "hooks": {    "PermissionRequest": [      {        "matcher": ".*",        "hooks": [          {            "type": "command",            "command": "nofax hook claude"          }        ]      }    ]  }}

Codex

Codex hooks are enabled by default. Configure ~/.codex/hooks.json:

json
{  "hooks": {    "PermissionRequest": [      {        "matcher": ".*",        "hooks": [          {            "type": "command",            "command": "nofax hook codex",            "statusMessage": "Waiting for Nofax approval"          }        ]      }    ]  }}

Restart Codex, run /hooks, and review/trust the exact Nofax hook definition before relying on it. Codex skips non-managed hooks until they are trusted, and a changed hook definition must be reviewed again. If an administrator or local policy has explicitly disabled hooks, re-enable them with [features] hooks = true in ~/.codex/config.toml.

Codex currently evaluates PermissionRequest hooks before its configured approval reviewer. A terminal Nofax Allow/Deny therefore resolves the request before Codex can route it to approvals_reviewer = "auto_review" (or the legacy guardian_subagent value). If you want Nofax to be the human approval surface, use approvals_reviewer = "user"; do not combine this Nofax approval hook with Auto-review/Guardian expecting both reviewers to run. Current Codex hook input does not expose the effective reviewer, so Nofax cannot safely distinguish a user-routed approval from one that Codex intended to auto-review.

PermissionRequest hooks are also serial with Codex's native approval UI: while Nofax is waiting, the normal Codex approval prompt is not simultaneously available. If Nofax returns no decision (for example after timeout or transport failure), Codex falls back to its normal approval flow. Nofax never converts that fallback condition into approval.

Gemini CLI

Current Gemini CLI builds expose a synchronous BeforeTool hook that can allow or deny a tool call. Route selected tools through Nofax in ~/.gemini/settings.json:

json
{  "hooks": {    "BeforeTool": [      {        "matcher": "run_shell_command|write_file|replace",        "hooks": [          {            "name": "nofax-approval",            "type": "command",            "command": "nofax hook gemini",            "timeout": 305000          }        ]      }    ],    "Notification": [      {        "matcher": "ToolPermission",        "hooks": [          {            "name": "nofax-notification",            "type": "command",            "command": "nofax hook gemini"          }        ]      }    ]  }}

BeforeTool waits for an explicit Nofax Allow/Deny result. A Nofax timeout or transport failure returns Gemini's ask decision, forcing the native interactive confirmation instead of allowing an auto-approval policy to treat the missing Nofax decision as permission. The Notification hook remains advisory and is forwarded only as a phone notification.

Adjust the matcher to the tools you want Nofax to gate. Keep the hook timeout longer than Nofax's configured approval timeout (timeoutSeconds, 300 seconds by default).

Pi (native MCP support)

Pi 1.x has built-in MCP support for local stdio servers; see Pi's official MCP documentation. After nofax init, register and check the Nofax server:

bash
pi mcp add nofax -- npx -y nofax mcppi mcp list

Pi's default MCP request timeout is 60 seconds. If you use nofax_wait_for_response with waits longer than that (up to Nofax's 240-second maximum), add "timeout": 300 to the existing nofax entry in ~/.pi/agent/mcp.json. Do not replace unrelated server entries or settings:

json
{  "mcpServers": {    "nofax": {      "command": "npx",      "args": ["-y", "nofax", "mcp"],      "timeout": 300    }  }}

Pi's built-in MCP configuration lives in ~/.pi/agent/mcp.json. Third-party extensions that replace /mcp (such as pi-mcp-adapter) take over the interactive MCP integration and may not load that built-in configuration. Verify which MCP implementation your Pi session is using before adding or changing a server; do not disable Pi's permission gates or install a second MCP runtime just for Nofax.

This registers MCP tools, not an automatic permission hook or idle-session wake-up. While a request is pending, the agent must call nofax_wait_for_response again; a missing reply, timeout, or disconnect is never approval. Use Pi's normal trust/permission workflow and verify your installed Pi build exposes pi mcp before applying these instructions.

Optional remote Cloudflare Worker

The worker/ package provides a private, self-deployed MCP endpoint:

text
remote MCP client       |       | authenticated Streamable HTTP       vCloudflare Worker       |       +--> nofax_notify ------> ntfy ------> phone       |       +--> SQLite Durable Object              |              +--> get request metadata              +--> list pending requests

It exposes exactly three tools:

  • nofax_notify — one-way notification only;
  • nofax_get_request — read one safe request projection;
  • nofax_list_pending — read unresolved, unexpired request projections.

Fresh deployments have no requests to inspect. These two inspection tools read only historical records already stored in that Worker's Durable Object, such as rows preserved from earlier experimental builds. nofax_notify does not create a request record, and local Nofax approvals are not synchronized with the remote Worker. On a new Worker, nofax_list_pending therefore returns an empty list and nofax_get_request reports not found until a historical row exists. Use the local CLI/stdio MCP for actual phone approvals.

Deploy from worker/:

bash
npm cinpx wrangler loginnpx wrangler secret put NOFAX_REMOTE_KEYnpx wrangler secret put NTFY_TOPICnpm run checknpm run deploy

Preferred MCP connection:

text
https://<worker>.workers.dev/mcpAuthorization: Bearer <NOFAX_REMOTE_KEY>

Clients that cannot attach a static authorization header can use the compatibility capability path:

text
https://<worker>.workers.dev/mcp/<NOFAX_REMOTE_KEY>

Treat the complete capability URL like a password.

See docs/remote-mcp.md for deployment, threat boundaries, and qualification details.

Important: public ntfy + serverless egress

The default public ntfy.sh service applies publisher quotas. Serverless platforms such as Cloudflare Workers may use shared outbound IP space, so a Worker can receive an ntfy 42908 daily-quota response even when that individual Worker has sent very little traffic. That limit is imposed by ntfy, not by the Cloudflare Workers request quota.

For reliability-sensitive deployments, use a notification provider whose quota is tied to your own authenticated account/identity, or operate a trusted self-hosted transport. Do not build a critical workflow around anonymous public-topic quota assumptions.

Security model

Nofax is a transport and human-interaction component, not an authorization policy engine.

Local mode:

  • pending, timeout, disconnect, malformed state, and network failure never mean approval;
  • the first valid terminal response wins;
  • notification topics and one-time response topics are capabilities;
  • public ntfy is not end-to-end encrypted from the provider;
  • redaction is best-effort and cannot reliably identify secrets embedded in arbitrary free-form text.

Remote mode:

  • only explicit nofax_notify performs an external messaging side effect;
  • request-inspection operations are read-only and do not perform hidden cleanup writes;
  • remote approval, callback, webhook, refinement, choice, and wait surfaces are absent;
  • NOFAX_REMOTE_KEY is a bearer credential;
  • remote projections omit callback capabilities, prompt/message text, and internal allowed-decision lists.

Read SECURITY.md before using Nofax with sensitive information.

Configuration

Default local config lives at ~/.nofax/config.json:

json
{  "version": 1,  "server": "https://ntfy.sh",  "topic": "nofax_<random>",  "timeoutSeconds": 300}

Override the home directory with NOFAX_HOME:

bash
NOFAX_HOME=/path/to/nofax-home nofax config

Use another ntfy-compatible server with:

bash
nofax init --server https://ntfy.example.com --force

Notification content and one-time response-topic callbacks can carry sensitive capabilities. Custom servers require HTTPS; HTTP is supported only for local development on localhost, IPv4 loopback (127.0.0.0/8) or [::1]. Previously configured non-loopback HTTP endpoints must be moved to HTTPS before notifications or approval polling will work. This is not an approval fallback: transport failures always remain pending, denied or timed out.

Optional authenticated ntfy publishing

If your ntfy server requires an access token to publish to the phone's topic, set NOFAX_NTFY_TOKEN in the environment of the local NoFax process (CLI, MCP server, or agent hook). Use an ntfy access token with the minimum necessary publish permission. NoFax adds Authorization: Bearer only to notification publication requests. See ntfy access tokens.

Authenticated publishing requires an HTTPS ntfy server; invalid credentials or HTTP transport fail before publishing or persisting a new pending approval. Do not put the token in config.json, Git, command arguments or logs. nofax config does not print the environment token.

This does not authenticate the phone's HTTP action callbacks or the temporary response-topic polling endpoint. Keep response-topic callbacks reachable using the standard NoFax workflow; server-wide access rules that block these callbacks will cause approval to remain pending or time out, never auto-approve. Configure the ntfy phone app separately for access to the protected notification topic. The remote Cloudflare Worker is not configured by this local-only setting.

Development

Local package:

bash
npm cinpm run checknpm testnpm pack --dry-run

Remote Worker:

bash
cd workernpm cinpm run check

CI qualifies Node.js 20, 22, and 24 for the local package. The Worker gate runs TypeScript, Vitest, a production-dependency audit, and a Wrangler deployment dry-run.

Project docs

Non-goals

Nofax deliberately does not provide:

  • a Nofax-operated approval SaaS;
  • a paid model API dependency;
  • persistent always approve policy;
  • an arbitrary remote shell endpoint;
  • a public multi-user Worker behind one shared deployment key;
  • a claim that MCP annotations themselves are a security boundary.

License

MIT © Tomi Šeregi. See LICENSE.

來源:README.md,提交 b3568fb

工具

7

nofax_notify

Send Nofax notification

Send a one-way phone notification. This tool is informational and does not create a human-response wait. Notification transport success never counts as approval.

輸入參數titlemessage必填

nofax_request_approval

Request human approval

Send Allow/Deny to the phone and return a durable pending requestId. IMPORTANT: after this tool returns pending, call nofax_wait_for_response and repeat while it remains pending. Never continue the guarded action without a terminal Allow response. Set allowRefine when the human should also be able to send refinement text.

輸入參數titlemessage必填allowRefine

nofax_request_choice

Request human choice

Send up to three explicit options to the phone and return a durable pending requestId. IMPORTANT: call nofax_wait_for_response and repeat while pending; do not choose on the human's behalf.

輸入參數titlemessage必填options必填

nofax_request_refinement

Request human refinement

Ask the human for free-text refinement through the configured Nofax Refine iOS Shortcut. Use this when free-text edits are needed; use nofax_request_approval for Allow/Deny or nofax_request_choice for predefined options. Returns a durable pending requestId; call nofax_wait_for_response and repeat while pending.

輸入參數titlemessage必填

nofax_wait_for_response

Wait for Nofax human response

Long-poll a durable Nofax request for up to 240 seconds. If the result is pending, you MUST call this tool again with the same requestId. Repeat indefinitely until a terminal response is returned or the user explicitly changes/cancels the goal. Do not continue the guarded action while pending.

輸入參數requestId必填waitSeconds

nofax_get_request

Get Nofax request

Inspect safe metadata and terminal state for one known durable requestId without waiting. Use nofax_wait_for_response when the caller must wait for a human decision, or nofax_list_pending to recover requestIds after interruption. Secret response topics are never returned.

輸入參數requestId必填

nofax_list_pending

List pending Nofax requests

List a bounded set of unresolved Nofax request handles for recovery after client or conversation interruption. Secret response topics are never returned.

輸入參數limit

版本歷史

20
  1. v0.2.48最新Oct 30, 2026
  2. v0.2.47Oct 30, 2026
  3. v0.2.46Oct 29, 2026
  4. v0.2.45Oct 25, 2026
  5. v0.2.44Oct 25, 2026
  6. v0.2.43Sep 24, 2026
  7. v0.2.41Sep 24, 2026
  8. v0.2.37Sep 24, 2026
  9. v0.2.33Sep 23, 2026
  10. v0.2.25Sep 23, 2026
  11. v0.2.23Sep 23, 2026
  12. v0.2.22Sep 23, 2026
  13. v0.2.18Sep 23, 2026
  14. v0.2.17Sep 23, 2026
  15. v0.2.11Sep 22, 2026
  16. v0.2.8Sep 22, 2026
  17. v0.2.5Sep 22, 2026
  18. v0.2.4Sep 22, 2026
  19. v0.2.1Sep 21, 2026
  20. v0.2.0Sep 21, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分