What this thread does
Page large MCP lists on the server and consume every non-null continuation cursor on the client, checking whether your SDK already aggregates pages.
What changed
- MCP revision 2026-07-28 (checked 2026-10-28) retains pagination for
tools/list,resources/list,prompts/listandresources/templates/list; its pagination spec explicitly accepts empty-string continuations. Pagination itself is not new. - The changelog, checked 2026-10-28, removes connection-scoped lists and initialization, adds per-request metadata and requires
resultTypeon wire results. - TypeScript's release notes introduced no-cursor list aggregation in 2.0.0-alpha.4 on 2026-06-30 (both checked 2026-10-28). Use stable APIs below.
Diagnostic: Gmail tools fetch failed · connected
As of November 2026. Do first: open /mcp and inspect Gmail's tool-discovery status. Claude Code's discovery documentation, checked 2026-11-08, separates connecting from discovery. A rejected tools/list is different from a list missing later pages; do not raise the page budget for that failure.
In issue #107111, markmansour reports this symptom after authentication on 2.1.318 (November 4), still failing on 2.1.319 after re-authentication (November 6), while calendar/docs/sheets list tools. On November 7, marioschmidtapp reports the pattern on Windows 11 with 2.1.318; signed-out discovery lists tools that cannot be used. These are attributed observations, with no local reproduction or confirmed repair.
The 2026-07-28 HTTP binding removes the GET stream and requires matching header/body version metadata. Inspect protocol era and the authenticated request path before stream repairs or header changes. This contract does not establish Gmail's root cause, the failing POST's status, a universal OAuth defect or a fixed release; the early proxy hypothesis is not a diagnosis.
How to migrate large lists
1. Identify the installed SDK using the applicable command, then inspect the project lockfile separately:
pnpm list @modelcontextprotocol/client @modelcontextprotocol/server @modelcontextprotocol/sdk --depth 0
python -m pip show mcp
2. On the server, start at the beginning without params.cursor; otherwise validate the token and resume. Bound pages by bytes/latency; use stable ordering and tokens bound to the authorized catalog/query or snapshot. Return the page's tools, resources or prompts plus nextCursor when more exist; omit the cursor on the final wire page. Do not invent protocol limit, page or hasMore parameters.
3. TypeScript: use low-level Server from @modelcontextprotocol/server, setRequestHandler('tools/list', handler) and request.params?.cursor; declare tools. Implement ordering, validation and slicing. Do likewise for resources/prompts, preserving call/read/get handlers; registration alone does not prove paging.
4. Python: MCPServer returns one page. Low-level Server accepts on_list_resources, on_list_tools, on_list_prompts, on_list_resource_templates, receiving PaginatedRequestParams | None. Models use next_cursor; wire uses nextCursor. Validate tokens to avoid uncaught conversion exceptions.
5. The TypeScript calling guide documents await client.listTools() as an aggregate; resources, prompts and templates behave likewise. An explicit string cursor fetches one page. ClientOptions.listMaxPages defaults to 64; retain a finite workload-appropriate budget. Check installed APIs for older SDKs/custom clients.
Python's documented Client fetches one page per call. Proposed resource-loop logic:
async def collect_resources(client):
items = []
continuation = None
for _ in range(100): # chosen application budget
page = await client.list_resources(cursor=continuation)
items.extend(page.resources)
if page.next_cursor is None:
return items
continuation = page.next_cursor
raise RuntimeError("Resource listing exceeded page budget")
Adapt method/array for tools/prompts. Fail visibly at the chosen budget; never present partial results as complete. Do not use truthiness or cursor equality to decide completion.
6. Raw requests: follow the base protocol. Include version/client capabilities in params._meta, with client identity as recommended. Echo nextCursor into params.cursor unchanged, with fresh ID and metadata. Wire results require resultType: complete; SDK codecs may supply it.
Diagnostic: LIST_PAGINATION_EXCEEDED
The TypeScript guide names this SdkError for exceeding the page cap. Check convergence before raising it; zero disables it. -32602 (Invalid params) can mean invalid cursors or missing metadata: inspect the envelope. Ignoring continuations hides items; one-page catalogs are valid but unbounded responses defeat large-catalog paging.
Versions and implementation choice
| Surface | Reference | Pick when / Not for |
|---|---|---|
| TypeScript client | As of November 2026, @modelcontextprotocol/client 2.4.0 | Aggregate discovery; not proof every host aggregates |
| Python distribution | mcp 2.3.0 (checked 2026-10-28) | Explicit Client loop; not standalone FastMCP docs |
| High-level registry | SDK guides above, checked 2026-10-28 | Small catalogs; not automatic pagination |
Package and protocol versions are separate.
What to test
Proposed fixture: five items, pages of two, three wire calls, five unique identities. Repeat for all four lists. Cover empty catalogs, short/final pages, invalid tokens, empty-string/repeated cursors and catalog mutations. Cursor equality is not completion. Never-ending listings must fail at a page/time budget.
Through the actual host, assert visible names equal the union of all pages; check response sizes, wire casing and ordering/snapshot policy.
Community evidence
- riccardorispoli's SDK issue reports high-level registries returning everything despite cursor types, proposing low-level handlers. This does not establish that all releases gained pagination settings.
- chelojimenez's SDK issue reports repeated empty cursors truncating aggregates: “The caller cannot tell that pages are missing.” Use this as a regression case; the issue closed on 2026-09-28 via merged PR #2886.
Pitfalls
Do not decode client-side tokens, stop at "", or infer completion from short pages. Avoid looping around TypeScript aggregates. Paging bounds responses, not total model-context cost. Token validity is not authorization.
A prompt to give your agent
Read the linked spec and SDK guides; identify installed packages and protocol mode. Implement pages and the appropriate aggregate or loop. Check completeness, cursors and wire envelopes; report unrun checks.
Limits
No local SDK/server/host run. Docs may lead releases; issue reports are not a compatibility survey or confirmed fix.
Started from a post by @riccardorispoli, packaged by the editor. Original post