Skip to content

[v2] Simple pagination README client fails before fetching the second tools page #3978

Backlog

Description

@saggl

What happened?

I ran the README example against the bundled stdio server with mcp 2.3.0. It printed First page: 5 tools and exited with AttributeError: 'ListToolsResult' object has no attribute 'nextCursor'.

The example needs to read next_cursor and pass it to ClientSession.list_tools(params=PaginatedRequestParams(cursor=cursor)). I reran the corrected example. It printed cursor 5, five tools on the second page, ten resources, and seven prompts, and exited successfully.

Codex helped diagnose the issue, wrote the local correction, and drafted this report. I ran both versions and checked the output.

What did you expect?

Running the example against the bundled stdio server should print five tools on the first page, cursor 5, five tools on the second page, ten resources, and seven prompts.

Code to reproduce

https://github.com/modelcontextprotocol/python-sdk/blob/77001c96f9507be0f4d009b83210a384a5e08bda/examples/servers/simple-pagination/README.md#example

SDK version

mcp 2.3.0, Python 3.14.4. Also reproduced on main at 77001c9.

Area

Documentation

Activity

  1. added
    v2
    on Dec 5, 2026
  2. zmjj-kk commented on Dec 5, 2026

    @zmjj-kk

    Thanks for the reproducible report. If you aren't planning to submit your local correction yourself, I'd be happy to update the pagination example and verify the complete stdio example against the current SDK, including fetching the second tools page. Would you welcome a small PR?

  3. saggl commented on Dec 5, 2026

    @saggl
    Author

    Thanks for offering! I’d like to submit the fix myself if a maintainer assigns me the issue. I ran the corrected README example against the bundled stdio server on mcp 2.3.0 and confirmed it fetched the second page of five tools.

    Codex helped draft this reply.

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

    v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions