This Next.js server provides CopilotKit integration.
In your frontend, connect to this server:
<CopilotKit
runtimeUrl="http://localhost:3000/api/copilotkit"
agent="superAgent"
>
{/* Your app */}
</CopilotKit>npm run dev (port 4111) - Pure Mastra agentsnpm run dev:copilot (port 3000) - CopilotKit integration