Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ HOOKDECK_SIGNING_SECRET=
BRIDGE_MCP_SECRET=
# `false` turns the URL form (/mcp/<BRIDGE_MCP_SECRET>) off, for a bridge no ChatGPT connects to. Default true.
# BRIDGE_MCP_SECRET_URL=
# What each delivery's webhook-id header holds: `event-id` (the event's eventId), `per-message` (a new
# id per delivery, as SEP-3415 requires) or `auto` (default: per-message for clients that declare the
# events extension, except TanStack AI, the AI SDK and OpenClaw; event-id for the rest).
# BRIDGE_WEBHOOK_ID_FORMAT=
# How source events reach the bridge: `cli` locally (hookdeck listen, no public URL) or `http` when
# deployed (the default on Fly.io).
BRIDGE_INBOUND=cli
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Unreleased

### Added

- **A per-message `webhook-id` for clients that follow SEP-3415:** a webhook delivery's `webhook-id` was always the event's `eventId`. SEP-3415 now requires a per-message id, unique to one event on one subscription and never derived from `eventId`, so a receiver that dedupes on `webhook-id` doesn't drop an event that matches two of its subscriptions. A client that declares the events extension in a request's `_meta` (`io.modelcontextprotocol/clientCapabilities`) now gets `msg_` and 24 random characters, the same on every retry. Every other client still gets the `eventId`, as do TanStack AI, the Vercel AI SDK and OpenClaw by their default client names, since they reject a delivery whose `webhook-id` isn't its `eventId` (TanStack AI declares the extension). `BRIDGE_WEBHOOK_ID_FORMAT` (`subscriptions.webhookIdFormat`) is `auto` by default; `event-id` or `per-message` applies to every subscription. A subscription's format is chosen when it's made or refreshed, and `serve` logs it: `<subscription id>: webhook-id per message (client "<name>" declares io.modelcontextprotocol/events)` or `<subscription id>: webhook-id is the eventId (...)`, giving the reason: what the client declares, the legacy client list, or the setting. With a per-message id, an event whose id contains a period is delivered rather than skipped ([#113](https://github.com/hookdeck/mcp-events-bridge/issues/113)).

### Changed

- **Subscriptions dedupe on `eventId`, not `webhook-id`:** each subscription's connection (and a replay's) drops a repeated event by the envelope's `eventId`, since a per-message `webhook-id` differs each time a service resends an event. It's the same as before for subscriptions that get the `eventId`. Existing subscriptions change when they're next refreshed ([#113](https://github.com/hookdeck/mcp-events-bridge/issues/113)).

## 0.10.0 (2026-11-05)

Breaking, for code that reads `list_sources`' `events` as a list of names: each entry is now an event type object; read `events[].name`.
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ The server signs each request's raw body with HMAC-SHA256 and the shared secret,
These options work for every `source()`, whatever its type:

