27 min read

MCP Events: Stop Making Your Agent Do the Polling

MCP Events moves the poll loop out of the model and into the client SDK, so the LLM wakes only when events[] has something in it. Still Beta.

Daniel San posted "MCP Events is here" this week, and I spent the evening reading the spec behind it instead of the replies.

MCP Events is a Beta extension to the Model Context Protocol that lets a client subscribe to things that happen in an upstream system, such as a new email or a PagerDuty incident, and have an agent react without anyone asking. It matters because agents otherwise learn about the world by polling through tool calls. It differs from the notifications MCP already has because events carry subscription arguments, payload schemas, cursors and three delivery modes.

Plenty of agent loops poll. The agent calls a tool, checks the inbox, finds nothing, sleeps for thirty seconds, and calls the tool again. It works fine in a demo. The polling loop I know best is a bash script I ran in September, which re-polled parallel research runs for up to six attempts of 540 seconds each, and no model was in that loop at all.

If you would rather see the protocol move than read about it, there is a small playground on this site: Watch it run in the MCP Events Explorer.

The short version of my argument is this. Your agent should not be the one polling. In MCP Events the client SDK runs the poll loop, the loop is a protocol call and not an LLM tool call, and the model only gets invoked when there is an event to look at. That one design choice changes what an always-on agent costs, and it also creates a new place where untrusted text can reach your model. Both halves deserve attention.

Illustrative arithmetic, not a measured polling benchmark. A comparison of two ways to watch an upstream system for one hour. Agent-loop polling wakes the model 120 times and spends about 7.9 million input tokens even when nothing happens, while runtime polling by the client SDK wakes the model once, assuming one event arrives.
Illustrative arithmetic, not a measured polling benchmark. A comparison of two ways to watch an upstream system for one hour. Agent-loop polling wakes the model 120 times and spends about 7.9 million input tokens even when nothing happens, while runtime polling by the client SDK wakes the model once, assuming one event arrives.

Table of Contents#

  1. What is MCP Events, and how mature is it?
  2. Why should the client SDK run the poll loop instead of the agent?
  3. How do the three delivery modes work, and why does the spec ship all three?
  4. Does polling not scale?
  5. What delivery guarantees does MCP Events actually give you?
  6. How do you stop an event payload from becoming a prompt injection?
  7. What should an enterprise add on top of the spec?
  8. What is still open, and how does this relate to async subagents?
  9. FAQ

What is MCP Events, and how mature is it?#

It is a young extension with a finished design document and a short list of real implementations.

The extension identifier is io.modelcontextprotocol/events. It is defined by SEP-3415, an Extensions Track proposal, and it is owned by the Tasks and Events Working Group. It applies to protocol revision 2026-07-28 and later, because it leans on per-request client capabilities, server/discover and subscriptions/listen, which earlier revisions do not have. The specification itself lives in the ext-events repository, and the published spec page labels the stage as Beta. The repository itself describes the work as Experimental. I would read that as a warning to prototype with it and not to build a product on the exact wire format yet.

A server advertises support in the capabilities it returns from server/discover. The settings object has one member, listChanged, which says whether the server will send notifications/events/list_changed. After that, the client calls events/list and gets back event types. Each one has a name, a description, a delivery array, an inputSchema for subscription arguments and a payloadSchema for the data it will deliver. The spec examples are email.received, which supports only poll, and incident.created, which supports webhook, push and poll.

When something happens, the client receives an event occurrence with five fields: eventId, name, timestamp, data and cursor. The cursor is optional and server defined. A server that has no replay history can return null for it, and the client then starts from now every time.

As for where the code is, the SEP says the TypeScript SDK implementation, covering server and client with all three delivery modes, was in review at the time of writing. A Python server implementation exists as a third-party package. Conformance suites were open for review. So the design is further along than the tooling. If you need to ship something this quarter, plan for the SDK surface to move.

Why do the existing MCP notifications not cover this?#

The SEP is direct about it, and I think the argument holds up. MCP already has notifications/resources/updated and the list_changed family. According to the SEP, they fail on three counts.

  • They carry no parameters. "A P1 incident was created for service X" cannot be expressed, because there are no subscription arguments, no payload schema and no payload.
  • They need a live connection. They arrive only on an open subscriptions/listen stream, so a client that is not connected gets nothing.
  • They cannot be resumed. There is no cursor, so whatever happens during a disconnect is lost and the client cannot tell it missed anything.

Events fixes all three. The price is a new family of methods, events/list, events/poll, events/stream, events/subscribe and events/unsubscribe, which is a real amount of surface area.

Why should the client SDK run the poll loop instead of the agent?#

Because every poll that finds nothing costs you a full model invocation when the agent does it, and costs you almost nothing when the SDK does it.

Here is the line from the spec that carries the whole idea. In poll mode, the client SDK calls events/poll at the interval the server recommends, and the spec states that this is a protocol-level operation, not an LLM tool call. The sequence diagram in the spec ends with a note that the LLM is invoked only when events[] is non-empty. A separate line says the same thing about the whole extension: the client SDK chooses the mode and runs the loop, and the model sees only the events that arrive.

How does event polling work in MCP Events? The client SDK, not the model, runs it as a protocol loop. Each events/poll request carries one subscription: the event name, its arguments and a cursor, where null means start from now. The response returns events, a new cursor, truncated, hasMore and nextPollMs. When hasMore is true, the SDK polls again at once to drain a backlog. When it is false, the SDK waits nextPollMs before the next request. Clients should apply a floor, with a default of 1000 milliseconds, so a misbehaving server cannot cause a tight loop. An empty events array means nothing happened, and the spec calls that the common case, one that should be cheap to serve and cheap to process. The server may also adjust nextPollMs as it sees activity, for example to back off when it is rate limited upstream. The model is invoked only when the array has something in it.

What does the agent-loop version cost?#

I will use my own number for this, and I will be clear about what it is.

Over 30 days of my own agent sessions I measured a median of 65,780 tokens sitting in context before the first prompt. That came from 182 transcripts and 8,099 API calls, and 96.2 percent of the input tokens were cache reads. It is one heavy setup with a lot of tools, rules and skills loaded. It is not a benchmark and it will not match yours.

Now take an agent loop that checks an upstream every 30 seconds with a tool call, for one hour. That is 120 wake-ups. Multiply 120 by 65,780 and you get 7,893,600, so about 7.9 million input tokens, mostly cache reads, for an hour in which nothing may have happened. Every wake-up also adds the tool call and its result to the context, so the real figure drifts upward over the hour. Treat 7.9 million as an illustrative estimate that assumes the context stays the same size on every wake-up.

This is arithmetic on a measured number. I did not run a polling test. I want to be plain about that, because it is easy to take a clean multiplication and present it as a measurement.

Check intervalWake-ups per hourEstimated input tokens per hour at 65,780 per wake-upModel wake-ups with SDK polling
Every 30 seconds1207,893,6000 until an event arrives
Every 60 seconds603,946,8000 until an event arrives
Every 5 minutes12789,3600 until an event arrives

The slower you poll, the cheaper it gets, and the later you hear about things. The SDK-level loop removes that trade for the model side of the bill. The poll still happens, and it still costs a network request, but a network request against a server is cheap in a way that a model invocation is not.

How can you verify this on your own setup?#

Do not trust my 65,780. Measure yours. Take your own transcripts or your provider usage data for a week and find the input token count of the first model call in each session. Take the median. Then multiply by the number of wake-ups your loop would produce in the window you care about. To see the loop itself, run an agent for one hour with a no-op check tool on a timer and read the usage fields it reports. Then compare against a script that polls a mock events/poll endpoint and only calls the model when events is non-empty. If the two numbers are not wildly different, my argument is weaker than I think, and I would want to know.

How do the three delivery modes work, and why does the spec ship all three?#

Poll, push and webhook exist because the places an agent can run are different enough that no single mechanism works for all of them.

A comparison of the three MCP Events delivery modes. In poll, the client SDK calls events/poll with a cursor and the server holds no required state. In push, one long-lived events/stream request per subscription lives as long as the connection. In webhook, the server posts signed events to an https callback under a TTL that the client refreshes.
A comparison of the three MCP Events delivery modes. In poll, the client SDK calls events/poll with a cursor and the server holds no required state. In push, one long-lived events/stream request per subscription lives as long as the connection. In webhook, the server posts signed events to an https callback under a TTL that the client refreshes.

ModeMethodWho holds stateFitsCost of choosing it
Pollevents/pollThe client holds the cursor. The server holds no protocol-required state.Serverless servers, clients behind NATLatency is bounded by the polling interval
Pushevents/streamThe server holds a connection for the life of each request.stdio servers, local agents, HTTP clients that can hold a streamOne held connection per subscription
Webhookevents/subscribeThe server holds subscription state under a TTL. The client refreshes it.Remote servers where a held connection is impracticalThe server needs outbound HTTP, and the client or a proxy needs a reachable endpoint

A server advertises any non-empty subset of these per event type, and no mode is mandatory. A client that cannot use any of the modes an event type lists cannot subscribe to it.

Poll is the floor. There is no separate subscribe step, because the first poll with a null cursor starts the subscription. Push opens a long-lived events/stream request per subscription. The server confirms with notifications/events/active, then delivers notifications/events/event as things happen, and sends heartbeats so the client can tell a quiet stream from a dead one. Closing the HTTP request, or sending notifications/cancelled on stdio, ends it.

Webhook needs the most ceremony. The client calls events/subscribe with a callback URL, a client-generated secret and a suggested ttlMs. The server answers with an id, a refreshBefore timestamp that is the authoritative grant, and a safe-to-persist cursor. For a finite grant, the client must call events/subscribe again before refreshBefore or the subscription lapses. A refreshBefore of null means the subscription has no expiry. Before it delivers anything, the server must confirm the endpoint actually wants the traffic, with a verification handshake or one of the other routes the spec allows. Each delivery is signed under the Standard Webhooks scheme with an HMAC, and the receiver should reject any delivery whose webhook-timestamp is more than 5 minutes old. The callback URL must be https.

The Rationale section of the SEP gives the reason for shipping three, and I find it convincing. A serverless server cannot push, because it cannot hold a connection per subscriber. A client behind NAT cannot receive webhooks, because it has no public endpoint. A battery or cost sensitive client should not poll. The SEP says the alternative was to define one mode and let proxies fake the rest, and it rejected that because it forces an always-on trusted intermediary into every deployment that does not fit the chosen mode. The authors admit the cost is roughly three times the specification and SDK surface.

That is a fair trade for a protocol and a slightly annoying one for an implementer. If you write a server, start with poll. It is the only mode that works everywhere. If you write a client SDK, you will eventually need all three, and the interesting part is the policy for choosing between them. The spec leaves that to the SDK.

You can watch each mode run, with cursors and TTL refreshes moving, in the MCP Events Explorer.

Does polling not scale?#

It scales fine where the cost sits, and the spec puts the cost in the cheap place.

The objection I hear is that polling is a bad pattern in general, so a protocol built partly on it is a step backward. I think that mixes up two separate costs. One is the cost of the poll request. The other is the cost of the thing that makes the request. In an agent loop, the thing making the request is a language model carrying a large context. In MCP Events it is a small piece of SDK code.

There are specific design choices in the spec that keep poll cheap.

  • The server holds no protocol-required state per client. Each request is self-contained, because the client supplies the name, arguments and cursor every time.
  • nextPollMs lets the server slow clients down when it is rate limited upstream and speed them up when it sees activity.
  • maxEvents and hasMore let a client drain a backlog in batches and not in one huge response.
  • A configurable client floor, 1000 milliseconds by default, stops a misbehaving server from creating a tight loop.

There are real limits. Latency is bounded by the interval. Each subscription gets its own poll loop and its own request, and the SEP says clients with many subscriptions on HTTP/1.1 should expect to coalesce at the transport layer. Push holds a connection per subscription, and the SEP says server SDKs must exempt events/stream from any general cap on concurrent requests. The SEP also lists one known gap: a client that reconnects in push mode with a stale cursor may receive a large backlog burst with no bound like the one maxEvents gives poll.

