Mastra adds MCP Events so servers can push updates to clients

Mastra has introduced MCP Events, a feature that lets an MCP server send events to connected clients using push, poll, or webhook delivery. According to Mastra, it gives both sides a standard way to .emit() and .subscribe() to events without an extra pub/sub service.
- Mastra's MCP Events let MCP servers send events to connected clients via push, poll, or webhook delivery.
- Servers use defineEvent() and .emit(); clients use .subscribe(), with push as the default delivery method.
- Agents can react through MCPEventsSignalProvider, and workflows can start runs from events.
- Requires @mastra/[email protected] and @mastra/[email protected] or later.
- The feature is experimental and the API may change between releases.
Why MCP servers needed events
Agents and apps often need to react to changes that happen outside a conversation, Mastra says, such as a failed deploy, a merged pull request, a new signup, or a change in order status. Until now, MCP servers could only respond to requests. Clients that wanted updates had to poll the server, which, according to Mastra, often required additional tooling and added complexity.
MCP Events build on Mastra's MCP 2.0 support and are meant to make two-way communication easier to manage. Mastra also says that when observability is configured, MCP event traces are captured automatically.
How it works
Mastra's example uses GitHub, which sends a request to a webhook URL whenever repository activity occurs. That URL is a custom Mastra API endpoint used to emit events from a Mastra MCPServer. A desktop Electron app then subscribes to the same events through the Mastra MCPClient.
The feature requires @mastra/[email protected] and @mastra/[email protected] or later, added in PR #27324. On the server, developers define events with defineEvent(), including a description, an input schema, a payload schema and a match function. In the example, a repo.starred event carries the repository name, the user and the star count. Events are published with .emit().
On the client side, .subscribe() takes up to four arguments:
- the name of the MCP server in the client's servers config, such as "github";
- the name of the event, such as "repo.starred";
- the arguments defined by the event's inputSchema;
- an optional delivery setting that controls how events reach the subscription.
The returned subscription can be read with a for await loop, so each event is handled as it arrives. In the example, the app triggers a star animation using the user and star count.
Delivery methods
The delivery option on .subscribe() sets the subscription behavior. The default is push.
- push: the subscription holds one events/stream request open and listens for server events.
- poll: the subscription repeatedly asks the server for new events, at most once a second by default.
- webhook: the server sends each event to a URL on the client as a signed POST request. This requires webhook settings on the MCPClient.
Agents and workflows, and what it means
Agents can react to MCP events through MCPEventsSignalProvider. Each event is delivered to the agent's thread as a notification. A developer creates the provider with an MCPClient, adds it to the agent's signals, and calls subscribeThread with a resource ID, thread ID, server name, event name and arguments.
Workflows can also respond to events. In Mastra's example, each incoming event creates a workflow run and starts it with the event data as input.
For developers building on Mastra, this means external changes can drive agents and workflows through MCP itself rather than a separate messaging layer. Mastra cautions that MCP events are still experimental and that the API may change between releases, so early adopters should expect adjustments. The company points to documentation covering MCP events, the MCPServer and MCPClient events references, MCPEventsSignalProvider, custom API routes and webhooks.
Mastra: Introducing MCP Events in Mastra | Mastra Blog