- **`events`:** the sender's event names (offered as `{id}.{name}`, e.g. `fills.order.filled`), as a list or with a description each. Keep a description under about 400 characters: ChatGPT has been reported to leave out events with longer ones, and `setup` and `serve` warn about them. With more than one, `eventType` says where the sender names the event, `{ header }` or `{ field }` (a dot path into the body), and each event's `value` is the sender's name for it (default: the event name). Requests for other values are ignored.
- **`eventId`:** the sender's id for an event, from `{ header }` or `{ field }`. It becomes the MCP event's `eventId` (and its `webhook-id`), and Event Gateway drops repeats within an hour. Default: a hash of the JSON body (the first 32 hex characters of its SHA-256), so a sender's retry with the same body is dropped as a repeat, and two different events with identical bodies count as one. Set it if your sender has an id.
- **`eventId`:** the sender's id for an event, from `{ header }` or `{ field }`. It becomes the MCP event's `eventId` (and its `webhook-id`, for clients that need them equal: see `BRIDGE_WEBHOOK_ID_FORMAT`), and Event Gateway drops repeats within an hour. Default: a hash of the JSON body (the first 32 hex characters of its SHA-256), so a sender's retry with the same body is dropped as a repeat, and two different events with identical bodies count as one. Set it if your sender has an id.
- **`occurredAt`:** a body field with an ISO 8601 or Unix time. Default: when Event Gateway received the request (for a live delivery, when Event Gateway built the event from it, moments later).
- **Data:** the JSON body as sent, or only the top-level fields in `fields: [...]`. Bodies must be JSON (anything else is skipped, and stays in Event Gateway), and the event at most 256 KiB.
- **`filters`:** top-level body fields subscribers can filter on, by exact match of value and type: `{ "quantity": 100 }` matches the number 100, not the string `"100"`.
Expand Down Expand Up @@ -325,7 +325,7 @@ bridge-hookdeck-notifications source: Event Gateway's issue notifications
```

- **`bridge-<source id>`** (here `bridge-resend`) is the source's Event Gateway source, the URL its webhooks are registered with. Setup also writes its transformation, `bridge-<source id>-envelope`, which turns each request into an MCP Event; every subscription to the source's events uses it.
- **`mcp-sub-<id>`** is one subscription: a connection on the source with the transformation, a filter for the event name and the subscription's arguments, dedupe on `webhook-id` and retries, and a destination at the subscriber's callback URL that signs every attempt with the subscriber's secret. The bridge creates it when an agent subscribes, and deletes it when the subscription ends.
- **`mcp-sub-<id>`** is one subscription: a connection on the source with the transformation, a filter for the event name and the subscription's arguments, dedupe on the event's `eventId` and retries, and a destination at the subscriber's callback URL that signs every attempt with the subscriber's secret. The bridge creates it when an agent subscribes, and deletes it when the subscription ends.
- **`bridge-hookdeck-notifications`** receives Event Gateway's issue notifications and forwards them to each deployment, so the bridge hears about failing callbacks and reports them to subscribers.
- **`bridge-replay`** (created by the first replay) is a Publish API source: while a subscription made with a cursor catches up, a connection from it, `bridge-replay-<subscription id>`, delivers the replayed events to the subscription's destination, and the bridge deletes it when they're delivered.

Expand All @@ -343,6 +343,7 @@ Every deployment needs these, whichever sources it uses.
| `HOOKDECK_SIGNING_SECRET` | Yes | Verifies Event Gateway's signature on the notifications it sends the bridge |
| `BRIDGE_MCP_SECRET` | To run `serve` | The MCP endpoint's secret: sent as `Authorization: Bearer <BRIDGE_MCP_SECRET>` to `/mcp`, or in the URL (`/mcp/<BRIDGE_MCP_SECRET>`) by clients that can't send a header, such as ChatGPT. `setup` generates one, and saves it in `.env` for a local bridge |
| `BRIDGE_MCP_SECRET_URL` | No | `false` turns the URL form (`/mcp/<BRIDGE_MCP_SECRET>`) off, leaving the header; for a bridge no ChatGPT connects to. Default `true` |
| `BRIDGE_WEBHOOK_ID_FORMAT` | No | What the `webhook-id` header of each webhook delivery holds. `event-id`: the event's `eventId`, for clients that reject anything else (set it if TanStack AI, the Vercel AI SDK or OpenClaw runs under a client name of its own). `per-message`: a new id for each delivery (`msg_...`), kept across retries, as SEP-3415 requires. `auto` (the default): `per-message` for a client that declares the events extension in its requests, except TanStack AI, the Vercel AI SDK and OpenClaw by their default client names; `event-id` for every other client. `subscriptions.webhookIdFormat` in `bridge.config.ts` takes precedence. Applies to a subscription when it's made or refreshed |
| `BRIDGE_INBOUND` | No | How Event Gateway's notifications reach the bridge: `cli` (through `hookdeck listen`; also what offers callback URLs to local agents) or `http` (a public URL). Default: `http` on Fly.io, `cli` elsewhere |
| `BRIDGE_PUBLIC_URL` | For `http` inbound off Fly.io | The bridge's public URL. Default on Fly.io: `https://$FLY_APP_NAME.fly.dev` |
| `BRIDGE_PORT` | No | Listener port (default: `PORT`, else 8080) |
Expand Down Expand Up @@ -497,7 +498,8 @@ Three TypeScript MCP client libraries have experimental MCP Events support, and
| `serve` logs `warning: <name> is a pass-through callback URL` | A subscription uses a callback URL created without a secret | Expected for Hermes Agent and the client libraries; the receiver must verify every delivery |
| Subscribing with a callback URL from the bridge fails with `CallbackEndpointError` | The URL was created with a different secret from the one subscribing | Create a callback URL with the secret you subscribe with (one URL holds one secret) |
| An event takes a minute or two | `hookdeck listen` occasionally takes ~30s to connect, and Event Gateway occasionally queues a CLI delivery | Wait: the bridge retries missed deliveries itself |
| The same event twice | Two bridges in one Hookdeck project, or a retry | One Hookdeck project per bridge; receivers dedupe by `webhook-id` |
| The same event twice | Two bridges in one Hookdeck project, or a retry | One Hookdeck project per bridge; receivers dedupe by `webhook-id` (a retry keeps it), and by `eventId` for a replayed event, whose per-message `webhook-id` differs from the live delivery's |
| A client library's receiver answers `400` to every delivery | It requires `webhook-id` to equal the `eventId`, and got a per-message id: `serve` logs `<subscription id>: webhook-id per message (...)` | Set `BRIDGE_WEBHOOK_ID_FORMAT=event-id`, restart `serve`, and have the client subscribe again (or wait for its refresh) |
| `setup` or `serve` warns `<event>'s description is ... characters` | A description in `source()` or `defineSource` over 400 characters; ChatGPT has been reported to leave such events out | Shorten it, then refresh the plugin in ChatGPT |
| Claude Code (plugin) reports `{"problem": "can't reach the bridge, still retrying: no MCP URL yet ..."}` | The plugin's MCP endpoint isn't set, or was set during this session | Set it, and the secret, with `/plugin configure mcp-events-bridge@hookdeck` in Claude Code (or pipe them to `claude plugin configure mcp-events-bridge@hookdeck --values-stdin`), then start a new session |
| Claude Code (plugin) never reports events | The session isn't interactive (`claude -p`), or nothing is watched in this project | Ask "what am I watching?"; plugin monitors run only in interactive sessions |
Expand Down
Loading
Loading