Mastra as Remote Agent for AG UI using Copilotkit seems not working?
here's my dependencies:
"@ag-ui/mastra": "^0.0.8",
"@copilotkit/react-core": "1.9.3",
"@copilotkit/react-ui": "1.9.3",
"@copilotkit/runtime": "1.9.3",
"@mastra/client-js": "0.10.20",
"next": "15.4.6",
"react": "19.1.0",
"react-dom": "19.1.0"
I tried a simple Frontend Actions:
useCopilotAction({
name: "setThemeColor",
parameters: [
{
name: "themeColor",
description: "The theme color to set. Make sure to pick nice colors.",
required: true,
},
],
handler({ themeColor }) {
setThemeColor(themeColor);
},
});
But it keeps loading
If I try to just say "Hi" it will just reply immediately ( see attachments )
Here's my Mastra Server's Dependencies:
"@mastra/core": "^0.11.1",


19 Replies
hmmm perhaps there's a breaking changes or something?
I followed this steps here:
https://docs.copilotkit.ai/mastra/quickstart?agent=bring-your-own
Quickstart
Turn your Mastra Agents into an agent-native application in 10 minutes.
update:
the Local Agents setup is working fine
using "useCopilotAction" is not working properly if the route setup is using "MastraAgent.getRemoteAgents"
I use the newly created Mastra via "npm create mastra@latest"
and it is still not working properly for Copilot Action
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Is there a updates happening? I haven't get back on this yet since there's no response to the things that I have encountered.
I will get back on this by next week
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Here's the previous code that I followed and test, ( see attachment )
left -> mounted on app > travel > page.tsx
right -> route.ts - configured to have existing Mastra Server
Sorry for the late reply. I’ll try to setup again using the new versions and follow the documentions... while using my existing Mastra Servers..

I will try this approach to confirm this https://docs.copilotkit.ai/mastra
Introduction
Bring your Mastra agents to your users with CopilotKit via AG-UI.
updates:
So far, my colleague who ran the test and integrate it in our portal hasn’t encountered the same issue I experienced. Thank you for your response.
By the way, this is new setup using npx copilotkit@latest init
now it gives me type issues

Here's the source code that I copied

Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
Here @Tony 🔶 (@CopilotKit)
for CopilotKit:
"@copilotkit/react-core": "1.10.4",
"@copilotkit/react-textarea": "1.10.4",
"@copilotkit/react-ui": "1.10.4",
"@copilotkit/runtime": "1.10.4",
for Mastra Client & ag-ui:
"@mastra/client-js": "0.13.0",
"@ag-ui/mastra": "0.0.11",
@Tony 🔶 (@CopilotKit) here's the error that I get after killing the NextJs server and after it is killed that's where the frontend action trigger


We tried to use the Shared State.. it does not update the state to render in the main component

state did not update ( see attachment)
No error messages from copilotkit

@Tony 🔶 (@CopilotKit) Only the Remote Mastra Agents has Errors but in Local Mastra Agents it is working fine. We will just try to transfer all the agents to into local
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View