Make Claude Code, Cursor or any AI agent ping your phone
Updated October 17, 2026
Long agent runs don't need you watching the terminal. For Claude Code, add two hooks that send a NextMsg push when a task finishes or is waiting on you. For Claude Desktop, Cursor and other MCP clients, add the @nextmsg/mcp server: the agent gets a notify_human tool and decides when to message you.
First, install the NextMsg app and copy your send key from Settings. Set it in your shell profile so tools can read it:
export NEXTMSG_KEY="nextmsg_live_YOUR_KEY"Claude Code: hooks
Add this to ~/.claude/settings.json (or a project's .claude/settings.json):
{
"hooks": {
"Stop": [{ "hooks": [{ "type": "command",
"command": "curl -s -d 'Claude Code finished a task' \"https://api.nextmsg.app/p/$NEXTMSG_KEY?channel=claude-code\"" }] }],
"Notification": [{ "hooks": [{ "type": "command",
"command": "curl -s -d 'Claude Code needs your input' \"https://api.nextmsg.app/p/$NEXTMSG_KEY?channel=claude-code\"" }] }]
}
}- Stop runs each time Claude finishes responding.
- Notification runs when Claude is waiting for a permission or your reply.
If Stop is too chatty for short back-and-forth sessions, keep only Notification, or use the MCP server below so Claude messages you only for real outcomes.
Claude Code, Claude Desktop and Cursor: MCP server
The @nextmsg/mcp server gives the agent one tool, notify_human(message, channel?). Its description tells the agent to send one message per outcome (finished, failed, needs input), not progress updates. It is open source: source on GitHub, package on npm.
Claude Code
claude mcp add --env NEXTMSG_KEY=nextmsg_live_YOUR_KEY nextmsg -- npx -y @nextmsg/mcpClaude Desktop, Cursor and other MCP clients
Add this to claude_desktop_config.json, ~/.cursor/mcp.json or your client's MCP settings:
{
"mcpServers": {
"nextmsg": {
"command": "npx",
"args": ["-y", "@nextmsg/mcp"],
"env": { "NEXTMSG_KEY": "nextmsg_live_YOUR_KEY" }
}
}
}The key stays in the client's configuration and is read from the environment. It is never part of the conversation, so the model can't see or leak it.
Ask for it
Agents call notify_human when you ask, so a line in your instructions (for example in CLAUDE.md or Cursor rules) makes it a habit:
When you finish a task that took more than a few minutes, or you are blocked
and need my input, call notify_human with a one-line summary.Any other agent or framework
If the agent can run a shell command or make an HTTP request, it can notify you. That covers Aider, LangChain or LangGraph tools, n8n and custom Python agents. There are dedicated guides for Cursor, OpenAI Codex and Google Antigravity and Gemini.
# Shell
npx @nextmsg/mcp "Research done: 12 sources summarized in report.md" --channel research
# Any HTTP client
curl -H 'Content-Type: application/json' \
-d '{"message":"Research done: 12 sources summarized","channel":"research"}' \
"https://api.nextmsg.app/p/$NEXTMSG_KEY"Why one-way matters for agents
NextMsg has no reply channel. Your agent can tell you something, but nobody can send instructions back into the agent through NextMsg, so it can't become a prompt-injection path. The send key can only send to your inbox; it can't read messages.
More guides
- Get a phone notification when a GitHub Action fails
- Notify when a cron job or backup finishes or fails
- Server alerts to your phone without Telegram or Slack
- AWS alerts to your phone: CloudWatch alarms and EventBridge events
- Get a phone notification when Cursor's agent finishes
- Get a phone notification when OpenAI Codex finishes a task
- Phone notifications from Google Antigravity and Gemini agents