UPDATEcopilotkit v1.91.0
CopilotKit v1.91.0 opens frontend tools to browser agents
CopilotKit v1.91.0 adds an opt-in WebMCP switch that exposes every frontend tool at once, passes after, before and limit through to thread messages, and fixes Node 22 reconnects plus tool-result metadata that a snapshot used to drop.
What changed in this release
26 checkpoints in 5 groups, organized by task from the official notes. Checkpoints do not count separate features or commits.
Whole-page WebMCP exposure
- defaultWebMCPTools registers all frontend tools with a handler and a description.
- It is off by default, so behaviour is unchanged unless you open it.
- A tool with webmcp: false stays private; the switch does not override it.
- Human-in-the-loop, render-only and built-in generateSandboxedUi tools stay out.
- React, Vue and Angular all take the setting, each starting and stopping registration at its own unmount point.
Registration lifecycle
- The core gains startWebMCP(), stopWebMCP() and a deferWebMCP option.
- React registers in a commit phase, so a discarded render registers nothing.
- Vue stops in onBeforeUnmount, letting a keyed replacement reuse the names.
- Angular stops when the injector owning the service is destroyed.
- On collision a tool that sets webmcp wins, otherwise the first one does.
Thread message paging
- after=<messageId> returns only messages after that one.
- before=<messageId> pages backwards through older messages.
- limit=<n> caps the count, and the platform caps a page at 1000.
- Replies add two fields, before and page, and page holds hasOlder, olderThan and truncated.
- after and before take non-empty strings of at most 256 characters.
- limit takes a positive whole number, so 0, -1, 1.5, abc and 1e3 are ignored.
- A local runner without Intelligence ignores all three and returns everything.
Stream reconnects
- On Node 22 a handshake answered 502, 503, 504 or 401 now arms the timer.
- When it fires with the socket still down, the runner cycles it as after a close.
- A connected run keeps its two attempts at 0.1 and 2.5 seconds.
- No new option, back-off or log line is added.
- Node 24, Node 26 and Bun behave as before.
Tool-result metadata
- A rebuilt tool result now copies the event metadata instead of dropping it.
- A promoted placeholder merges the event metadata with mergeMetadata.
- Results without metadata get no empty key.
- LangGraph artifacts land once the upstream change ships and @ag-ui/langgraph is bumped.
On this page
ContextThe three things this release touches are the ones already in your way
Three things are in your way on CopilotKit: a browser agent cannot see the page's tools, reopening a thread re-reads it whole, and on Node 22 a dropped stream leaves a run running.
WebMCP lets a browser agent discover and call tools that stay on the page. Before, only tools that set webmcp were registered; defaultWebMCPTools takes every tool with a handler and a description.
Two fixes as well: the runtime used to drop every parameter except userId and now sends after, before and limit, and tool results keep their TOOL_CALL_RESULT metadata when a snapshot rebuilds them.
The changes fall into five groups: whole-page exposure, registration lifecycle, thread paging, stream reconnects and tool-result metadata. The chart below lays them out.
One switch turns every handler-backed frontend tool on the page into a WebMCP tool
- Whole-page switch: defaultWebMCPTools registers every frontend tool with a handler and a description, off by default.
- Exceptions: webmcp: false keeps a tool private, human-in-the-loop and render-only tools are skipped, and generateSandboxedUi sets it too.
- Cost first: WebMCP is page-level, so any aware browser agent can call these tools; check authorization in every handler.
Registrations follow the component, so an unmount or a replaced provider takes the tools off the page
- New API: the core gains startWebMCP(), stopWebMCP() and deferWebMCP, so registration starts and stops explicitly.
- Unmount stops registration: React stops on unmount, Vue in onBeforeUnmount so a keyed swap reuses names, Angular when its injector is destroyed.
- Name collisions: a tool that sets webmcp itself beats one that only follows the switch; otherwise the first wins.
Thread messages page with after, before and limit, so reopening an old thread stops re-reading it whole
- Passed through: the runtime kept only userId and now sends after, before and limit; the platform caps a page at 1000 messages.
- Validation: after and before must be non-empty and at most 256 characters; limit must be a positive whole number, or it is dropped.
- Boundary: replies gain only before and page, and a local runner without Intelligence returns the full transcript with no paging fields.
A refused handshake now reconnects on Node 22, so a dropped run stops sitting there as running
- What was missing: on Node 22 the built-in WebSocket raises only error, not close, when a 502, 503, 504 or 401 answers the handshake.
- The fix: the runner arms the same reconnect timer from error and cycles the socket, with no new option or log line.
- Unchanged: Node 22 still retries a connected run at 0.1s and 2.5s, then fails on the existing timeout; Node 24, Node 26 and Bun keep retrying.
Tool-result metadata survives snapshot reconciliation, which gives LangGraph artifacts a place to land
- Restoring: when a snapshot dropped a tool result, the rebuilt message now copies the metadata from the TOOL_CALL_RESULT event.
- Promoting: a placeholder promoted to a real result merges the event metadata with mergeMetadata, the merge @ag-ui/client uses.
- Boundary: results without metadata get no empty key, and the LangGraph artifact waits on an upstream release and a bump.
The same step sits in three layers: CopilotKit registers, AI SDK reads, LangGraph keeps tools on the server
The job is the same - let an agent use page and thread state - but each vendor puts it elsewhere. AI SDK reads page tools, LangGraph streams server calls, CopilotKit fills in registration.
Read the table by column, not by counting cells: a full cell is not a score. Paging is easiest to misread, since AI SDK reads app storage, LangGraph checkpoints, CopilotKit platform messages.
Bottom line: if all page tools must reach a browser agent, CopilotKit's switch is shortest; if a page already exposes WebMCP tools, AI SDK's transport is more direct.
| Update point | Vercel AI SDK ai@7.0.188 | LangGraph JS SDK 1.17.0 | CopilotKit v1.91.0 |
|---|---|---|---|
| Frontend tools exposed to browser agents | An experimental WebMCP transport reads document.modelContext, and the list is a snapshot | Tools live on the server graph, and the browser gets calls via thread.toolCalls | defaultWebMCPTools registers every handler-backed tool on the page, off by default |
| Registration lifecycle | Closing the client aborts pending calls without unregistering page tools | close() tears down subscriptions and the shared SSE or WebSocket link | startWebMCP() and stopWebMCP(), stopping on React unmount, Vue onBeforeUnmount and Angular destroy |
| Thread message paging | Messages load from app storage, then go through validateUIMessages | getHistory pages back through checkpoints with limit and before | The runtime forwards after, before and limit, and replies carry page, hasOlder and olderThan |
| Stream reconnects | useChat with resume reconnects on mount and on visibility | The SDK handles reconnects, replay and dedup, and the server replays buffered events | A refused handshake on Node 22 arms the reconnect timer and cycles the socket |
| Tool-result metadata | Metadata rides out via messageMetadata and reads as message.metadata | Each history entry is a ThreadState carrying metadata | Snapshot restores and promotions keep the TOOL_CALL_RESULT metadata |
v1.90.2 only bumped package versions, and these five capabilities arrive in v1.91.0
The previous release added no behaviour, so each row is a capability that first appears here. Left is v1.90.2 from 2026-11-23; right is v1.91.0 from 2026-12-01.
The rows split in two: three had no switch or parameter at all, and two are places where information used to be lost. Schedule the first three as new work and treat the last two as long-standing gaps to close, because the two kinds are accepted differently.
The table doubles as an acceptance list: call a tool and see it registered, unmount and see it gone, page a thread and look for page, restart on Node 22 and watch the run recover.
| Capability | v1.90.2 | v1.91.0 |
|---|---|---|
| Whole-page exposure | Only tools that set webmcp were registered | defaultWebMCPTools registers every tool with a handler and a description |
| Registration lifecycle | webmcp: true registrations stayed after the provider unmounted | startWebMCP() and stopWebMCP(), stopping at each framework's unmount point |
| Thread message reads | The runtime dropped every parameter except userId, so a thread was read whole | after, before and limit pass through, and a page caps at 1000 messages |
| Node 22 streams | After a refused handshake the runner tried once and reported nothing | The reconnect timer also arms from error and cycles the socket |
| Tool-result metadata | Rebuilding a result from a snapshot lost the TOOL_CALL_RESULT metadata | Restores copy the metadata and promotions merge it with mergeMetadata |
Release analysisTeams handing frontend tools to browser agents should upgrade, and local-only demos can wait
Two groups should move first: teams that already let a browser agent call page tools, and teams that re-read a transcript whenever someone reopens a chat. For them this removes handwork; local-runner teams can stay put.
Teams on Node 22 with one socket per run should upgrade for the reconnect timer alone. The old behaviour left a run as running with no event and no error, so whoever was on call had nothing to check. Station view, not independently tested: Node 24, Node 26 and Bun see no change here, so no separate window is needed for them.
Across vendors the difference is placement. AI SDK consumes tools a page registered and treats the list as a snapshot; LangGraph pages history and keeps reconnects and dedup in the stream; CopilotKit brings the switch, the override and cleanup.
Our advice, as a station view rather than a measured result: turn the switch on in a preview build, call two or three critical tools from a WebMCP-aware agent, confirm each handler checks authorization, then ship. On the thread side, wire after first and keep before for paging backwards. Where the runtime is on Node 22 and runs sit in running, upgrade before you investigate, because the old behaviour left no error to look at.
AIGenLab views
Not independently testedTurn on defaultWebMCPTools in a preview build, call two or three critical tools from a WebMCP-aware browser agent, confirm each handler checks authorization, and only then ship it.
Station view, not independently tested: based on the inclusion conditions, excluded tool types and page-level authorization warning listed in PR #8577.
Apps that reopen old threads should wire after first instead of pulling the whole transcript, and keep before for scrolling back.
Station view, not independently tested: based on the whole-transcript re-read described in PR #8609 and the rules it gives for the three parameters.
Teams already on Node 24, Node 26 or Bun do not need a separate upgrade window for this reconnect change.
Station view, not independently tested: based on PR #8574 recording that these runtimes kept retrying on 1.90.2.
Questions
Does turning on defaultWebMCPTools expose human-in-the-loop tools as well?
Why do the paging parameters do nothing on a local runner?
My runtime already runs on Node 24, so what does the reconnect change require?
Official sources and scope
- CopilotKit v1.91.0 release The version, publish date and the announcement sentence for the three changes.
- CopilotKit v1.90.2 release That the previous release was a maintenance release with no functional changes, which is why the vertical table compares new capabilities.
- PR #8577: add defaultWebMCPTools to expose every frontend tool to WebMCP The default value and inclusion rules of defaultWebMCPTools, the excluded tool types, collision rules, the start and stop points in React, Vue and Angular, and the security note.
- PR #8609: pass after, limit and before through to Intelligence thread messages The rules for after, before and limit, the 1000-message and 256-character limits, the new response fields and what a local runner ignores.
- PR #8574: retry the Intelligence socket when its opening handshake is refused on Node 22 Why Node 22 only raises error, the 502/503/504/401 handshake cases, the two attempts at 0.1 and 2.5 seconds, and how other runtimes behave.
- PR #8481: keep tool result metadata when reconciling run results That both reconcile paths lost metadata, how they copy or merge it now, and the follow-up dependency for LangGraph artifacts.
- AI SDK v7: Model Context Protocol and the WebMCP transport That AI SDK's WebMCP transport reads document.modelContext, that its tool list is a snapshot, and that closing the client leaves page tools registered.
- AI SDK v7: chatbot resume streams That useChat's resume option reconnects a stream interrupted by a network disconnect on mount and when the page becomes visible.
- AI SDK v7: chatbot message persistence That AI SDK loads messages from the app's own storage and hands a whole read to validateUIMessages.
- AI SDK v7: message metadata That AI SDK's metadata is message-level, sent through messageMetadata and read from message.metadata.
- LangGraph JS SDK docs: threads and history That getHistory pages with limit and before, and that each history entry is a ThreadState carrying metadata.
- LangGraph JS SDK docs: streaming That LangGraph handles reconnects, replay and dedup inside the stream, that the browser reads tool calls from thread.toolCalls, and that close() tears down the connection.
Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.