MCP events
Subscribe to app events from an MCP client over webhook delivery using events/list, events/subscribe, and events/unsubscribe.
Executor implements the MCP Events extension (events/list, events/subscribe, and events/unsubscribe) so an MCP client can receive push notifications whenever an app emits a declared event. Clients subscribe with a webhook callback URL and a Standard Webhooks signing secret (whsec_...), answer a one-time verification challenge, and receive signed HTTP POST deliveries for matching events.
- Available on: Local, Self-host, and Cloud (shipped in
2.0.0-beta.79). - Prerequisites: An authorized MCP connection (OAuth grant, personal access token, or local server API key) with access to an app that declares events, plus an HTTPS webhook receiver endpoint (loopback
http://is permitted only on local servers whose URL policy allows it). - Main JSON-RPC method:
events/subscribeagainst/mcp.
You’ll know it worked when your webhook receiver receives and echoes a verification challenge with HTTP 2xx, events/subscribe returns a subscription id, and emitting an app event delivers a signed JSON payload to your callback URL.
How subscriptions work
Calling events/list on /mcp returns one shared event definition named executor.app_event (title "Executor app events", delivery ["webhook"]). You can subscribe in two ways:
- Broad or filtered via
executor.app_event: Passname: "executor.app_event"with optionalarguments:{}subscribes to all events from every app your connection can access.{ app: "<app-slug>" }subscribes to all events declared by that app.{ app: "<app-slug>", event: "<event-name>", ...filters }subscribes to one event with its declared filter fields.- Delivered payloads wrap the event as
{ app, event, data }.
- Direct app event name: Pass
name: "<app-slug>.<event-name>"with optional declared filter fields inarguments(for example{ repo: "acme/widgets" }). Delivered payloads place the event’s fields directly indata.
If you use a scoped connection, enable either All events or the specific event names under that app on the Connections page; otherwise events/subscribe fails with -32012 (forbidden).
Subscribing and verifying a webhook
Cloud and Self-host
- Generate a Standard Webhooks signing secret:
whsec_followed by base64-encoded random bytes (24 to 64 raw bytes). - Expose an HTTPS callback URL (no userinfo or URL fragment; redirects are not followed) that verifies
webhook-signatureand responds to{"type":"verification","challenge":"<token>"}with HTTP200and{"challenge":"<token>"}. - Send
events/subscribetohttps://mcp.executor.sh/mcp(Cloud) or<your origin>/mcp(Self-host) withdelivery: { mode: "webhook", url, secret }and an optionalttlMs(between 60 seconds and 7 days; default 24 hours). - Renew before expiry by calling
events/subscribeagain with the same selector and delivery URL, or stop deliveries withevents/unsubscribe.
You’ll know it worked when events/subscribe returns { id, ... } and your receiver logs a verified msg_verification_<uuid> request followed by event deliveries.
Local
The same JSON-RPC flow runs against http://127.0.0.1:4312/mcp using either a local OAuth bearer token or the local server API key, and your receiver may listen on loopback http://127.0.0.1:<port>/... when the local URL policy allows it.
You’ll know it worked when triggering the emitting app tool delivers a signed POST to your local receiver with x-mcp-subscription-id matching the subscription ID.
Verifying webhook signatures
Every verification request and event delivery includes four headers:
webhook-id: Unique message ID (msg_verification_<uuid>for verification; the event ID for event deliveries).webhook-timestamp: Unix timestamp in seconds.webhook-signature: Space-separated signatures in Standard Webhooks formatv1,<base64 HMAC-SHA256(secretBytes, "${webhookId}.${webhookTimestamp}.${rawBody}")>. When rotating secrets on an existing subscription, Executor dual-signs with both the previous and new secrets for a 5-minute overlap window.x-mcp-subscription-id: The subscription ID returned byevents/subscribe.
Successful verification of a callback URL is cached for 24 hours. Before each delivery attempt, Executor rechecks that the grant, app access, event permission, and every account used by the emitting invocation are still valid.
Example
Subscribe to a single app event (<app-slug>.issue.opened) filtered by repo over streamable HTTP (adapted from Executor’s e2e event tests):
{
"jsonrpc": "2.0",
"id": 1,
"method": "events/subscribe",
"params": {
"name": "tracker.issue.opened",
"arguments": { "repo": "acme/widgets" },
"delivery": {
"mode": "webhook",
"url": "https://receiver.example.com/hook",
"secret": "whsec_<base64-encoded-32-random-bytes>"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}
Verify the signature and echo the verification challenge in Node.js:
import { createHmac } from "node:crypto";
export function verifyWebhook(secret, headers, rawBody) {
const key = Buffer.from(secret.slice("whsec_".length), "base64");
const id = headers["webhook-id"] ?? "";
const ts = headers["webhook-timestamp"] ?? "";
const expected =
"v1," + createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest("base64");
return (headers["webhook-signature"] ?? "").split(" ").includes(expected);
}
When JSON.parse(rawBody).type === "verification", respond with HTTP 200 and { "challenge": message.challenge }. Event deliveries send JSON shaped as:
{
"eventId": "019...",
"name": "tracker.issue.opened",
"timestamp": "2026-11-26T12:00:00.000Z",
"data": { "title": "Issue 1", "number": 1 },
"cursor": null
}
Unsubscribe with the same name, arguments, and delivery (mode and url):
{
"jsonrpc": "2.0",
"id": 2,
"method": "events/unsubscribe",
"params": {
"name": "tracker.issue.opened",
"arguments": { "repo": "acme/widgets" },
"delivery": { "mode": "webhook", "url": "https://receiver.example.com/hook" }
}
}
Limits
| Limit | Value |
|---|---|
| Delivery mode | webhook only (no cursor replay; requesting another mode or cursor returns -32014) |
| Signing secret | whsec_ prefix + base64 of 24–64 bytes |
| Subscription TTL | Default 24 hours; minimum 60 seconds; maximum 7 days (ttlMs: null grants 7 days) |
| Delivery retries | Up to 14 attempts (5 s exponential backoff capped at 1 hour, ~4.5 hours total) |
| Per-attempt timeout | 10 seconds |
| Event retention | 3 days |
| Payload size | 250 KiB max emitted payload; 256 KiB max delivery body; 100 emits per invocation |
| Permanent stop codes | HTTP 410 or 413 from the receiver stops retries for that delivery |
Error codes returned by events/*:
-32602: Invalid parameters (bad secret format, invalid URL, out-of-range TTL, or filter mismatch).-32011: App or event not found.-32012: Connection is not authorized for that app or event.-32014: Unsupported delivery mode, cursor replay requested, or app event schema changed.-32015: Callback verification failed (data.reasondescribes why).