webhook-inspector-mcp
by Erem-Bati
README.md
# webhook-inspector-mcp
[](https://github.com/Erem-Bati/webhook-inspector-mcp/actions/workflows/ci.yml)
An MCP server that lets AI coding agents (Claude Code, Cursor and others) **capture, inspect, verify and replay webhooks** while you develop.
Debugging webhooks usually means digging through logs to find out what Stripe or Twilio actually sent, and why your signature check failed. With this server running, you can ask your agent things like:
> *"Why did the last Stripe webhook fail signature verification?"*
>
> *"I fixed the handler. Replay that webhook to http://localhost:3000/webhooks/stripe."*
## How it works
```
Stripe / Twilio / curl ──► http://localhost:4400 ──► SQLite (~/.webhook-inspector/webhooks.db)
▲
AI agent (Claude Code, Cursor) ◄── MCP over stdio ── tools ───┘
```
One process does two jobs: an HTTP server captures every request sent to port 4400, and an MCP server exposes tools that read from the same database.
## Tools
| Tool | What it does |
|---|---|
| `list_webhooks` | Recent webhooks, newest first. Summaries only, to save the agent's context. |
| `get_webhook` | One webhook with all headers and the raw body. |
| `verify_signature` | Checks a Stripe (HMAC-SHA256, 5-minute tolerance) or Twilio (HMAC-SHA1 over URL + sorted params) signature, and explains the likely cause when it fails. |
| `replay_webhook` | Sends a captured webhook again, with its original method, headers and raw body, to a localhost URL. |
## Setup
Requires **Node.js 22.13 or later** (it uses the built-in `node:sqlite`).
### Claude Code
```bash
claude mcp add webhook-inspector \
-e STRIPE_WEBHOOK_SECRET=whsec_... \
-e TWILIO_AUTH_TOKEN=... \
-- npx -y webhook-inspector-mcp
```
### Cursor and other MCP clients
```json
{
"mcpServers": {
"webhook-inspector": {
"command": "npx",
"args": ["-y", "webhook-inspector-mcp"],
"env": { "STRIPE_WEBHOOK_SECRET": "whsec_..." }
}
}
}
```
### Sending webhooks to it
- **Stripe:** `stripe listen --forward-to localhost:4400/stripe`. The Stripe CLI prints a `whsec_...` signing secret; use it as `STRIPE_WEBHOOK_SECRET`.
- **Twilio:** Twilio needs a public URL, so use a tunnel (for example `ngrok http 4400`) and set the tunnel URL in the Twilio console. Twilio signs that public URL; if it can't be rebuilt from the request headers, pass it as `url` to `verify_signature`.
- **Anything else:** send it to `http://localhost:4400/<any-path>`.
## Configuration
| Environment variable | Default | Purpose |
|---|---|---|
| `WEBHOOK_INSPECTOR_PORT` | `4400` | Port that captures webhooks |
| `WEBHOOK_INSPECTOR_DB` | `~/.webhook-inspector/webhooks.db` | SQLite database file |
| `STRIPE_WEBHOOK_SECRET` | – | Needed to verify Stripe signatures |
| `TWILIO_AUTH_TOKEN` | – | Needed to verify Twilio signatures |
## Security notes
- **Secrets never reach the model.** They are read from the server's environment, not passed as tool arguments.
- **Replay is localhost-only**, so an agent can't be steered into sending requests to other hosts (SSRF).
- **Bodies are stored raw** and never re-serialized, so signatures can still be verified later.
- Request bodies are capped at 1 MB.
- Captured webhooks can contain real customer data. The database stays on your machine; delete it when you no longer need it.
- If two MCP clients start the server at the same time, only the first one captures on the port. Both can still read the shared database.
## Development
```bash
git clone https://github.com/Erem-Bati/webhook-inspector-mcp.git
cd webhook-inspector-mcp
npm install
npm test # Vitest
npm run typecheck
npm run build
```
## License
MITThis server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues