Webhook Toolkit

io.github.THE-KIPDEV由 GitHub 账号 THE-KIPDEV 发布v0.1.1更新于 Oct 24, 2026

Webhook URLs for AI agents: receive, wait for, replay, sign and verify webhooks (Stripe, GitHub…).

已验证Streamable HTTP可网页运行开发者工具安全与监控

概览

AI 生成的概览

为助手提供公网 webhook 捕获地址,用于接收、查看、重放、签名和校验来自 Stripe、GitHub、Shopify 等服务的 webhook。

可以做什么
  • 创建和列出 webhook 捕获地址,包括与账户绑定的永久地址
  • 等待下一次投递,并列出或完整读取已捕获的请求,含识别出的服务商与事件
  • 把捕获的请求重放到公网地址,或设置该地址返回的状态码、响应体与内容类型
  • 为指定服务商生成签名载荷,并校验签名、解释处理端拒绝签名的原因
  • 请求对捕获请求的 AI 解读或生成处理代码
适用场景
适合开发和调试 webhook 集成时使用:获取可填入第三方服务的公网地址、触发事件后等待投递、排查签名失败。也便于用新签名的测试事件在本地测试处理端。
运行要求
可作为托管远程端点使用,也可通过 npx 在本地运行(需 Node.js 18.17 或更高版本)。多数工具无需账户;API 密钥通过 WEBHOOK_TOOLKIT_KEY 或 Authorization bearer 头提供,为可选项,仅在列出地址和使用 AI 解读时需要。重放到 localhost 需使用本地服务器。
安装前请注意
捕获地址的 token 相当于凭证:持有者可读取发送到该地址的请求,敏感数据应使用账户。重放会把捕获的请求发送到公网地址。AI 解读在 3 次试用后需付费,中继隧道需付费套餐。可选的 API 密钥属于机密信息。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Webhook Toolkit,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.THE-KIPDEV%2Fwebhook-toolkit/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "webhook-toolkit": {
      "type": "http",
      "url": "https://webhook-toolkit.com/mcp"
    }
  }
}

README

webhook-toolkit

Receive, forward, sign and verify webhooks from your terminal, your test suite and your AI agent. One package: a CLI (webhook-toolkit, alias whtk), a typed library and an MCP server, backed by webhook-toolkit.com.

[npm] [license] [node] [CI]

Quick start

sh
npx webhook-toolkit listen --forward http://localhost:3000/webhooks

That's it: no account, no config. You get a public URL; paste it into Stripe, GitHub, Shopify or any other sender, and every webhook shows up in your terminal and is re-sent to your local handler:

  webhook-toolkit · listening
  Webhook URL   https://webhook-toolkit.com/r/l90c9MKIdo0o  Inspector     https://webhook-toolkit.com/e/l90c9MKIdo0o  Forwarding    → http://localhost:3000/webhooks  Expires       in 7 days (2026-09-25 15:42)                Anonymous URL. Run `webhook-toolkit login` to get a permanent one.
  Waiting for webhooks. Ctrl+C to stop.
  15:42:11  POST   /stripe  stripe checkout.session.completed  248 B            ↳ 200 OK · 3 ms  15:42:11  POST   /github  github push  269 B            ↳ 500 Internal Server Error · 1 ms  {"error":"handler crashed: cannot read properties of undefined"}

Every request is also kept in a web inspector (headers, raw body, replay), so nothing is lost when your handler crashes.

Contents

CLI

sh
npm i -g webhook-toolkit     # or run any command with npx webhook-toolkit …
CommandWhat it does
whtk listen [--forward <url>]Public URL + live stream of incoming requests, optionally re-sent to localhost. Reuses your last URL while it is alive (--new for a fresh one).
whtk relay --to <url|port>Real tunnel: callers get your local app's response. Paid.
whtk sign <provider> --secret <s>Build a validly signed webhook: prints headers + a ready-to-run curl, or sends it with --send.
whtk verify <provider> --secret <s> …Check a signature, and when it fails, say why.
whtk replay <token> <id> --to <url>Re-send a captured request from your machine (localhost works).
whtk requests <token>List captured requests (--json for scripts).
whtk endpointsList your account's URLs.
whtk login / logout / whoamiSave, remove or inspect your API key.
whtk mcpStart the MCP server on stdio.

A few things worth knowing:

  • Sub-paths and query strings are kept. A request to …/r/<token>/stripe?x=1 is forwarded to http://localhost:3000/webhooks/stripe?x=1, so one URL can feed several handlers.
  • Headers are forwarded as received (minus hop-by-hop headers, host and content-length), so signature checks in your handler pass exactly as in production.
  • --json prints NDJSON (listening, request, forward events) for scripting: whtk listen -f 3000 --json | jq .request.event.
  • Colors follow NO_COLOR, FORCE_COLOR and are off when output is not a terminal.

Send a signed test event

sh
# Prints the headers and a curl command, with a realistic sample eventwhtk sign stripe --secret whsec_… --event checkout.session.completed
# Or send it straight to your handlerwhtk sign github --secret my-secret --file push.json --send http://localhost:3000/api/githubwhtk sign twilio --secret <auth token> --url https://example.com/sms --send 3000

Debug "invalid signature"

sh
whtk verify stripe --secret whsec_test_secret --body-file body.json \  -H "Stripe-Signature: t=1726000000,v1=a530ce3d81556a0eced506e1d1cad777bc55bc1e408e54dd6bfef08e1dde216c"
✗ Invalid Stripe signature (body_trailing_newline_added)  The signature matches the body without its trailing newline: a newline was appended after signing (proxy, logger, copy-paste). Verify the raw bytes exactly as received.  expected  t=1726000000,v1=1e0085bf1054f89ac8882e2e5fcbfdf301b1d6445e8ed7a316120cd5dc651ba9  received  t=1726000000,v1=a530ce3d81556a0eced506e1d1cad777bc55bc1e408e54dd6bfef08e1dde216c  timestamp 1726000000 (738 days ago)

The verifier replays the usual mistakes (whitespace in the secret, added or stripped trailing newline, CRLF conversion, expired timestamp, and for Twilio: http vs https, port, query string, trailing slash, repeated parameters) and tells you which one matches. The same logic powers the online signature validator.

Test webhooks in your test suite

The library gives your tests a real public URL and a way to wait for what lands on it. It works anonymously; set WEBHOOK_TOOLKIT_KEY in CI for permanent URLs and higher limits.

Vitest (or Jest in ESM mode)

