-
Notifications
You must be signed in to change notification settings - Fork 178
Description
Is your feature request related to a problem? Please describe.
Mastra is a growing TypeScript AI agent framework with its own streaming and tool-calling patterns. OpenUI currently has no adapter for Mastra's output format, so users building agentic applications with Mastra cannot connect their agents to OpenUI's streaming renderer and chat interfaces without writing custom integration code.
Describe the solution you'd like
Add Mastra support to OpenUI, consisting of:
-
Streaming adapter — A
mastraAdapterin@openuidev/react-headlessimplementingStreamProtocolAdapterthat parses Mastra's streaming response format and converts it into OpenUI's internal event stream. This should handle Mastra's agent streaming output, including tool calls and multi-step agent runs. Usable viastreamProtocol="mastra"onChatProvider. -
Message format converter — A
mastraMessageFormatconverter so OpenUI's chat message history is compatible with Mastra's expected message format. -
Example app — A standalone example in
examples/(e.g.,examples/mastra-chat) demonstrating OpenUI + Mastra integration. The example should be a full working Next.js app showing how to wire a Mastra agent backend to OpenUI's generative UI frontend, following the same structure asexamples/openui-chat.
Describe alternatives you've considered
- Users could add a server-side translation layer that converts Mastra streams into a format an existing adapter (e.g., AG-UI or OpenAI) understands, but this adds unnecessary complexity and may lose Mastra-specific features like agent tool call semantics.
- Documentation-only guidance without runnable code, but a working adapter and example are far more useful for adoption.
Additional context
Existing adapters live in packages/react-headless/src/stream/adapters/. The adapter should follow the same StreamProtocolAdapter pattern (implementing async *parse(response): AsyncIterable<AGUIEvent>). Mastra's documentation: https://mastra.ai/docs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status