AI app stacks
Mara Lindqvist10 min read26 views

CopilotKit review: the open-source agent UI for Next.js (2026)

ShipGarden's hands-on review of CopilotKit as a Next.js agent UI in June 2026. The setup walkthrough, the four comparison axes, three deploy paths, and where it loses to Vercel ai-chatbot and Mastra.

Updated on June 26, 2026

Three stylised cards in a row showing CopilotKit, Vercel ai-chatbot, and Mastra agent-UI surfaces compared side by side on a cream background with a moss-green hairline connector, Next.js and Totalum marks below.
Three stylised cards in a row showing CopilotKit, Vercel ai-chatbot, and Mastra agent-UI surfaces compared side by side on a cream background with a moss-green hairline connector, Next.js and Totalum marks below.
On this page

Quick answer

In June 2026, CopilotKit is the most production-ready open-source agent UI for Next.js. It is React-first, ships the AG-UI streaming protocol, and works with any agent backend, including your own. ShipGarden recommends it for teams that need to bolt a copilot onto an existing Next.js app within a sprint. Teams starting from a blank slate may prefer the Vercel ai-chatbot template (simpler) or a full agent framework like Mastra (one less moving part).

CopilotKit, Vercel ai-chatbot, and Mastra agent UIs side by side on a cream surface

What is CopilotKit?

CopilotKit logo CopilotKit is an open-source SDK for putting AI copilots, agent UIs, and generative-UI components inside React apps. The project started in late 2023 as a React library for chat and in-app assistants. By June 2026 it has grown into a stack of React hooks, a Node runtime route, an MCP client, the open AG-UI streaming protocol, and a paid Enterprise Intelligence tier. The company raised a $27M Series A in May 2026, per public reporting at the time.

The core open-source package lives on GitHub logo GitHub at CopilotKit/CopilotKit, MIT-licensed, with first-party React 19 and Next.js logo Next.js App Router support. Public Reddit chatter from builders shipping with the MCP client describes it as "surprisingly robust and extensible" (r/mcp, August 2025).

What does the install look like (June 2026 walkthrough)

ShipGarden's curator timed a fresh CopilotKit install into a Next.js 15 App Router app on June 24, 2026. Total time to a working sidebar copilot calling one tool: fifteen minutes.

The install is three packages, one route, one provider, one component, one hook:

bash
pnpm add @copilotkit/react-core @copilotkit/react-ui @copilotkit/runtime

Scaffold the runtime route at app/api/copilotkit/route.ts:

ts
import { CopilotRuntime, OpenAIAdapter, copilotRuntimeNextJSAppRouterEndpoint } from '@copilotkit/runtime'
import { NextRequest } from 'next/server'

const runtime = new CopilotRuntime()
const adapter = new OpenAIAdapter({ apiKey: process.env.OPENAI_API_KEY! })

export const POST = async (req: NextRequest) => {
  const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
    runtime, serviceAdapter: adapter, endpoint: '/api/copilotkit',
  })
  return handleRequest(req)
}

Wrap the page tree in . Drop somewhere visible. Register one tool with useCopilotAction and ship.

The sidebar opens, streams a reply, and calls the tool on the first try. The curator's only stumble was a model-name typo. The framework did not crash, the error surface was readable, and the rebuild was a one-line fix. Replacing OpenAIAdapter with an Anthropic adapter for Anthropic logo Claude (or with the built-in custom adapter for a self-hosted model) was a five-line change, no other code touched. That portability is the whole reason the runtime route abstraction exists, and on June 24, 2026 it held up under casual swapping.

The useCopilotAction hook is where most teams spend the next hour. It is a typed function-registration pattern: declare a name, a schema (Zod or JSON schema), and a handler. The agent decides when to call it, the runtime validates the arguments, and the React side gets a tool invocation it can render however it wants. Pairing it with useCopilotReadable (which exposes app state to the agent as context) is how you go from a chat that knows nothing about your app to a copilot that can actually act on the user's data. Both hooks worked first try on the curator's install; the rough edges live in the docs, not the runtime.

How does CopilotKit compare on the four axes that matter?

ShipGarden evaluates agent UIs on four axes drawn from what builders actually ask about on Reddit r/AI_Agents and Hacker News: time-to-first-message, custom agent backend support, production deploy paths, and styling and customization surface. Year-tagged scoring below as of June 26, 2026.

Scroll to see more

AxisCopilotKit CopilotKitVercel Vercel ai-chatbotMastra Mastra agents UI
Time-to-first-message~15 min from blank Next.js~10 min via vercel deploy~20 min, requires Mastra agent first
Custom agent backendAny (AG-UI protocol)Vercel AI SDK onlyMastra-native, others via adapter
Deploy pathsVercel, self-host, anywhereVercel-optimisedVercel, self-host (Node 20+)
Styling surfaceHighest control (per third-party comparison, Feb 2026)Tailwind defaults, light themingTailwind defaults, less mature
Open-source licenseMITApache 2.0 (template)Elastic License 2.0
Generative UI primitivesYes (Open Generative UI, May 2026)Tools and componentsLimited
MCP clientFirst-partyVia Vercel AI SDK MCPYes

