MCP and Claude Code hooks

Let AI agents notify a person and ask for confirmation. A model can ignore MCP answers. To enforce a stop, use the hook.

Both use nodd from the CLI. Run nodd login first or set NODD_KEY.

MCP

nodd mcp is an MCP server over stdio. Add it to Claude Code with this command.

claude mcp add nodd -- nodd mcp

Other clients use this configuration.

{"mcpServers":{"nodd":{"command":"nodd","args":["mcp"]}}}

Tools

notifySends a notification without waiting. title (required, 120 characters), body (1,000 characters, or 4,000 with format: markdown), format, image (Base64, up to 40 KB), level
askAsks for approval or a choice. title (required), body, format, image, options (2 to 4, omit for approval), input (a text field, answered in note), expires_in (default 3600), wait_seconds (0 to 300, default 50)
check_answerLooks up the answer for an id returned by ask

ask and check_answer return id, status, and option_id and note when present.

pendingNo answer within wait_seconds. Use check_answer
approved, rejectedApproved or rejected. A rejection reason is in note
answeredAn option was chosen, in option_id
expired, cancelled, failedEnded without a response

Claude Code hook

nodd hook is a PreToolUse hook. It asks for approval on the iPhone before a tool runs and allows only a recorded approval. Add this to your Claude Code settings.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [{"type": "command", "command": "nodd hook", "timeout": 1260}]
      }
    ]
  }
}
Set timeout well above the response deadline. nodd hook waits until 15 minutes after the response deadline, which is 1,200 seconds with the default of 300. If Claude Code stops the hook first, nodd hook cannot print a denial. The 1,260 seconds above fits the default deadline. Add the same amount if you extend it.

Change the deadline with nodd hook --expires-in SECONDS. The default is 300.

It sends an approval at level: high. The title is Claude Code: tool name, and the body is the command, or the tool input for other tools, cut at 1,000 characters.

Approvedallow
Rejecteddeny. A rejection reason reaches the agent as Rejected in Nodd: reason
Expired, cancelled, faileddeny
Network failure, or anything unconfirmeddeny. Every failure becomes a denial