Skip to main content
The StackOne MCP server implements the webhook delivery mode of the official MCP Events extension (SEP-3415): events/list, events/subscribe and events/unsubscribe. A client subscribes with a callback URL and a signing secret, and StackOne POSTs each event to that URL. ChatGPT supports this mode today. To build your own client and its callback receiver, follow this page. Turning MCP Events on, choosing which events a connection gets and revoking subscriptions are covered in MCP Events in the Gateway tab. The same mechanism carries two kinds of event:
  • Native events come from the provider’s own webhooks and arrive in real time.
  • Data Sync events come from Data Sync runs, which are scheduled, as often as every 15 minutes for actions that sync incrementally. They cover systems that send no webhooks.
Both are listed by events/list and subscribed to with events/subscribe, and both deliver the same identifiers-only payload. Events are offered when all of these hold:
  • MCP Events is on for the project.
  • The client connects with a session token, such as a token URL, through OAuth, or with a user’s personal API key. A request authenticated with a project API key gets no events.
  • The client speaks MCP over HTTP to https://api.stackone.com/mcp or https://mcp.stackone.com/mcp.
A backend that can’t act as an MCP Events client, or that calls StackOne with a project API key, receives the same native and Data Sync events through a webhook in your project. See Data Sync events for the Data Sync side.

Discover events

When events are on, the initialize result advertises them:
events/list returns the events the connection can subscribe to, 50 per page. Pass the nextCursor from one page as cursor to get the next:
For example, a Data Sync event available on two Linked Accounts:
Native events are named by the connector’s event ID. Data Sync events are named {action_id}.added, {action_id}.updated or {action_id}.removed. See What an agent can subscribe to for when each is offered. account_id is the only argument. It is optional, with a default, when the session token is bound to one Linked Account or the event is available on only one. Otherwise it is required, and the description lists the choices.

Subscribe

events/subscribe takes the event, its arguments, the callback and a lifetime:
Before saving the subscription, StackOne verifies the callback URL. See Answer the verification request. The result names the subscription and when to renew it:

Renew a subscription

A subscription is identified by the connection, the callback URL, the event name and its arguments, so calling events/subscribe again with the same four renews it rather than creating a second one. Renew before refreshBefore, or the subscription expires. A renewal’s result adds deliveryStatus, the subscription’s state before the call:
  • active is false when deliveries had failed for an hour and the subscription was switched off. The renewal switches it back on.
  • lastError is one of connection_refused, timeout, tls_error, http_4xx, http_5xx or challenge_failed.
  • A renewal with a different secret rotates it. Deliveries are signed with both the new and the old secret for 10 minutes.

Unsubscribe

events/unsubscribe takes the same name, arguments and delivery.url as the subscription. It returns an empty result whether or not the subscription existed:

Errors

Build the callback receiver

Every request StackOne sends to the callback URL is a signed JSON POST with these headers: StackOne doesn’t follow redirects, and waits 10 seconds for a response (5 seconds for a verification request).

Verify the signature

The signature follows Standard Webhooks: an HMAC-SHA256 over {webhook-id}.{webhook-timestamp}.{raw body}, keyed with the bytes of the secret after whsec_, base64-decoded. Accept the request if any signature in the header matches. Each attempt, retries included, is signed with the time it was sent. Reject a webhook-timestamp more than a few minutes from your clock, so a captured request can’t be replayed later. For example:
The Standard Webhooks libraries make both checks for you.

Answer the verification request

When a client subscribes, StackOne sends the callback URL a verification request before saving the subscription:
Return a 2xx response within 5 seconds whose JSON body echoes the challenge:
A callback URL that passes isn’t verified again for the same connection for 24 hours.

Handle events

Each event is its own request:
  • data carries identifiers only. Read the record with a tool call, such as the action named in record_type or its _s1query copy.
  • For a native event, change is the event name and record_type is the connector’s event type.
  • Return 2xx to acknowledge. A delivery that gets any other response is tried up to 5 times over about 15 minutes. A 4xx other than 408, 425 and 429 isn’t retried, and a Retry-After on a 429 or 503 is honored within that window.
  • A delivery can arrive more than once, so deduplicate on webhook-id. Events aren’t guaranteed to arrive in order.

Handle terminated

When the connection loses access to the event, StackOne sends one final message and deletes the subscription:
Stop renewing a terminated subscription. A renewal is checked like a new subscription, so it fails until access is restored.

Scope events on a session token

A session token minted with scopes receives only the events its permissions allow. Events are granted by a rule whose actions holds events alone, with the accounts named by ID:
  • events takes glob patterns or "*", matched against event names. A deny rule removes events an allow rule matched.
  • When the scope has permissions, an account with no events rule gets no events. A token with no scopes gets every event on its accounts.
  • An events rule grants no tools. A Data Sync event also needs its action, or the action’s _s1query copy, allowed by a tools rule on the same account.

Manage subscriptions from your backend

Your backend can list and revoke the project’s subscriptions with your API key: For example, to list the subscriptions on one Linked Account, with STACKONE_API_KEY set to your API key (v1.eu1.xxxxx):
A revoked subscription gets no terminated event, and the agent can subscribe again while it still has access. To stop an agent receiving events for good, remove its access to the account or the event.

Next steps

MCP

Connect to the MCP server and call tools.

Data Sync events

When Data Sync events are produced, and what removed means.

Webhooks

Receive the same events in your backend, without an MCP client.

ChatGPT

Connect ChatGPT, which supports MCP Events, to StackOne.