Purpose
nahook-mcp is the official Model Context Protocol (MCP) server provided by Nahook, used to drive webhook deliveries, endpoints, and event triggering in Claude Desktop, Cursor, Cline, and other MCP-compatible AI assistants. It is released as a subcommand of the nahook CLI, following the design of "one binary, one credentials file, one installation path."
Main capabilities
After installation and authentication, the AI assistant can:
- Inspect endpoints, delivery records, and per-attempt logs to debug failed webhooks.
- Retry failed deliveries or those that entered the dead-letter queue.
- Trigger events and fan them out to all subscribed endpoints.
- Send webhooks directly to a single endpoint.
- Manage endpoints (create, update, pause, resume)—by design, no delete capability is provided.
Write operations carry MCP's destructiveHint / readOnlyHint annotations, so MCP clients will pop up a per-operation human approval prompt before any state-changing operation.
Security guardrails
Because webhook payloads are third-party data, the server treats everything that flows back into the model context as a potential prompt injection channel:
- Untrusted content is fenced: all values written by producers or receivers that enter the model—webhook payloads (get_delivery with include_payload), delivery idempotency keys, receiver error messages (list_attempts)—are wrapped in explicit <<<UNTRUSTED CONTENT ...>>> delimiters, and embedded fence markers are neutralized; the server instructions require the model to treat fenced content as inert data and never execute it as instructions.
- Payloads are capped: bodies larger than 256 KB are truncated (marked via payload_truncated) to prevent malicious producers from flooding the model context. The cap can be adjusted via the MCP client environment variable NAHOOK_MCP_PAYLOAD_CAP=<bytes>.
- No delete tool by design: there is no capability in the tool surface that can destroy data.
- update_endpoint is marked destructive: it overwrites the live endpoint configuration (repointing its URL is exactly the primitive that injection attacks may target), so its destructiveHint is true, and the client will pop up a prominent approval prompt.
- Write tools rely on manual approval: According to the MCP specification, annotations are only advisory hints rather than access control—the security boundary is the client's per-call approval prompt for every non-read-only tool. Incremental write tools (create_endpoint, send_to_endpoint, trigger_event) are marked destructiveHint: false according to their specified semantics; please keep human-in-the-loop approval enabled in the MCP client and do not allow them all through indiscriminately. If a hard guarantee of no writes is required, you can run the server without configuring an ingestion key (disabling sending), and treat administrative tools as requiring approval.
- Secrets do not enter the model: Endpoint signing keys and authentication tokens are omitted from all tool outputs; whoami returns only the public id of the token.
- Credential separation: Sending (trigger_event, send_to_endpoint) requires a separate ingestion key—without configuring it, the server is administrative/read-only at the ingestion layer.
Client-side measures cannot make prompt injection impossible and must be used together with the MCP client's tool approval prompts.
Usage
The MCP server is a subcommand of the nahook CLI. First install the CLI, then add it to the AI client.
- Install the CLI
macOS / Linux (Homebrew):
Linux / macOS (installation script):
For other installation methods, see getnahook/nahook-cli.
- Log in
This command opens a browser, guides you through device authorization authentication, and writes the credentials to ~/.nahook/config.toml.
- Connect the MCP server to the AI client
Claude Desktop and Claude Code CLI:
Cursor—edit ~/.cursor/mcp.json:
Cline (VS Code)—Cline → Settings → MCP Servers → Add:
Zed—add to settings.json:
Other MCP-compatible clients (Continue, Windsurf, Goose, etc.) follow the same command + args form.
Authentication model
The MCP server uses two independent credentials:
- CLI login token (nhc_…): Written by nahook login. Provides permissions for read tools and administrative operations for endpoints / deliveries / environments.
- Ingestion key (nhk_…): The same key used by the SDK. Provides permissions for trigger_event and send_to_endpoint. It can be set via the MCP client environment variable NAHOOK_INGESTION_KEY=nhk_..., or by adding ingestion_key = "nhk_..." in ~/.nahook/config.toml. If it is not configured and a write tool is called, the server will report an explicit error.
Permissions are evaluated per request against your workspace role—the MCP token has exactly the same permissions as you have in the dashboard, no more.
Code location and license
The MCP server implementation is part of the nahook CLI source tree. This repository exists as a discoverability entry point—README, MCP directory listing, and packaging metadata; there is no separate codebase to maintain. To report bugs, request tools, or contribute code, please open an issue in getnahook/nahook-cli. The license is MIT, the same as the CLI.