The spec also makes a point about flow control that I had not thought about. It has no protocol-level backpressure, and the reasoning is that the dominant bottleneck in an MCP event pipeline is LLM inference. Processing one event can take seconds to minutes of model time. Next to that, upstream event rates are small. The system is bound by the consumer, not the producer.

So the honest answer is that polling does not scale to very high event rates, and the spec says so by declaring multimedia and high-throughput streams out of scope. For the use cases it targets, such as new emails, alerts and messages, polling is the right floor. What does not scale is a language model doing the polling.

What delivery guarantees does MCP Events actually give you?#

Fewer than you may expect, and the spec states the limits openly.

What delivery guarantees does MCP Events give an agent? Exactly-once delivery is not one of them. The extension provides no protocol-level guarantee of exactly-once delivery, no ordering across subscriptions, and no transactional consistency. Within one subscription, poll and push deliver events in the order the server produces them, while webhook delivery is best effort because each event is retried independently and retries can arrive out of order. Delivery is at-least-once in all three modes when the event type is backed by a durable upstream and the client replays from its last known cursor after a restart. Event types that only emit, with no history behind them, are at-most-once across server restarts, because the in-memory buffer is lost. To get effectively once behaviour, the client deduplicates by eventId, and the dedupe is scoped to a subscription, so the same eventId on two subscriptions is two deliveries and not a duplicate.

PropertyWhat the spec saysWhat your agent should do
DuplicatesPossible. eventId is stable for the upstream event, within a subscription.Deduplicate by eventId, keyed per subscription.
OrderingIn server order per subscription for poll and push. Best effort for webhook. None across subscriptions.Use timestamp when order matters, and design for out-of-order arrival.
Gapstruncated: true means delivery started later than the cursor supplied, so events were skipped.Treat it as a possible gap and re-read authoritative state.
ReplayOptional per event type. A server may return cursor: null.Branch once at subscribe time on whether replay exists.

The last sentence of that section of the SEP is the one worth pinning above your desk. Agents that need stronger guarantees should use tools to read authoritative state, and should not rely only on event payloads. Think of an event as a doorbell. It tells you to go and look. It is a bad idea to treat it as a ledger.

That matches how I would design it anyway. If an incident.created event arrives, the agent should fetch the incident through a tool before it acts, so that a duplicate, a stale event or a gap cannot make it act on something that is no longer true. It costs one extra call per event, and the benefit is that your correctness no longer depends on the event pipe.

How do you stop an event payload from becoming a prompt injection?#

You treat it as untrusted data from the first byte, and you give it no authority.

This is the part of the spec I would have the most arguments about in an architecture review. Events turn the model into something that reacts to the outside world while nobody is watching. The SEP states that event payloads must be treated with the same caution as tool results. Its own example is an email subject line that contains "ignore all previous instructions". That is not a contrived case. Anyone who can send your user an email can write a subject line.

The spec gives several defences, and they stack.

Payload minimality. Servers should keep payloads to what is needed to identify and triage the event. An email event should carry the sender, the subject and a message ID, not the full body. The client fetches full content through tools when it needs it. This shrinks both the PII footprint in logs and queues and the injection surface.

Sanitise or sandbox before the model. Clients should sanitise or sandbox event payloads before they reach an LLM, in the same way the spec already asks for tool results.

Receipt is not authority. The SEP says receiving an event does not authorise acting on it. When the agent responds to an event by calling a tool, that call goes through normal MCP authorization. The event grants no privilege.

Authorization at three moments. At subscribe time the server checks the principal may subscribe to that event type with those arguments. At delivery time the server should periodically re-verify, and if access is revoked it ends the subscription with the termination signal for its mode. At action time, the tool call is authorised as usual.

Webhook mode adds a second layer of threats, and the SEP has a table of them. The ones I would single out are SSRF and DNS rebinding, which the spec handles by validating the callback address at delivery time, forbidding redirects and connecting directly to the validated IP. Then there is reflection and flooding, where an attacker subscribes a victim URL, which the verification handshake prevents. Forged deliveries fail the per-subscription HMAC. Receivers should reject replays using the timestamp window and the webhook-id check, and should verify the webhook-signature before processing anything.

