Skip to content

Server should handle paginated requests #967

Description

@denniskawurek

Expected Behavior

The server should handle paginated requests per specification.

Current Behavior

Currently, the whole list is returned on list requests.

Context

When a server contains big lists of tools, prompts, etc. the requests may put too much load on the server or take too long.
The code has TODOs at some of the affected places.

Activity

  1. added
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    enhancementNew feature or request
    on Jun 24, 2026
  2. added this to the 2.1.0 Planning milestone on Jun 24, 2026
  3. Zhuoxi2000 commented on Jul 27, 2026

    @Zhuoxi2000

    I’d like to work on this, but wanted to check the scope first per CONTRIBUTING.

    The approach I have in mind is to honor params.cursor in the server-side list handlers that currently return the full list: tools/list, resources/list, resources/templates/list, and prompts/list.

    For the cursor, I’d use an opaque base64 token over a stable snapshot of the registration list, with invalid cursors returning JSON-RPC -32602. Page size would be configurable on the server builder and default to the current behavior, so existing clients won’t see pagination unless it’s explicitly enabled.

    I’d also add tests following the record-evolution rules in CONTRIBUTING.

    Does that match what you had in mind for the 2.1.0 milestone? If so, I’m happy to open a PR.

  4. denniskawurek commented on Jul 27, 2026

    @denniskawurek
    ContributorAuthor

    Hello @Zhuoxi2000 ,

    You can check the following PR which implements a solution for the pagination: #140

  5. Zhuoxi2000 commented on Jul 27, 2026

    @Zhuoxi2000

    Thanks @denniskawurek . I hadn't found #140 from the issue, since the PR predates it. I won't duplicate the work.

  6. added
    P3Nice to haves, rare edge cases
    and removed
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to haves, rare edge casesarea/serverenhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions