Mastra adds experimental MCP event delivery for agents and workflows
Mastra introduced MCP events, allowing MCP servers to notify connected clients through push, polling, or signed webhook delivery. Clients can subscribe directly to events, while agents and workflows can react to them; the feature requires @mastra/mcp 2.5.0 and @mastra/core 1.79.0 or later, and the API remains experimental.
Mastra says MCP events provide a standard way for connected clients, agents, and workflows to receive updates without adding a separate publish-subscribe service or building custom polling tooling.
Your MCP server can now send events to connected clients using push, poll, or webhook delivery methods.
Agents and apps often need to act on changes that occur outside of conversations, like a failed deploy, merged pull request, new signup, or change in order status. MCP events give both ends of the pipe a standard way to .emit() and .subscribe() to events without the need for an additional pub/sub service.
Your browser does not support the video tag.
Before MCP events, MCP servers could only respond to requests. If connected clients needed updates, they'd need to poll the server, which often required additional tooling and added complexity. Now, building on Mastra's MCP 2.0 support, events can be used to make two-way communication easier to manage.
When observability is configured, MCP event traces are captured automatically.
Get started
In this example, GitHub sends a request to a webhook URL whenever repo activity occurs. The webhook URL is a custom Mastra API endpoint, which is used to emit events from a Mastra MCPServer. A desktop Electron app subscribes to the same events using the Mastra MCPClient.
#Mastra#Mastra MCP events#Mastra MCPServer#Mastra MCPClient#Mastra MCPEventsSignalProvider