Commit graph

4 commits

Author SHA1 Message Date
Jeremiah Lowin
85c71fa834
Bound client auto-pagination loops to prevent unbounded list fetches (#3411)
* Cap client auto-pagination pages

🤖 Generated with GPT-5.2-Codex

* Raise on pagination limit instead of returning partial data

Add max_pages kwarg (default 250) to list_tools/list_resources/
list_resource_templates/list_prompts so users can control the bound.
2026-03-06 17:43:47 -05:00
Jeremiah Lowin
175479f65f
fix: guard client pagination loops against misbehaving servers (#3167)
* fix: guard client pagination loops against misbehaving servers

Treat empty/falsy nextCursor as end-of-pagination and detect cursor
cycles across all client list methods and the server context proxy
helper.

* chore: Update SDK documentation

---------

Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-12 13:19:02 -06:00
Jeremiah Lowin
17d43d7991 Address review feedback: validation and edge cases 2026-01-17 19:50:33 -05:00
Jeremiah Lowin
dada8893a9 Add MCP-compliant pagination for list operations
Server authors opt-in by setting list_page_size on FastMCP.
Client convenience methods auto-fetch all pages transparently.
Use _mcp methods with cursor parameter for manual pagination.
2026-01-17 19:30:24 -05:00