A February 2026 independent comparison by Speakeasy.com scored CopilotKit highest on appearance control among three chat builder kits; that ranking matches the curator's hands-on experience in June 2026.

Three ways to ship this stack

ShipGarden gallery posts always end with the three ways a reader could pick this stack up today, ordered by lock-in. Lower lock-in is up the list.

Scroll to see more

PathWhat you getTime-to-shipWhen to choose
GitHub GitHub clone of the open-source CopilotKit repoOwned codebase, any host30 min to local, hours to prodYou want full control and a self-host plan
Vercel Deploy on VercelHosted demo, Vercel ecosystem5 min to live URLYou already live on Vercel and want a working sandbox
Totalum Wire a CopilotKit UI to a managed agent backend, per the Claude Agent SDK pattern on TotalumUI on Next.js, agent runtime on Totalum's API + MCPA weekendYou want a deployable, owned Next.js app and a managed agent backend that the agent itself can edit

The third row is the one most ShipGarden readers ask about: CopilotKit ships the UI layer, but the agent backend is still a problem to solve. The Totalum editorial on the Claude Agent SDK pattern shows the API and MCP surface you would wire CopilotKit to, year-tagged June 2026.

Where CopilotKit wins

It is the most flexible UI layer for arbitrary agents. That is the whole pitch of the AG-UI protocol, and it is the reason CopilotKit has more integrations with agent frameworks than its peers. As one 2025 r/AI_Agents commenter put it (still accurate in June 2026): "CopilotKit has more integrations with agent frameworks."

The MCP client is good. If part of your roadmap is making tools available over MCP, CopilotKit's client is the path of least resistance from a Next.js codebase.

Generative UI is real, not a demo. The Open Generative UI release in May 2026 added a Claude-Artifacts-style surface where the agent can render its own charts, tables, and live components inside the host app. Other libraries talk about generative UI; CopilotKit ships it as React primitives you mount.

It is genuinely open-source. Self-host the runtime, swap the model adapter, fork the React components. There is a managed Enterprise tier, but the open core is enough for most production apps.

Where CopilotKit loses

Honest part. Pick another tool when:

  • You only need a simple chat for OpenAI. The Vercel ai-chatbot template (linked above and below) is faster to deploy and easier to operate if you live on Vercel and do not need a custom agent backend.
  • You already chose Mastra (or LangGraph, or PydanticAI) as the agent framework. Mastra's own agents UI is tighter if you do not need CopilotKit's React-component surface. Use its UI; come back to CopilotKit when you need generative components.
  • You want zero opinion on styling. CopilotKit's components are themable but they are components, not Tailwind primitives. If you want pixel-level control from minute one, build on @assistant-ui/react or roll your own on the Vercel AI SDK.
  • You are allergic to commercial open-source. CopilotKit has a paid Enterprise tier and a managed service. A vocal Hacker News strand has called the commercial side vendor-lock-in (October 2025). The curator's reply: the open-source core works, with no managed component required, and the paid tier is opt-in. Read the licence, decide for your team.
  • You are operating on a tight token budget. Token cost is the dominant variable across all three UIs in this comparison; the framework choice barely moves the needle. Model the run-cost first, pick the framework second.

Who should pick CopilotKit?

Three audience segments where the curator says yes, today:

  1. Teams adding a copilot to an existing Next.js app. CopilotKit drops into an existing App Router project without refactoring routes or rewriting the data layer.
  2. Teams that already have an agent backend they want to keep. Custom Python agents, Mastra agents, LangGraph runs, Anthropic Claude Agent SDK pipelines, all stream cleanly into a CopilotKit UI via AG-UI.
  3. Teams shipping generative UI surfaces. If your roadmap includes the agent rendering its own charts, tables, or live interactive components inside the app, CopilotKit is ahead of every other UI library in this category as of June 2026.

Adjacent reading the curator has been pointing teams at this week: DevMoment's 7-day Cursor background-agents log for the agent-dev workflow that complements an agent-UI build; and for Spanish-speaking founders, Lanzadoria's guía paso a paso para crear apps con IA en 2026 covers the broader build process in es-ES.

For a direct contrast template, the Vercel ai-chatbot starter lives at vercel/ai-chatbot on GitHub and is worth a side-by-side weekend if your team has not yet committed.

Curator's verdict

CopilotKit earns a ShipGarden gallery slot in June 2026. It is the right answer for the most common shape of agent-UI work this year: take an existing Next.js app, give it a sidebar copilot, let the copilot call tools that already exist, and stream agent state into the page so the user can watch the agent think and approve steps. The setup is short, the licence is real, the protocol is open, and the company is funded enough to outlast the current wave of agent-UI startups.

