Claude Code
For headless Claude Code (claude -p from cron, CI, or any script) —
not for interactive sessions, where Remote Control already covers you.
1. Add the MCP server
Fastest path — register the remote server directly:
claude mcp add --transport http pendnt https://api.pendnt.dev/mcp \
--header "Authorization: Bearer $PENDNT_API_KEY"
Or drop a .mcp.json into your project so it's checked in and shared with anyone
running the repo's headless jobs:
{
"mcpServers": {
"pendnt": {
"type": "http",
"url": "https://api.pendnt.dev/mcp",
"headers": {
"Authorization": "Bearer YOUR_PENDNT_API_KEY"
}
}
}
}
Don't commit the raw key. Reference an environment variable through your
process manager/CI secrets, or generate .mcp.json at deploy time from a template.
2. Run headless with the MCP config
crontab -e
# 0 3 * * * cd /path/to/repo && claude -p "Deploy release/1.4.0 to prod" --mcp-config .mcp.json
Now any tool call the agent makes — including mcp__pendnt__request_approval — is
available to it directly. A prompt like "before deploying, call request_approval with the diff
summary" gets you the durable-approval flow with zero extra plumbing.
3. Wire it into Claude Code's own permission system
Calling the tool directly (step 2) works, but Claude Code also has a built-in permission
system for every tool call the agent makes — not just the ones you explicitly prompt it to make.
The pendnt Claude Code plugin ships a hook and a
--permission-prompt-tool adapter so a permission decision that would
otherwise need a TTY (or fall back to --dangerously-skip-permissions) routes through
request_approval instead:
claude -p "Deploy release/1.4.0 to prod" \
--mcp-config .mcp.json \
--permission-prompt-tool mcp__pendnt__request_approval
With this flag, any permission prompt Claude Code would normally need an interactive terminal
for is instead sent through pendnt to your channels — the agent blocks (or resumes later with the
returned request_id) exactly like a direct request_approval call, but
without you having to prompt for it explicitly in every task.
4. What the answer looks like
[telegram 03:14] "Deploy release/1.4.0 to prod? [Approve] [Deny]"
[operator] taps Approve
< { "status": "approve", "by": "you", "at": "2026-08-29T03:15:02Z" }
$ agent resumes, runs the deploy, exits 0
Also see
- MCP tools reference — every tool, including
notify,wait_for_event, andschedule_wakeup. - Claude Agent SDK — for a long-running SDK
daemon instead of one-shot
claude -pruns.