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

Open Beginner friendly
#3,978 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
86/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

Open examples/servers/simple-pagination/README.md at the linked example and compare its pagination code with the reported working correction. Start by checking the result’s cursor field and the parameters passed to list_tools. Update the example so it runs against the bundled stdio server and prints the expected two tool pages, resources, and prompts.

Written by the indexing model from the issue text.

Description

v2
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 77001c96.

Area

Documentation

Dominant language
Python
Stars
25k
Forks
4.2k
Avg merge
10m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/python-sdk

All issues in modelcontextprotocol/python-sdk

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.