MCP has pagination, but only for the protocol's own lists. The specification gives tools/list, resources/list, resources/templates/list and prompts/list an opaque cursor and a nextCursor field. What a tool sends back from tools/call is the tool author's business. So a tool that lists things needs its own paging arguments, and ours did not have them: list_profiles on Mosaic's MCP server returned every profile in the library in one answer. On a library of eight hundred profiles, that was eight hundred rows dropped into a model's context window by a single call.
How the REST route got paging and the tool did not
Mosaic has three ways in over one store: the window, a local REST API and an MCP server. We had already written down that every collection answers as { total, <items> }, and /profiles had grown limit and offset (the reasons are in why every list in our API answers in one shape). A check called check:api-behaviour held REST to that rule.
Nothing held MCP to it. Then somebody pointed the check at both surfaces at once: the running app, one library, one minute. Seven list tools came back as bare arrays, where REST had answered with an object:
tool REST MCP
list_projects { total, projects } bare array
list_profiles { total, profiles } bare array, and no paging
list_proxies { total, proxies } bare array
list_folders { total, folders } bare array
list_scenarios { total, scenarios } bare array
list_engines { total, engines } bare array
list_running - bare array
For six of the seven, that was cosmetic, at least for now: an array has no slot for a count, so any client built on it breaks on the day we add one. list_profiles was different, because it cost tokens. Ask it for five profiles and it sent all 800, and the model had to dig its five out of its own context. And with total missing, a model paging by hand couldn't tell the last page from a short one.
An AI assistant can make, start and drive your profilesIn Mosaic: MCP server. Let an AI assistant create, launch and drive profiles. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.
Mosaic is a desktop app
Email yourself the link and open it on your computer.
What a list tool returns to a model now
list_profiles takes the same filters it always did (projectId, search, tag, os) plus four arguments that exist for paging:
limit: how many to return, default 100, maximum 500offset: how many to skipsort: one of the profile sort keys, applied to the whole result before it is cut into a pageorder:ascordesc
The answer is { total, profiles }, and total counts every row that matched the filters, not the rows on this page. A model loops while offset + limit < total and stops.
Three choices in there are about the reader being a model rather than a script.
The default is a page. On REST, a request with no limit still returns the whole collection (up to 1,000 rows), because changing that would have broken scripts that already read /profiles whole. A model has no such history, and the cost of "everything" lands in its context. So on MCP the absent case is 100 rows.
We sort before we cut the page, and the tool's description tells the model as much. Otherwise "my five most recently used profiles" would mean pulling every page and sorting 800 rows in its head. With sort: lastRunAt and limit: 5 it takes one call.
Each row is a summary, not the whole profile. A list row carries the name, note, tags, platform, browser version, proxy label, dates and the live run state. The fingerprint, the full proxy and the privacy settings come from get_profile, one id at a time. A model that wants the GPU of one profile asks for that profile, and the other 799 never enter the conversation.
We chose total over a cursor because the store is a file on the same computer, and counting a few thousand profiles in memory costs nothing. A cursor is the better answer when counting is expensive or the data moves under you between pages. The specification's own guidance for its list methods (treat the cursor as opaque, a missing nextCursor means the end) is a sensible model to copy if you go that way.

The check that walks both surfaces
Changing seven handlers was the easy part. What stops it happening again is the check. check:api-behaviour used to ask only REST whether a list answers { total, ... }; it now asks fourteen MCP tools too, and it checks paging on both. It calls list_profiles once bare and once with limit: 1. The total has to match, and the second answer has to hold one row.
A check nobody has seen fail proves nothing, so we broke the code on purpose, one fault per run. With list_engines returning a bare array again, it printed:
MCP list_engines returns a bare array; every collection returns { total, engines }.
Removing limit from list_profiles printed:
MCP list_profiles limit=1 returned 40 profiles.
A rule enforced on one surface is enforced nowhere, because the surface nobody checks is the one that drifts, and a caller reading the rule cannot tell which half of it is true. One more case came out of the same pass: list_warmup_presets had drifted on both surfaces at once, so there was no correct copy to compare it against. Both now carry total.
MCP tool pagination for large results, in five rules
What we'd tell anyone building a list tool, after getting it wrong ourselves:
- Return an object with a count or a next cursor, never a bare array.
- Give it a default page size that fits in a context window, and a maximum.
- Let the model sort and filter on the server, so it never has to fetch everything to find five rows.
- Return summaries in the list and the full record from a separate get tool.
- Test the tool itself as well as the REST route it mirrors. A tool schema is read by something that cannot ask what was meant.
Mosaic's MCP server is a Pro feature and binds to 127.0.0.1 like the REST API. Whether an assistant needs it when a REST API already exists is a separate question, answered in do you need MCP if you have an API. For an agent working across many profiles at once, running an AI agent with multiple browser profiles shows the tool calls end to end.
Sources
- Model Context Protocol specification (2025-06-18): Pagination, read November 3, 2026






