Mastra x assistant-ui : documentation differs, error during integration

Hello, Mastra doc on assistant-ui integration and assistant-ui one are different https://mastra.ai/en/docs/frameworks/agentic-uis/assistant-ui https://www.assistant-ui.com/docs/runtimes/mastra/separate-server-integration I tried to integrate Mastra with
import { useDataStreamRuntime } from "@assistant-ui/react-data-stream";


export const Assistant = () => {
const runtime = useDataStreamRuntime({
api: "http://localhost:4113/api/agents/weatherAgent/stream",
});
...
import { useDataStreamRuntime } from "@assistant-ui/react-data-stream";


export const Assistant = () => {
const runtime = useDataStreamRuntime({
api: "http://localhost:4113/api/agents/weatherAgent/stream",
});
...
but I have an error when I try to chat - assistant-ui : unsupported chunk type: data - mastra :
Error in LLM Execution Step Client connection prematurely closed.
ERROR [2025-10-03 11:45:50.347 +0200] (Mastra): Error in agent stream
runId: "00ace0dc-9e8b-41b5-949f-29e7619e858e"
error: "Client connection prematurely closed.
Error in LLM Execution Step Client connection prematurely closed.
ERROR [2025-10-03 11:45:50.347 +0200] (Mastra): Error in agent stream
runId: "00ace0dc-9e8b-41b5-949f-29e7619e858e"
error: "Client connection prematurely closed.
when I try the endpoint on my swagger, I have this response
data: {"type":"start","runId":"string","from":"AGENT","payload":{}}
data: {"runId":"string","from":"AGENT","type":"step-start","payload":{"request":{},"warnings":[],"messageId":"103c134d-2635-4610-bc80-07540c182029"}}
data: {"type":"text-start","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037"}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":"Message"}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":" reçu"}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":" "}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":"!"}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":" 🙂"}}
data: {"type":"start","runId":"string","from":"AGENT","payload":{}}
data: {"runId":"string","from":"AGENT","type":"step-start","payload":{"request":{},"warnings":[],"messageId":"103c134d-2635-4610-bc80-07540c182029"}}
data: {"type":"text-start","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037"}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":"Message"}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":" reçu"}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":" "}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":"!"}}
data: {"type":"text-delta","runId":"string","from":"AGENT","payload":{"id":"f77c6414-7232-4b48-a14d-8fcc990aa037","text":" 🙂"}}
Using with Assistant UI
Learn how to integrate Assistant UI with Mastra
7 Replies
Mastra Triager
GitHub
[DISCORD:1423608723078643783] Mastra x assistant-ui : documentation...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1423608723078643783 Hello, Mastra doc on assistant-ui integration and assistant-ui one are different https...
_roamin_
_roamin_3w ago
Hi @altab ! Could you try with this endpoint instead? http://localhost:4113/api/agents/weatherAgent/stream/vnext/ui
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
altab
altabOP3w ago
@joofsh thank you for testing I had no time yesterday
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
fracheton
fracheton3w ago
Hey folks 👋 the assistant-ui team has updated their docs, and I've just opened a PR about fixing ours. Thanks for the heads-up and your help 🙌
altab
altabOP3w ago
thanks a lot for being so responsive!

Did you find this page helpful?