fix(mcp): follow tools/list pagination cursors - #311
Merged
franciscojavierarceo merged 2 commits intoSep 17, 2026
Merged
Conversation
Signed-off-by: Zheng Lu <Lz429671594@gmail.com>
Zheng-Lu
requested review from
bbrowning,
franciscojavierarceo,
haoshan98,
jiahuei,
leseb,
maralbahari,
noobHappylife,
qandrew and
tjtanaa
as code owners
September 15, 2026 14:51
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
franciscojavierarceo
approved these changes
Sep 17, 2026
franciscojavierarceo
left a comment
Collaborator
There was a problem hiding this comment.
patched empty-cursor forwarding and repeated-cursor errors, with regressions verified before and after the fix. all 688 core tests, Clippy, and pre-commit checks pass locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow MCP
tools/listpagination so discovery includes tools beyond the first page.list_tools(None)for the first request and pass each subsequent cursor through unchanged, including empty strings: cursors are opaque tokens.nextCursoris absent. Return typedPaginationLoopfor a repeated cursor andPaginationExceededafter 32 pages instead of returning a partial list.The explicit loop preserves first-page wire compatibility and adds termination guards missing from
rmcp 1.8.0'slist_all_tools().Test Plan
cargo clippy -p agentic-server-core --all-targets -- -D warningspassed.pre-commit run --all-filespassed.