fix(mcp): paginate tools/resources/prompts discovery via nextCursor#1256
Open
Liu-Vince wants to merge 2 commits intoHmbown:mainfrom
Open
fix(mcp): paginate tools/resources/prompts discovery via nextCursor#1256Liu-Vince wants to merge 2 commits intoHmbown:mainfrom
Liu-Vince wants to merge 2 commits intoHmbown:mainfrom
Conversation
MCP servers may return paginated results from list endpoints. The previous implementation made a single request and stopped, silently dropping any subsequent pages. Servers that paginate at fewer items than their total tool count (e.g. 5 per page) would appear to expose only those first few tools. Follow nextCursor across all four discovery methods (tools, resources, resource templates, prompts) until the server signals no more pages. Fixes Hmbown#1250
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
LiangJianJi
pushed a commit
to LiangJianJi/DeepSeek-TUI
that referenced
this pull request
May 9, 2026
…mbown#1250, Hmbown#1256) MCP servers are allowed by spec to paginate list responses. The old implementation made a single request and stopped, silently dropping subsequent pages. Servers that paginate at fewer items than their total tool count (e.g. gbrain at 5 per page) would appear to expose only those first few tools. All four discovery methods now follow nextCursor until the server signals no more pages, accumulating results across all pages: - discover_tools - discover_resources - discover_resource_templates - discover_prompts Thanks to Liu-Vince for the original diagnosis and fix (PR Hmbown#1256).
LiangJianJi
pushed a commit
to LiangJianJi/DeepSeek-TUI
that referenced
this pull request
May 9, 2026
Version bump: 0.8.23 → 0.8.24 in workspace Cargo.toml. CHANGELOG entries for: - Workspace-local slash commands (Hmbown#1259) - @-completion for gitignored dot-dirs - MCP paginated discovery via nextCursor (Hmbown#1250, Hmbown#1256, credit Liu-Vince) - Snapshot disk-space cap at 500 MB (Hmbown#1112, credit Giggitycountless) - /clear resets Todos sidebar (Hmbown#1258) - Language directive strengthened against project-context bias - Known issue: Windows flicker (Hmbown#1260, Hmbown#1251) — viewport-reset escape sequence on Windows conhost, investigation in progress
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.
Problem
MCP servers are allowed by spec to paginate
tools/list,resources/list,resources/templates/list, andprompts/listresponses. When a server paginates at N items per page (e.g. gbrain paginates at 5), the previous implementation would silently stop after the first page, making it appear as if only those N tools existed.This caused the symptom reported in #1250: only the first 5 alphabetically-sorted tools were loaded, regardless of how many the server actually exposed.
Fix
All four discovery methods now follow
nextCursoruntil the server signals no more pages, accumulating results across all pages before completing.The non-paginating path (servers that return all results in one response with no
nextCursor) is unchanged in behavior.Testing
nextCursor, the loop exits after the first response exactly as before.Fixes #1250