One webhook, two specs: MCP events in my feedback tool
Hauke Jung··6 min readOn this page (6 sections)
An MCP server answers when it is asked. That is fine for “list the open bugs”, and useless for “tell me when a new bug comes in”. Until now an agent could only poll, and agents are bad at polling. They forget, or they ask every turn and burn context on “nothing new”.
MCP events fix that. A client subscribes to an event once, hands the server a webhook URL, and the server posts to it when something happens. SeggWat, my feedback tool, now emits one: feedback.created. In a ChatGPT chat with the SeggWat plugin connected you can say:
Watch SeggWat Demo. Whenever new feedback arrives, post a one-line summary in this chat.
and the next piece of feedback shows up in the chat on its own. It is my product, so calibrate for bias. The interesting part is not the feature, it is that I built it twice in two days.
Two dialects of one idea
I built the first version against OpenAI’s events profile, because ChatGPT was the client I could test with. It worked. The next morning I read the official extension, io.modelcontextprotocol/events (SEP-3415), and counted about eight differences.
Most were bugs on my side. A few were places where the two documents disagree:
- Where the capability lives. OpenAI reads
capabilities.events. The spec readscapabilities.extensions["io.modelcontextprotocol/events"]. A client following one never sees the other. - The
webhook-idheader. OpenAI wants it equal to the body’seventId. The spec wants it header-safe and unique per subscription, and my first ids werefeedback.created:<id>, which has a colon and a dot in it. - The error for a failed callback check. OpenAI says
-32015. The spec says-32027.
It turned out you can satisfy both almost everywhere. SeggWat now advertises both spellings. The event id is msg_ plus 32 hex characters of a hash over subscription and feedback, so it is header-safe, unique per subscription, stable across retries, and still equal to eventId. Error codes OpenAI does not specify use the spec’s (Forbidden, NotFound, Unsupported).
The one real conflict is the callback error code, because a JSON-RPC error has exactly one. That is decided per client: if the client declares the extension in its capabilities it gets -32027, everyone else gets -32015. I checked the logs before picking. No client, ChatGPT included, declares the extension yet, so ChatGPT keeps the code its docs promise.
What a subscription looks like
The catalog has one event. Its input is a project_id, its payload is two ids:
No message, no email, no screenshot. The webhook goes to a URL the client picked, and I would rather the agent fetch the feedback through the normal tools, with the normal permission checks, than spray customer text at a callback.
Subscribing does a few things before anything is stored:
- The URL must be HTTPS and resolve to a public address. Private, loopback, link-local and the special-purpose ranges are rejected, and the address is pinned for the request so DNS cannot change its mind between check and send.
- The server posts a signed
verificationwith a random challenge, and the callback has to echo it back. That check is cached per client and URL while one of its subscriptions is live, so watching a second project does not verify again. - The subscription id is a hash of the client’s key, the event, the project and the URL. Subscribing again with the same arguments is a refresh, not a duplicate. Subscriptions last at most a day, so a client that disappears stops receiving events within 24 hours.
A refresh also returns deliveryStatus: when the last delivery succeeded and what the last error was. ChatGPT had been showing “delivery status unknown, no recorded result” for a subscription that was in fact delivering. I added the field partly to see if that was why.
Delivery
New feedback is a row in Postgres, so the fan-out is a trigger. In the same transaction as the insert it writes one row per live subscriber into the outbox SeggWat already uses for notifications. If the feedback commits, the deliveries exist. If it rolls back, they never did. A relay turns outbox rows into jobs, and four workers post them.
Every attempt checks the grant again: the key not revoked or expired, still scoped to the project, its creator still in the organization, the plan still active. Each delivery is signed with Standard Webhooks. When a client rotates its secret, the old one stays valid for five minutes and the signature header carries both, so a retry in flight still verifies.
Two things changed after reading the spec:
- 410 used to delete the subscription. It now drops that one delivery and leaves the subscription alone. Deleting on 410 felt tidy. It is not what the spec says.
- Revoked access used to fail quietly until the subscription expired. Now it ends the subscription on the next event. A client that declared the extension gets a signed
terminatedenvelope. ChatGPT’s profile has no such envelope, so it learns fromForbiddenon its next refresh.
The Rust side
rmcp, the Rust MCP SDK I use, has no field for OpenAI’s top-level events capability. So a small axum middleware patches the initialize and server/discover responses on the way out, including the SSE-framed ones. The events/* methods go through rmcp’s custom request hook, so rmcp still validates and negotiates every request. It is the only place in the server that rewrites a protocol message, and it has a test that runs both handshakes over HTTP.
One gap I found and left: the spec says clients must send an Mcp-Name header on events/subscribe, and rmcp sets it only for tools, prompts and resources. SeggWat does not require the header, so nothing breaks.
Events are a contract too
An event has an input schema and a payload schema, like a tool. Remove a payload field and every agent that reads it breaks, the same way it would if a tool lost a parameter.
So while I was at it, mcpi, my MCP directory and change tracker, learned to snapshot events/list next to tools and diff it. A removed event, a dropped delivery mode, tighter subscription arguments or a dropped payload field count as breaking. A new event counts as compatible. Listings now show an Events section when the snapshot has one.
Try it
Connect the SeggWat plugin in ChatGPT, or any client that speaks the events extension, and ask it to watch a project. The setup is in the MCP guide. I wrote earlier about why SeggWat has an MCP server at all. Events are the first part of it that does not wait to be asked. If you build an events client and something does not line up with the spec, tell me. Two documents disagreeing is exactly where I expect the next bug.
