Knok
Let your AI agent interrupt you
Ask AI about Knok
Powered by Claude Β· Grounded in docs
I know everything about Knok. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Your AI agent sends an alert β you click a button β the agent gets your response.
Works through DND, Focus modes, and fullscreen apps.
Quick Start
- Download Knok.app β open the DMG, drag to Applications, launch.
- Give your agent the integration guide β point it to
SKILL.mdor add the MCP config below.
That's it. Knok runs in the menu bar, listens on a Unix socket, and your agent handles the rest.
MCP Setup (optional β agents can also use the socket directly)
Claude Code
Add to ~/.claude.json:
{
"mcpServers": {
"knok": {
"command": "/Applications/Knok.app/Contents/MacOS/knok-mcp"
}
}
}
Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.knok]
command = "/Applications/Knok.app/Contents/MacOS/knok-mcp"
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"knok": {
"command": "/Applications/Knok.app/Contents/MacOS/knok-mcp"
}
}
}
Why
AI agents run in the background. When they need human input β approval, a decision, attention β they have no reliable way to break through. System notifications get swallowed by DND, Focus modes, and notification fatigue.
Knok renders alerts as native macOS windows at elevated window levels, making them impossible to miss. The agent sends a question, the human responds with action buttons, and the agent gets the answer back β a complete bidirectional channel.
Why Not...
osascript/display dialogBlocks the process, respects DND, looks like it's from 2005. No urgency tiers, no MCP. It works, but it's not built for agents.- terminal-notifier Fires a macOS notification and forgets about it. DND eats it. No response back. One-way street.
- ntfy.sh Great for push notifications to your phone. But push-only, your agent can't get an answer back. Doesn't bypass DND on desktop.
- Pushover Same deal: push-only, needs an account, no MCP, no DND bypass on macOS.
Knok is the only tool purpose-built for agent β human communication: bidirectional, breaks through DND, 4 urgency tiers, and native MCP support.
Alert Levels
| Level | What it does | When to use it |
|---|---|---|
whisper | Small toast, bottom-right. Auto-dismisses in 5s. | Task finished, FYI, no action needed |
nudge | Floating banner with buttons. Stays until dismissed. | Need a decision, not urgent |
knock | Overlay bar at top of screen. Sound + optional TTS. | Time-sensitive, needs response now |
break | Full-screen takeover on all displays. Must acknowledge. | Critical β stop everything |
All levels support custom action buttons, SF Symbols icons, hex accent colors, and text-to-speech.
Smart defaults: Knok auto-detects icon and color from the title β "error" β red, "build" β green, "PR" β violet. No config needed for common cases.
Architecture
+------------------+ +------------------+
| Claude Code | | Any Agent |
| (MCP client) | | (HTTP, cron..) |
+--------+---------+ +--------+---------+
| |
v v
+------------------+ +------------------+
| knok-mcp | | knok CLI |
| (stdio server) | | (swift binary) |
+--------+---------+ +--------+---------+
| |
+------------+---------------+
|
v
~/.knok/knok.sock
(Unix Domain Socket)
|
v
+--------+---------+
| Knok.app |
| (menu bar app) |
| |
| SocketServer |
| AlertEngine |
| WindowManager |
| SoundManager |
| TTSManager |
+------------------+
Three binaries ship inside Knok.app:
| Binary | Role |
|---|---|
| Knok.app | Menu bar app β renders alerts, manages the socket |
| knok-cli | CLI for scripts and shell agents |
| knok-mcp | MCP server (stdio) for Claude Code, Codex, Windsurf, etc. |
Four ways to connect:
- MCP tool β your agent calls the
alerttool natively - Unix socket β send JSON to
~/.knok/knok.sock, get response back - CLI β
knok whisper "done"from any script or shell - HTTP β
POST /alertfor remote agents (VPS, CI/CD) via Tailscale or SSH tunnel
For AI Agents
Knok ships with SKILL.md β a structured integration guide designed for LLM consumption. It includes:
- Decision tree for choosing the right connection method
- Priority order: socket β HTTP β CLI β MCP
- Full payload schema with smart defaults
- Response format and exit code semantics
- Troubleshooting table for common errors
- Remote access setup via Tailscale, SSH tunnels, or Cloudflare Tunnel
Point your agent at SKILL.md and it will know how to use Knok autonomously.
Quick Examples
# Socket β fastest, always works if Knok.app is running
echo '{"level":"nudge","title":"Deploy?","actions":[{"label":"Yes","id":"yes"},{"label":"No","id":"no"}]}' | nc -U ~/.knok/knok.sock
# CLI β great for shell scripts
knok knock "Ship to prod?" --action "Approve:approve" --action "Reject:reject"
# HTTP β for remote agents (VPS, CI/CD)
curl -X POST http://your-mac.tail12345.ts.net:9999/alert \
-H "Authorization: Bearer knk_yourtoken" \
-H "Content-Type: application/json" \
-d '{"level":"break","title":"Server Down","message":"3 endpoints failing"}'
CLI Reference
USAGE: knok <level> <message> [options]
LEVELS: whisper, nudge, knock, break
| Flag | Description |
|---|---|
--title <string> | Alert title (defaults to the message) |
--tts | Speak the message via text-to-speech |
--action <label:id[:url]> | Add a button. Repeatable. |
--ttl <int> | Auto-dismiss after N seconds |
--icon <string> | SF Symbol name (e.g. bolt.fill) |
--color <string> | Hex accent color (e.g. #A855F7) |
Exit codes: 0 = action clicked Β· 1 = dismissed Β· 2 = timed out
# Use exit codes in scripts
knok knock "Deploy?" --action "Yes:yes" --action "No:no"
if [ $? -eq 0 ]; then
echo "Approved"
fi
Settings
Click the menu bar icon β Settings:
| Tab | Options |
|---|---|
| Sounds | Global toggle, volume, per-level sound selection |
| Speech | TTS toggle, voice, speed |
| Appearance | Font size (small / medium / large) |
| Behavior | Show in all Spaces, per-level auto-dismiss, launch at login |
| Network | HTTP server toggle, port, auth token, bind address |
The menu bar popover shows a history of recent alerts with level, response, and timestamp.
Security
- No telemetry. No analytics. No phone-home. Zero data collection. Alert history lives in memory only.
- Localhost by default. The HTTP server binds to
127.0.0.1. Remote access requires explicit opt-in via Tailscale IP β never exposed on local WiFi or public networks. - Socket secured.
~/.knok/knok.sockischmod 0600, parent directory is0700. Only your user can connect. - Signed and notarized. Code-signed with Developer ID, notarized by Apple, auto-updates verified with EdDSA signatures via Sparkle.
Integrations
Beyond the built-in MCP, socket, CLI, and HTTP interfaces, Knok integrates with:
GitHub (built-in)
Connect your GitHub account directly from Settings β GitHub. Knok monitors your enabled repos and alerts you when:
- PR ready to merge β all CI checks passed
- CI failed β a check run failed on an open PR
Uses GitHub Device Flow OAuth. Polls every 60s, deduplicates alerts, auto-cleans on PR close/merge. Token stored in macOS Keychain.
Paperclip (plugin)
paperclip-plugin-knok β a native Paperclip plugin that pushes desktop notifications via Knok when inbox events occur.
Subscribes to 8 Paperclip domain events (approvals, agent runs, issues, comments) and maps each to the appropriate Knok urgency level. Configurable per-event toggles and level overrides.
# Install in Paperclip
curl -X POST http://localhost:3100/api/plugins/install \
-H "Content-Type: application/json" \
-d '{"packageName":"paperclip-plugin-knok"}'
Building from Source
For contributors or if you prefer building yourself:
git clone https://github.com/TomasWard1/knok.git
cd knok
swift build -c release
swift test
Requires macOS 13+, Swift 6.0+, Xcode 16+.
License
MIT β see LICENSE.
