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
19 changes: 12 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@

## Unreleased

Breaking, for code that reads `list_sources`' `events` as a list of names: each entry is now an event type object; read `events[].name`.

### Breaking

- **`list_sources` lists each source's event types as `events/list` does:** each entry in a source's `events` is now an event type, with its `name`, `description` and `inputSchema` (the arguments it takes), instead of only its name. Clients without MCP Events support (Claude Code without the plugin, Codex, Cursor) can't call `events/list`, so until now they had only the names and had to guess the arguments. Breaking for code that reads `events` as names: read `events[].name`. `subscriptions` still counts each source's webhook subscriptions ([#99](https://github.com/hookdeck/mcp-events-bridge/pull/99)).

### Changed

- **`setup` saves a generated MCP secret in `.env`** for a local bridge, instead of printing a line to copy. An agent running setup no longer has to handle the secret. A deployed bridge, or one with no `.env`, still prints the line.
- **The setup skill, after a cold test** (an agent with no context, asked to "set up the MCP Events bridge"): it defaults to a local bridge; creates the bridge in a folder of its own; asks which services and repositories before writing the config, with a GitHub example; has the user put credentials in `.env` rather than the chat, in a new Hookdeck project; treats event content as untrusted; runs `serve` in the background with a log; connects Claude Code without showing the secret, and recommends the plugin for events between prompts; and checks the bridge with `watch` before connecting an agent.
- **The `watch` skill without the plugin:** `npx skills add hookdeck/mcp-events-bridge` also installs the plugin's `watch` skill, and without the plugin its `events-bridge` commands fail with `command not found`. The skill now tells the agent to stop and explain how to install the plugin, or what to use outside Claude Code. To install only the setup skill, add `--skill mcp-events-bridge`.
- **`list_sources` lists each event's filters:** a new `filters` field maps each event name to the arguments it takes, each with its type and description, from the event's inputSchema. Clients with tools only (Claude Code without the plugin, Codex, Cursor) can't call `events/list`, so they had no way to find the filters, and guessed. `events` is still a list of names. The descriptions of `list_sources`, and of `poll_events` and `wait_for_event`'s `name` and `arguments`, point there instead of at `events/list`, and so do `get_event` and `list_events`' unknown-name errors.
- **`setup` saves a generated MCP secret in `.env`** for a local bridge, instead of printing a line to copy. An agent running setup no longer has to handle the secret. A deployed bridge, or one with no `.env`, still prints the line ([#101](https://github.com/hookdeck/mcp-events-bridge/pull/101)).
- **The setup skill, after a cold test** (an agent with no context, asked to "set up the MCP Events bridge"): it defaults to a local bridge; creates the bridge in a folder of its own; asks which services and repositories before writing the config, with a GitHub example; has the user put credentials in `.env` rather than the chat, in a new Hookdeck project; treats event content as untrusted; runs `serve` in the background with a log; connects Claude Code without showing the secret, and recommends the plugin for events between prompts; and checks the bridge with `watch` before connecting an agent ([#101](https://github.com/hookdeck/mcp-events-bridge/pull/101)).
- **The `watch` skill without the plugin:** `npx skills add hookdeck/mcp-events-bridge` also installs the plugin's `watch` skill, and without the plugin its `events-bridge` commands fail with `command not found`. The skill now tells the agent to stop and explain how to install the plugin, or what to use outside Claude Code. To install only the setup skill, add `--skill mcp-events-bridge` ([#95](https://github.com/hookdeck/mcp-events-bridge/pull/95)).
- **Docs:** Codex (codex-cli 0.154.0, `codex exec`) and Cursor's CLI (`cursor-agent` 2026.11.05-86047df) are listed as tested clients in the README, and a new guide, [`poll-clients.md`](skills/mcp-events-bridge/references/poll-clients.md), sets each up to poll the bridge, with the approvals each needs to call the bridge's tools unattended: Codex's `default_tools_approval_mode = "approve"`, and Cursor's `--trust`, `--approve-mcps` and a tool allowlist in `.cursor/cli.json`. The skill points to it ([#94](https://github.com/hookdeck/mcp-events-bridge/pull/94)).

### Fixed

- **Arguments that don't match an event's inputSchema say what's wrong:** `poll_events` and `wait_for_event` returned only "arguments do not match the inputSchema", dropping the protocol error's `data.detail`, so an agent couldn't tell which argument was wrong (seen on 5 Nov: Claude Code passed `action` for `github.issues`, whose filter is `actions`, a list, then dropped the filter). The tool error now includes the detail, which names the unknown or wrong argument and lists the event's arguments: `arguments do not match the inputSchema: unknown argument "action". github.issues takes repository (string), actions (string[]), sender (string)`. `events/poll` and `events/subscribe` return the same `data.detail`, which was the validator's raw JSON, and `watch` and `watches add` print it. Unknown arguments were already refused, not ignored.
- **Poll tools on a bridge with no subscriptions:** `wait_for_event`, `poll_events`, `events/poll`, `watch`, `get_event` and `list_events` returned no events until something subscribed. A source has a connection only per subscription, and Event Gateway rejects requests to a source with no connection as `NO_CONNECTION` (the sender still gets `200`, and the request is kept); the bridge listed only accepted requests. It now also reads verified requests rejected as `NO_CONNECTION`. Broken since 0.8.0.
- **`setup` registers again a webhook deleted at the service:** on a re-run with nothing changed, it reported `webhook existing` for a Resend or GitHub source whose webhook had been deleted at the service, so no events arrived. It now checks the saved webhook (Resend's webhook by its id; GitHub's in each repository, or the organization, by the source URL) and, if it's missing, logs `the <service> webhook saved on bridge-<id> is missing at <service>; registering it again` and reports `registered`. If it can't check (a key or token that can't read webhooks, or the service didn't answer), it keeps the saved webhook, reports `existing`, and logs a warning. Sources defined with `defineSource` can opt in with an optional `webhookExists`.
- **Poll delivery without a webhook subscription:** `events/poll`, the poll tools (`poll_events`, `wait_for_event`), `watch`, `get_event` and `list_events` returned no events unless a client also had a webhook subscription (`events/subscribe`) to the same source, so a bridge used only through poll delivery or the poll tools, such as a new setup with Claude Code, Codex or Cursor, got nothing. A poll subscription needs no subscribe step: each `events/poll` request carries its event type name, arguments and cursor, and the bridge reads events from the requests Hookdeck Event Gateway keeps for the service's source. Until the source has a webhook subscription, the Event Gateway dashboard shows those requests as rejected with `NO_CONNECTION`; that's expected, and the service still gets `200`. Broken since 0.8.0 ([#98](https://github.com/hookdeck/mcp-events-bridge/pull/98)).
- **Arguments that don't match an event type's `inputSchema` say what's wrong:** the poll tools returned only "arguments do not match the inputSchema", dropping the protocol error's `data.detail`, so an agent couldn't tell which argument was wrong (seen on 5 Nov: Claude Code passed `action` for `github.issues`, whose argument is `actions`, a list, then dropped the arguments). The tool error now includes the detail, which names the unknown or wrong argument and lists the event type's arguments: `arguments do not match the inputSchema: unknown argument "action". github.issues takes repository (string), actions (string[]), sender (string)`. `events/poll` and `events/subscribe` return the same `data.detail`, which was the validator's raw JSON, and `watch` and `watches add` print it. Unknown arguments were already refused, not ignored ([#99](https://github.com/hookdeck/mcp-events-bridge/pull/99)).
- **`setup` registers again a webhook deleted at the service:** on a re-run with nothing changed, it reported `webhook existing` for a Resend or GitHub source whose webhook had been deleted at the service, so no events arrived. It now checks the saved webhook (Resend's webhook by its id; GitHub's in each repository, or the organization, by the source URL) and, if it's missing, logs `the <service> webhook saved on bridge-<id> is missing at <service>; registering it again` and reports `registered`. If it can't check (a key or token that can't read webhooks, or the service didn't answer), it keeps the saved webhook, reports `existing`, and logs a warning. Sources defined with `defineSource` can opt in with an optional `webhookExists` ([#100](https://github.com/hookdeck/mcp-events-bridge/pull/100)).

## 0.9.0 (2026-11-05)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ Each `source()`'s credentials, named as its `env()` references name them. `sourc
- `events/list`, `events/subscribe`, `events/unsubscribe`, with webhook delivery, and `events/poll`, for poll delivery. Event names are `{id}.{event}` (see [Sources](#sources)).
- `poll_events(name, arguments?, cursor?, maxAgeMs?, maxEvents?)` and `wait_for_event(name, arguments?, cursor?, timeoutMs?)`: the same polling as tools, for MCP clients without MCP Events support (see [Polling](#polling)).
- `get_event(name, eventId)` and `list_events(name?, since?, limit?)`: events that happened, read from Event Gateway (`events/list` is the catalog of events you can subscribe to). `get_event` takes the event's name as well as its id, since an id is the service's own and two sources can share one.
- `list_sources()`: configured sources, their types and events, the filters each event takes (`filters`, by event name: each argument's type and description, from the event's inputSchema, for clients that can't call `events/list`), and their subscriptions.
- `list_sources()`: configured sources, each with its type, its event types (`events`: each one's `name`, `description` and `inputSchema`, the arguments it takes, as `events/list` describes them, for clients that can't call `events/list`), and its webhook subscriptions (`subscriptions`; poll subscriptions are held by the client, so they aren't counted).
- `create_callback_url(agent, name, port?, path?, secret?)` and `list_callback_urls(agent)`: public callback URLs for agents on the same machine as a local bridge (see [Local agents](#local-agents)). Calling again with the same `agent`, `name` and secret returns the existing URL; a different secret, port or path for that name is an error. Not offered by a deployed bridge.
- Every tool is annotated `readOnlyHint: true` except `create_callback_url`, which is `idempotentHint: true` and `destructiveHint: false`. `list_sources` and `list_callback_urls` are also `openWorldHint: false`: they answer from the bridge's own state.

Expand Down
6 changes: 4 additions & 2 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ Built 27 Oct ([#50](https://github.com/hookdeck/mcp-events-bridge/issues/50)) in

### Poll mode

**Subscriptions in each delivery mode** (SEP-3415's terms). A **poll subscription** needs no subscribe step: the first `events/poll` with a `null` cursor starts it, each poll carries its event type name, arguments and cursor, and the client holds it. The bridge keeps nothing for it and creates nothing in Event Gateway. The poll tools (`poll_events`, `wait_for_event`) give clients without MCP Events support the same thing as tools. A **webhook subscription** is made with `events/subscribe` and has a callback URL; the bridge holds it as a connection on the service's source, and that connection is what makes Event Gateway accept the source's requests rather than reject them as `NO_CONNECTION`. `list_sources` counts webhook subscriptions only. In this bridge every argument narrows the events a subscription gets; the config's `filters` (for `source()`) and the CLI's `--filter` are the bridge's own names for them.

Designed 8 Oct ([#26](https://github.com/hookdeck/mcp-events-bridge/issues/26)) from the spike in `SPIKES.md` ("Poll mode: Event Gateway's request listing"), and revised after a review. Built (8 Oct): `src/core/poll.ts`; see `SPIKES.md` ("Poll mode: acceptance") for the runs with real clients.

**A proxy to Event Gateway.** Polls are answered from Event Gateway's request listing, with no event store in the bridge: the cursor holds the position. Event Gateway is the store, as it is for `get_event`, `list_events` and replay, and a poll works whether or not any connection took the request. Events reach a poller about 2 seconds after Event Gateway receives them (up to 15 measured).
Expand All @@ -357,7 +359,7 @@ Designed 8 Oct ([#26](https://github.com/hookdeck/mcp-events-bridge/issues/26))
- **Catch-up:** a poll whose watermark is older than the window (after a gap, or draining a backlog) lists its own source from its watermark, at most two pages, and returns `hasMore` if there's more. Its rate limit feeds the back-off, and there's no catch-up while backing off.
- **Back-off:** the bridge tracks `X-RateLimit-Remaining`. Below a quarter of the limit, the window's refresh interval and `nextPollMs` grow, up to 30 seconds, and come back to 2 seconds as it recovers; a backlog then drains at that pace, not at once. A `429` (on the window or a catch-up) doesn't fail a poll: it's answered from the existing window if that covers the source, or else with no events, the same cursor and `nextPollMs` of 30 seconds. After a failed call, the bridge makes no listing calls for 30 seconds (2 after other errors).

**Which requests are events,** whatever Event Gateway did with each (since 0.8.0; until then poll matched what the relay would have delivered, from each request's events and ignored events on the inbound connection). A request is a candidate if it's verified and either accepted or rejected as `NO_CONNECTION` (`isEventRequest`): a source has a connection only per subscription, so until something subscribes, Event Gateway rejects every request as `NO_CONNECTION`, while still answering the sender `200` and keeping the request, verified, with its data. In 0.8.0 to 0.9.0 the listing asked for `status=accepted`, so poll, `get_event` and `list_events` saw nothing on a bridge with no subscriptions. `VERIFICATION_FAILED` and any other rejection are dropped. Then each request is mapped by the source's runtime (as for `get_event`, and as the transformation does), and kept if the event's name matches and its `data` matches the event's `filter(args)` (`matchesFilter`, the same filter as the subscription connection's). A request without `data` that's newer than L is held: it isn't returned, and the watermark doesn't pass it. Repeats are dropped by `eventId`, so a sender's retry with the same id is returned once while the cursor still holds the first's id. An event's `timestamp` is the source's, or else the request's `created_at`.
**Which requests are events,** whatever Event Gateway did with each (since 0.8.0; until then poll matched what the relay would have delivered, from each request's events and ignored events on the inbound connection). A request is a candidate if it's verified and either accepted or rejected as `NO_CONNECTION` (`isEventRequest`): a source has a connection only per webhook subscription, so until a client makes one, Event Gateway rejects every request as `NO_CONNECTION`, while still answering the sender `200` and keeping the request, verified, with its data. In 0.8.0 to 0.9.0 the listing asked for `status=accepted`, so poll, `get_event` and `list_events` saw nothing on a bridge with no webhook subscriptions. `VERIFICATION_FAILED` and any other rejection are dropped. Then each request is mapped by the source's runtime (as for `get_event`, and as the transformation does), and kept if the event's name matches and its `data` matches the event's `filter(args)` (`matchesFilter`, the same filter as the subscription connection's). A request without `data` that's newer than L is held: it isn't returned, and the watermark doesn't pass it. Repeats are dropped by `eventId`, so a sender's retry with the same id is returned once while the cursor still holds the first's id. An event's `timestamp` is the source's, or else the request's `created_at`.

**The cursor, and late requests.** A request appears in the listing about 2 seconds after its `created_at` (up to 15), and out of order: in the spike, a quarter appeared after one with a later `created_at` was already listed. A cursor at the newest request seen would skip them, so the cursor re-reads a window:

Expand Down Expand Up @@ -710,7 +712,7 @@ Handlers registered by hand:

Tools:

- `list_sources()`: configured sources, their types and events, each event's filters (`filters`: by event name, each argument's type and description from the event's inputSchema, for clients with tools only, which can't call `events/list`), and how many subscriptions each has. (`list_providers()`, the pre-0.6.0 name, was removed in 0.8.0.)
- `list_sources()`: configured sources, each with its type, its event types (`events`: each one's `name`, `description` and `inputSchema`, as `events/list` gives them, for clients with tools only, which can't call `events/list`), and how many webhook subscriptions it has (poll subscriptions are held by the client, so the bridge can't count them). (`list_providers()`, the pre-0.6.0 name, was removed in 0.8.0.)
- `create_callback_url(agent, name, port?, path?, secret?)` and `list_callback_urls(agent)`: callback URLs for local agents, on a bridge with CLI inbound (see "Callback URLs from the bridge"). Results include the name, URL, port, path and `passThrough`, never a secret. (`create_tunnel_url` and `list_tunnel_urls` until 0.8.0.)
- `get_event(name, eventId)` and `list_events(name?, since?, limit?)`: events that happened, read from Event Gateway (not the catalog of event kinds, which is `events/list`). These also work around openai/codex#50714, where dot runs don't receive event data.
- Poll mode ("Poll mode", [#26](https://github.com/hookdeck/mcp-events-bridge/issues/26)): `events/poll` (`name`, `arguments`, `cursor`, `maxAgeMs`, `maxEvents`), read from Event Gateway's stored requests on the source; the cursor is a position in that history. `events/list` offers `"poll"` in each event's `delivery`. For hosts that don't support MCP Events, the same implementation as the `poll_events` and `wait_for_event` tools.
Expand Down
Loading
Loading