ts
import { expect, test } from "vitest";import { WebhookToolkit, verify } from "webhook-toolkit";
const wt = new WebhookToolkit(); // anonymous, or reads WEBHOOK_TOOLKIT_KEY
test("creating an order notifies the customer's webhook", async () => {  const endpoint = await wt.createEndpoint({ name: "ci-orders" });
  // The app under test sends its outgoing webhooks to the capture URL.  await api.post("/settings/webhooks", { url: endpoint.url, secret: "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw" });  await api.post("/orders", { sku: "tshirt", quantity: 2 });
  const req = await wt.waitForRequest(endpoint.token, {    timeoutMs: 30_000,    filter: (r) => JSON.parse(r.body).type === "order.created",  });
  expect(JSON.parse(req.body).data.quantity).toBe(2);  // Your outgoing signatures are correct, too:  expect(verify("svix", { secret: "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw", rawBody: req.body, headers: req.headers }).valid).toBe(true);});

waitForRequest checks requests that already arrived since the endpoint was created, then long-polls until timeoutMs, so the order of "trigger" and "wait" does not matter. It rejects with a WebhookToolkitError (code: "timeout") when nothing matched.

To test your handler without any network at all, sign the payload locally:

ts
import { sign } from "webhook-toolkit";
const { headers, body } = sign("stripe", { secret: process.env.STRIPE_WEBHOOK_SECRET!, event: "checkout.session.completed" });const res = await fetch("http://localhost:3000/api/webhooks/stripe", { method: "POST", headers, body });expect(res.status).toBe(200);

Playwright

ts
import { expect, test } from "@playwright/test";import { WebhookToolkit } from "webhook-toolkit";
const wt = new WebhookToolkit();
test("'Send test event' reaches the configured URL", async ({ page }) => {  const endpoint = await wt.createEndpoint();
  await page.goto("/settings/integrations");  await page.getByLabel("Webhook URL").fill(endpoint.url);  await page.getByRole("button", { name: "Save" }).click();  await page.getByRole("button", { name: "Send test event" }).click();
  const req = await wt.waitForRequest(endpoint.token, { timeoutMs: 15_000 });  expect(req.method).toBe("POST");  expect(req.headers["content-type"]).toContain("application/json");});

The package is ESM-only. CommonJS test runners work on Node ≥ 20.19 / 22.12 (native require(esm)); Jest needs its ESM mode.

Use it from AI agents (MCP)

webhook-toolkit mcp is a Model Context Protocol server. Your coding agent can create a webhook URL, wait for the delivery after triggering it, read the payload, then replay it or send freshly signed events to your localhost handler while it fixes the code.

The API key is optional: everything except list_webhook_urls and explain_webhook_request works anonymously.

Claude Code

sh
claude mcp add webhook-toolkit -- npx -y webhook-toolkit mcp# with a key:claude mcp add webhook-toolkit --env WEBHOOK_TOOLKIT_KEY=whk_… -- npx -y webhook-toolkit mcp

Cursor (.cursor/mcp.json), Windsurf (~/.codeium/windsurf/mcp_config.json), Claude Desktop (claude_desktop_config.json)

json
{  "mcpServers": {    "webhook-toolkit": {      "command": "npx",      "args": ["-y", "webhook-toolkit", "mcp"],      "env": { "WEBHOOK_TOOLKIT_KEY": "whk_…" }    }  }}

VS Code (.vscode/mcp.json)

json
{  "inputs": [    { "type": "promptString", "id": "webhook-toolkit-key", "description": "webhook-toolkit.com API key (optional)", "password": true }  ],  "servers": {    "webhook-toolkit": {      "type": "stdio",      "command": "npx",      "args": ["-y", "webhook-toolkit", "mcp"],      "env": { "WEBHOOK_TOOLKIT_KEY": "${input:webhook-toolkit-key}" }    }  }}

Codex CLI (~/.codex/config.toml)

toml
[mcp_servers.webhook-toolkit]command = "npx"args = ["-y", "webhook-toolkit", "mcp"]env = { WEBHOOK_TOOLKIT_KEY = "whk_…" }

ChatGPT, Claude.ai and other remote-capable clients: add a custom connector pointing at the hosted server, nothing to install:

https://webhook-toolkit.com/mcp

(Streamable HTTP, optional Authorization: Bearer whk_….) The hosted server cannot reach your machine, so replaying to localhost and send_signed_webhook need the local server above.

ToolUse it to
create_webhook_urlGet a public URL to receive a webhook from a third-party service or the app under test
wait_for_webhookBlock until the delivery arrives (filters: provider, event, method, path, body); safe to call after triggering
list_webhook_requests / get_webhook_requestSee what was actually sent: headers, raw body, detected provider and event
replay_webhook_requestRe-send a captured request from the local machine to e.g. http://localhost:3000/api/webhooks
send_signed_webhookPOST a validly signed event (Stripe, GitHub, Shopify, Slack, Twilio, Mailgun, Svix, Paddle, Discord) to your handler
sign_webhook_payloadCompute signature headers and a curl command without sending
verify_webhook_signatureExplain why a handler rejects a signature
set_webhook_responseChange what the URL answers (status, body): simulate failures, answer challenges
list_webhook_urlsFind an existing permanent URL (key required)
explain_webhook_requestAI explanation of a payload, or a generated handler (paid, 3 free trials)

Outputs are compact text plus the key JSON; bodies over 20 KB are truncated with a note pointing to the inspector. To embed the server in your own process: import { createMcpServer } from "webhook-toolkit/mcp".

Signing and verifying

sign() and verify() run locally with node:crypto: secrets never leave your machine. Signatures are byte-for-byte identical to the webhook-toolkit.com signer, and the tests check them against the providers' published examples (GitHub, Slack, Twilio, Svix).

ProvideridSignatureAlgorithmsecret
StripestripeStripe-SignatureHMAC-SHA256 hex of t.bodyendpoint secret whsec_…
GitHub, Gitea, ForgejogithubX-Hub-Signature-256 (+ X-Hub-Signature)HMAC-SHA256 hex of the bodywebhook secret
ShopifyshopifyX-Shopify-Hmac-Sha256HMAC-SHA256 base64 of the bodyapp client secret
SlackslackX-Slack-Signature, X-Slack-Request-TimestampHMAC-SHA256 hex of v0:ts:bodysigning secret
TwiliotwilioX-Twilio-SignatureHMAC-SHA1 base64 of URL + sorted params (bodySHA256 for JSON)auth token, plus url
Mailgunmailgunsignature object in the bodyHMAC-SHA256 hex of timestamp + tokenwebhook signing key
Svix / Standard Webhooks (Clerk, Resend)svixsvix-* and webhook-* headersHMAC-SHA256 base64 of id.ts.bodywhsec_…
Paddle BillingpaddlePaddle-SignatureHMAC-SHA256 hex of ts:bodypdl_ntfset_…
Discord interactionsdiscordX-Signature-Ed25519, X-Signature-TimestampEd25519verify: app public key; sign: a test private key
ts
import { sign, verify } from "webhook-toolkit";
// In an Express handler (use express.raw so the body stays byte-exact)app.post("/webhooks/stripe", express.raw({ type: "*/*" }), (req, res) => {  const result = verify("stripe", { secret: process.env.STRIPE_WEBHOOK_SECRET!, rawBody: req.body, headers: req.headers });  if (!result.valid) return res.status(400).send(result.message);  // …});

verify() returns { valid, reason?, message, expected?, received?, timestamp? }. Failure reasons: missing_signature, malformed_signature, missing_timestamp, missing_url, invalid_secret, timestamp_out_of_tolerance (default 300 s, toleranceSeconds: 0 disables), signature_mismatch, secret_whitespace, body_trailing_newline_added, body_trailing_newline_removed, body_line_endings_changed, url_mismatch (Twilio), body_hash_mismatch (Twilio JSON). Comparisons are constant-time.

Provider detection

detectProvider(headers, body) returns { provider, event } from a data-driven table (DETECTION_RULES), for example { provider: "stripe", event: "invoice.paid" } or { provider: "twilio", event: "message.received" }. It knows Stripe, GitHub, GitLab, Bitbucket, Shopify, WooCommerce, Slack, SendGrid, Twilio, Paddle, Svix (Clerk, Resend), GoCardless, PayPal, Discord, Linear, Typeform, Calendly, Square, HubSpot, Zoom, Lemon Squeezy, Coinbase Commerce, Twitch, Mux, Vercel, Netlify, Sentry, Trello, Plaid, Mandrill, Jira, Postmark, Mollie, Adyen, Mailgun and Redsys. Adding one is a table entry plus a test fixture.

Relay: a real tunnel (paid)

listen --forward is free and fine for most webhooks, but the sender receives the capture URL's response, not your app's. When the sender needs your real answer (Slack slash commands, Twilio TwiML, Shopify mandatory responses, OAuth callbacks), use the relay:

sh
whtk login               # oncewhtk relay --to 3000
  webhook-toolkit relay · live
  Public URL  https://webhook-toolkit.com/relay/my-app  (any sub-path works)  Forwarding  → http://localhost:3000

Requests to the public URL are proxied over a WebSocket to your machine and your local response (status, headers, body) goes back to the caller. It reconnects with backoff. The relay comes with the 7-day Pass or Pro.

Free vs paid

AnonymousFree accountPass (7 days, €5 once) / Pro (€9/month)
Capture URLsup to 30 new per day, each lasts 7 days1 permanent URL25 permanent URLs
History7 days7 days30 days
CLI listen --forward, replay, sign, verify, MCP✓✓✓
Relay (real tunnel to localhost)✓
AI explanations and generated handlers3 free trials3 free trials✓

Details and the Business plan: webhook-toolkit.com/pricing. Everything that runs locally (signing, verifying, detection, forwarding) is free and stays free.

How it compares

  • smee.io is a free, open-source service from the GitHub Probot team that forwards webhooks to localhost through its client. If forwarding is all you need, it does the job. webhook-toolkit's listen --forward works the same way and adds a stored inspector, provider/event detection, replay, signing and verification tools, a test-suite API and an MCP server.
  • webhook.site is a mature hosted request inspector with custom responses and paid automation features. webhook-toolkit covers the inspect-and-respond part and focuses on the local developer loop: forwarding, signed test events, signature diagnosis, tests and agents.
  • ngrok is a general-purpose tunnel for any HTTP or TCP service, with a local traffic inspector. Pick it to expose a whole app. webhook-toolkit's free flow needs no account, and its paid relay is scoped to webhooks.

Library reference

ts
import { WebhookToolkit, WebhookToolkitError, sign, verify, detectProvider, forwardRequest } from "webhook-toolkit";
const wt = new WebhookToolkit({ apiKey, baseUrl }); // both optional (env: WEBHOOK_TOOLKIT_KEY, WEBHOOK_TOOLKIT_URL)
MethodReturns
createEndpoint({ name? })Endpoint: { token, url, inspectUrl, expiresAt, createdAt, response, … }
listEndpoints()Endpoint[] (API key required)
getEndpoint(token) / deleteEndpoint(token)Endpoint / void
updateEndpoint(token, { name?, response?: { status?, body?, contentType? } })Endpoint
listRequests(token, { limit?, after? })CapturedRequest[], newest first
getRequest(token, id) / clearRequests(token)CapturedRequest / void
waitForRequest(token, { timeoutMs?, after?, filter?, signal? })CapturedRequest (rejects with code: "timeout")
stream(token, onRequest, { signal?, after?, onOpen?, onReconnect? })Promise<void>: live SSE feed, reconnects and catches up on missed requests
replayRequest(token, id, url)server-side replay to a public URL
explainRequest(token, id, { mode?, language? })AI explanation or handler (paid, 3 free trials)
me(), listRelays(), createRelay()account, plan, relays

forwardRequest(request, target) re-sends a captured request from your machine (the same function behind listen --forward and replay). Errors are WebhookToolkitError with status (HTTP status, 0 for network errors), code (unauthorized, upgrade_required, plan_limit, expired, timeout, network_error, …) and upgradeUrl on 402 answers. Everything is typed; types ship with the package.

Configuration

VariablePurpose
WEBHOOK_TOOLKIT_KEYAPI key (whk_…), created in your dashboard. Takes precedence over the saved key; --key overrides both.
WEBHOOK_TOOLKIT_URLAPI origin, e.g. http://localhost:3000 for a self-hosted instance. Same as --base-url.
WEBHOOK_TOOLKIT_RELAY_TOKENRelay token for whtk relay.
NO_COLOR / FORCE_COLORTerminal colors.

whtk login stores the key in ~/.config/webhook-toolkit/config.json (or $XDG_CONFIG_HOME/webhook-toolkit/config.json) with mode 600. The same file remembers the last URL used by listen.

A capture URL's token is a capability: anyone holding it can read the requests sent to it. Use an account for anything sensitive; the owner's key is then required to change or delete the URL.

Requirements

Node.js 18.17 or later. Runtime dependencies: @modelcontextprotocol/sdk and zod (MCP server) and ws (relay).

Contributing

Issues and pull requests are welcome: see CONTRIBUTING.md. New providers for detection or signing are the easiest place to start.

License

MIT © 2026 Kipdev. Hosted service: webhook-toolkit.com.

来源:README.md,提交 8923bc8

工具

10

create_webhook_url

Create a webhook URL

Create a public HTTPS URL that captures every request sent to it (any method, any sub-path). Use it when you need an endpoint to receive a webhook from a third-party service while building or debugging an integration. Returns the URL to configure in the service and a live inspector link for the human.

输入参数name

list_webhook_urls

List my webhook URLs

List the webhook URLs of the account behind the API key (requires an API key).

无需输入参数。

wait_for_webhook

Wait for a webhook

Block until the next request reaches a webhook URL (or the timeout elapses), then return it in full: method, path, headers, body, detected provider and event. Use right after triggering an action that should send a webhook. Call again with `after` set to the last request's createdAt to wait for the following one.

输入参数aftertoken必填timeout_seconds

list_webhook_requests

List captured requests

List the most recent requests captured by a webhook URL, newest first (summaries; use get_webhook_request for one full request).

输入参数limittoken必填

get_webhook_request

Get a captured request

Return one captured request in full (headers, raw body, detected provider/event).

输入参数token必填request_id必填

set_webhook_response

Set the HTTP response

Choose what the webhook URL answers to callers (status code, body, content type) — e.g. return 500 to test the sender's retries, or a specific JSON/XML body the service expects.

输入参数bodytoken必填statuscontent_type

replay_webhook_request

Replay a captured request

Re-send a captured request (same method, headers and raw body) to a PUBLIC URL and return the target's response. Localhost and private IPs are refused here: for localhost use the CLI (`npx webhook-toolkit replay`) or the local MCP server (`npx webhook-toolkit mcp`).

输入参数token必填request_id必填target_url必填

sign_webhook_payload

Sign a test webhook payload

Build a webhook body with a VALID signature header for a provider, to test a handler's signature verification without triggering a real event. Providers: stripe, github, shopify, slack, twilio, mailgun. Returns the headers, the exact body to send and a ready-to-run curl command.

输入参数secret必填payloadprovider必填event_typetarget_url

verify_webhook_signature

Verify a webhook signature

Check whether a webhook signature is valid for a raw body and a secret, and diagnose why it fails (wrong secret, whitespace, re-serialized JSON body, expired timestamp, wrong URL for Twilio). Providers: stripe, github, shopify, slack, twilio.

输入参数urlsecret必填provider必填raw_body必填signature必填timestamp

explain_webhook_request

Explain a webhook / write its handler (AI)

AI analysis of a captured request. mode=explain: who sent it, which event, key fields, how to verify the signature, pitfalls. mode=handler: complete receiving code that verifies the signature and handles this event. Included in paid plans; anonymous and free users get 3 trials.

输入参数modetoken必填languagerequest_id必填

版本历史

1
  1. v0.1.1最新Sep 18, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分