A left to right path from an event to an action. An upstream system sends an event through an MCP server to the client SDK, which passes the payload through an untrusted-payload gate and then a policy check. Normal MCP authorization applies before any tool call, so receiving the event grants no authority to act.
A left to right path from an event to an action. An upstream system sends an event through an MCP server to the client SDK, which passes the payload through an untrusted-payload gate and then a policy check. Normal MCP authorization applies before any tool call, so receiving the event grants no authority to act.

The diagram is the shape I want in my head. There are several checkpoints between the upstream system and a tool call, and the event itself is never one of them.

What should an enterprise add on top of the spec?#

A policy gate, a kill switch, an audit log and rate limits that you actually enforce. Everything in this section is my recommendation. It is not in the spec.

The SEP has a short Governance section. It says the extension does not mandate specific mechanisms but is designed to enable them. Audit is possible because the client owns all subscription state, so an enterprise runtime can inspect the registry and log event-triggered actions. Clients should support policy evaluation between event receipt and action, with the policy language left to the application. The kill switch is described per mode: stop polling, abort the stream or send notifications/cancelled, or call events/unsubscribe. Rate limiting is partly covered by nextPollMs, and enterprises may add more.

That is a good foundation, and it is also deliberately thin. Here is what I would build on it.

  1. A policy gate that is default deny. Keep an allowlist of pairs, an event name and the tools it may lead to. An email.received event may lead to a triage tool that reads and labels. It may not lead to a tool that sends money or deletes data. I covered the tiering model in Blast Radius Tiers, and events slot into it neatly: the tier of the action decides how much trust an event can carry.
  2. A budget on model wake-ups. Cap the number of model invocations per subscription per hour. If a noisy upstream floods you, the cap turns a runaway bill into an alert. This is the enterprise version of the rate limit the spec leaves to you.
  3. A kill switch at two levels. One per subscription and one global. Because the spec describes how to stop each mode, the global switch can be a loop over your registry, and you should test it before you need it. Remember that a webhook subscription with no expiry must be unsubscribed explicitly. Stopping a refresh loop does nothing for it.
  4. An audit record per decision. Log the eventId, the subscription, what the gate decided and which tool call followed. When someone asks why the agent did something at 3am, the answer should be one query.
  5. Quarantine for free text fields. Subjects, titles and message bodies are where the injection lives. Pass structured fields to the model as they are, and wrap free text so it is clearly marked as data. This is the same idea I wrote about in the Azure zero trust piece, applied to a new door: the agent should never be the most trusted identity in the network, and an event pipe is a new way to talk to it.

I would also read my earlier notes on security for agents that actually do things and guardrails for agentic coding in the enterprise. The A2UI post makes a related argument about a gate between generated output and action. It is the same pattern in a different protocol.

If I wire this into my own setup, I would start with one event type that costs little when it is wrong, such as build or deploy status. I would let it trigger read-only actions only and keep every write behind a human approval. The option I would reject on day one is subscribing to inbound email, because strangers write that text and it is the easiest door for an injected instruction.

What is still open, and how does this relate to async subagents?#

Quite a lot is open, and the SEP lists it in plain language.

The open questions that matter most to agent builders are these. First, how should the client SDK expose events to agent frameworks: as injected context, as a special message type, or as a callback like a tool call? The SEP calls this an SDK design question rather than a protocol question and says guidance would be useful. I think this is the question that decides whether Events feels natural or awkward in practice. Second, should MCP task state changes be exposed as events? Today a client learns about task transitions by polling tasks/get or listening on notifications/tasks. A reserved event type for task updates would let a client that started a task and disconnected get the result later by poll or webhook. That is the kick off a long job, close the laptop, get told when it finishes workflow, and it connects to the Tasks work in SEP-1686. Third, should resource subscriptions and the list_changed family be folded into events, and can one subscription span several event names with one cursor? Both would change the wire format if adopted, which is another reason to treat the current shape as provisional.

How do MCP Events and async subagents fit together?#

They solve different halves of the same problem, and neither one solves the middle.