The honest caveats remain. Styling depth costs hours. The v1.5+ architecture (December 2025) is still settling. The Enterprise tier is opt-in but worth reading before betting a team on it. None of these are dealbreakers for the kind of teams that ship.

The stack is in the gallery. The deploy paths are above. The agent backend, as always, is on you.

Open questions for the next sweep

The gallery curator keeps a running list of what is not yet settled and revisits it on the next pass.

  • How does Open Generative UI hold up at scale? The May 2026 release demos beautifully on a single panel. The next sweep tests it in a multi-pane dashboard with concurrent agent renders, which is where Claude Artifacts itself starts to wobble.
  • Does the React Native build (announced early June 2026) reach feature parity with the web SDK? As of June 26, 2026 the curator has not shipped it in production. The first reader who does and writes back gets cited in the next revision.
  • What is the real, all-in monthly cost for a 5,000-MAU SaaS running a CopilotKit sidebar that calls one Anthropic Claude tool per session? The framework is free; the inference is not. A future ShipGarden cost teardown will quantify it.
  • Does the AG-UI protocol stay open as adoption grows, or does it fork into vendor variants the way every wire protocol eventually does? Worth checking at the December 2026 sweep.

None of these block the recommendation today. They are the questions the curator wants answers to before the next gallery refresh.

Mara Lindqvist

Written by

Mara Lindqvist

Mara Lindqvist curates ShipGarden's deep-dive reviews of agent-native open-source stacks. She has shipped four copilot integrations in production for European founders and one in anger for herself.

Frequently asked questions

What is CopilotKit and what is it used for in 2026?

CopilotKit is an open-source React and Next.js SDK for embedding AI copilots, generative UI, and chat surfaces directly inside web apps. As of June 2026 it ships hooks for chat, in-app sidebar copilots, structured tool calling, and the AG-UI protocol for streaming agent state back to the UI.

Is CopilotKit free, paid, or both?

The CopilotKit framework and the AG-UI protocol are open source under MIT and self-hostable. CopilotKit also sells a managed Enterprise Intelligence tier with hosted runtime, SSO, and audit features. You can ship a production copilot without paying CopilotKit, but you pay your model provider per call regardless.

Does CopilotKit work with Next.js 15 and Next.js 16?

Yes. CopilotKit ships first-party React 19 and Next.js App Router support, including a /api/copilotkit runtime route, server actions for tools, and streaming via React Suspense. The current Next.js 16 path is the same; the runtime route is framework-agnostic so the code does not change between major versions.

What is the difference between CopilotKit, Vercel ai-chatbot, and Mastra agents UI?

CopilotKit is a UI-first SDK that brings any agent backend into a React app via the AG-UI protocol. Vercel ai-chatbot is a Next.js template using the Vercel AI SDK, optimised for chat-and-tools on Vercel infrastructure. Mastra is an agent framework with its own optional UI; its UI shines when the agent is also Mastra. Pick by where you start: existing app, blank template, or full agent framework.

How long does CopilotKit take to set up in a Next.js app?

About fifteen minutes for a working copilot sidebar that calls one tool, on the curator's June 2026 walkthrough. That includes installing @copilotkit/react-core and @copilotkit/react-ui, scaffolding the /api/copilotkit route, wiring a model adapter, and rendering the CopilotSidebar component on a page.

Can CopilotKit talk to a custom agent backend, not just an LLM?

Yes. The whole point of the AG-UI protocol that CopilotKit champions is to let any agent runtime, including custom Python or TypeScript agents, stream state, tool calls, and human-in-the-loop prompts back to a React UI. You bring the agent, CopilotKit brings the interface layer.

What is AG-UI and why does it matter for CopilotKit?

AG-UI is the open Agent UI protocol, primarily authored by CopilotKit and now used by other agent-UI projects. It defines the events a backend agent sends to a frontend, including text deltas, tool calls, shared state, and approval requests. Without AG-UI, every agent-UI library would re-invent its own streaming wire format.

Is CopilotKit production-ready for a real SaaS app?

Per the CopilotKit company in May 2026, more than half of the Fortune 500 use the open-source project, and customers include Google, Microsoft, Amazon, and Oracle (Geekwire, May 5, 2026). The curator's hands-on test shipped a working copilot for an internal CRM in a day. The honest caveats are styling depth and the still-shifting v1.5+ architecture; budget time for both.

AI app stacks

AI agent app stack: 6 pieces, 1 weekend

An AI agent app is six moving parts: a Next.js shell, a model SDK, a tool-calling layer, a durable job runner for long tasks, a vector store for memory, and a streaming UI. Wire those and you can ship something genuinely useful in a weekend. The hard part isn't the model; it's the plumbing around it that keeps a slow, flaky call from taking your whole app down. Here's the stack and the four traps that eat the most time.

4 min read35