Events wake the agent. They answer the question of when the model should start thinking. Async subagents are what runs while the main agent is busy, or while it is asleep waiting for the next event. A realistic always-on setup uses both. An incident.created event arrives, the client SDK hands it to the main agent, and the main agent starts a subagent to gather logs while it carries on with triage.

Two things stay open in that picture, and the Events spec does not claim to close either.

Crash recovery of work in flight. Events recover the subscription. The client owns the subscription registry and can rebuild server-side state with idempotent events/subscribe, or resume poll and push from its stored cursors. That brings back the doorbell. It does not bring back the half-finished investigation a subagent was running when the process died. That state lives in your harness, and I wrote about what it takes to keep it in Building a Long-Running AI Agent Harness.

Approvals when nobody is there. An event can arrive at any hour. The spec says policy evaluation is an application concern, and action-time authorization is the normal MCP flow. Neither tells you what happens when the action needs a human who is asleep. You need a queue, a timeout and a decision about what the agent does when the answer does not come. The broader version of this problem shows up in the dark factory teardown.

Where the event wiring lives is also a portability question. If the SDK-to-framework hand-off is still undecided, then moving an agent between harnesses means re-doing that wiring, which I would add to the list in What It Actually Costs to Move an Agent Between Harnesses. For a closer look at how a coding agent consumes a stream of events internally, The Shape of a Coding Agent is a good companion.

Events are Beta, the SDKs are moving and the open questions touch the wire format. I would still prototype now. The idea that the runtime polls and the model sleeps is simple, it is cheap, and I expect it to survive whatever the final spec looks like.

FAQ#

What is MCP Events? MCP Events is a Beta extension, identified as io.modelcontextprotocol/events and defined by SEP-3415, that lets an MCP client subscribe to things that happen in an upstream system and have an agent react when they occur. A server lists event types with events/list, and a client receives occurrences with eventId, name, timestamp, data and cursor.

Does the LLM poll in MCP Events? No. In poll mode the client SDK calls events/poll at the interval the server recommends, and the spec says this is a protocol-level operation and not an LLM tool call. The model is invoked only when the events array in the response is non-empty.

Which delivery mode should I use for MCP Events? Use whichever the event type advertises and your deployment can support. Poll works almost everywhere, including serverless servers and clients behind NAT. Push suits stdio servers and clients that can hold a stream open. Webhook suits remote servers where a held connection is impractical, but it needs a reachable HTTPS endpoint, a client-supplied secret and a verification handshake.

Does MCP Events guarantee exactly-once delivery? No. The extension gives no protocol-level exactly-once, cross-subscription ordering or transactional guarantees. It gives cursors for resuming, eventId for deduplication within a subscription, and at-least-once delivery in all three modes when the upstream is durable and the client replays from its last cursor. Agents that need stronger guarantees should read authoritative state through tools.

Is MCP Events safe against prompt injection? It reduces the risk and does not remove it. The spec says event payloads are untrusted data, asks servers to keep payloads minimal, asks clients to sanitise or sandbox them before the model sees them, and states that receiving an event does not authorise acting on it. Your own policy gate and tool authorisation still do the real work.

Is MCP Events ready for production? Not yet in my view. The SEP header says Final, but the published spec page labels the extension Beta, the repository describes it as Experimental, and the SEP says the TypeScript SDK implementation was in review. Prototype with it, expect breaking changes, and keep your agent logic independent of the exact wire format.

How do async subagents relate to MCP Events? They are complementary. Events decide when the agent wakes up, and async subagents handle the work that runs in the meantime. Neither one solves crash recovery of work in flight or approvals when no human is available, so your harness still has to handle both.


The next time someone tells you their agent watches your inbox, ask who does the polling. If the answer is the model, ask what that costs per hour when nothing happens. If they do not know the number, you have found the first thing to measure.

Sources: SEP-3415, Events Extension and the ext-events repository.

Related reading: Blast Radius Tiers: A Permission Model for Agents That Act, Zero Trust on Azure: What Enterprises Are Missing, and Building a Long-Running AI Agent Harness.

Share:

Stay in the loop

New posts on AI engineering, Claude Code, and building with agents.