[BUG] Claude Code does not follow MCP tools/list pagination (nextCursor)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code does not follow nextCursor pagination when calling tools/list on MCP servers. It fetches only the first page of tools and silently discards any nextCursor in the response. This means tools beyond the first page are invisible and uncallable.
What Should Happen?
The MCP Specification (2025-06-18) states:
Clients SHOULD support both paginated and non-paginated flows for all list endpoints.
tools/list is one of the four paginated list endpoints.
Claude Code should follow the MCP pagination protocol:
cursor = None
all_tools = []
while True:
response = session.list_tools(cursor)
all_tools.extend(response.tools)
if not response.nextCursor:
break
cursor = response.nextCursor
This is the same pattern shown in the AWS AgentCore docs and the MCP specification.
Error Messages/Logs
* Any MCP server or gateway that paginates tools/list will have tools silently dropped
* The built-in x_amz_bedrock_agentcore_search tool can find page-2 tools, but they still cannot be called because Claude Code never registered them
* This breaks the intended workflow for gateways aggregating tools from multiple backend servers (a common enterprise pattern)
* Users see a subset of their tools with no indication that more exist
Steps to Reproduce
1) Connect Claude Code to an MCP server (or gateway) that exposes more tools than fit on a single page
2) The server returns page 1 with nextCursor in the response
3) Claude Code displays only the tools from page 1
4) Claude Code never sends a follow-up tools/list request with the cursor
5) All tools on subsequent pages are completely invisible
Concrete example: AWS Bedrock AgentCore Gateway paginates tools/list at 30 tools per page. When connecting through a gateway with multiple MCP server targets totaling 48 tools, Claude Code only sees the first 30. The remaining 18 tools are undiscoverable and uncallable. The AgentCore documentation explicitly shows pagination handling code for tools/list — Claude Code should do the same.
Verified via server-side logs:
{
"result_keys": ["tools", "nextCursor"],
"tool_count": 30,
"has_next_cursor": true
}
Only one tools/list request is ever sent per session — no follow-up with the cursor.
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.84
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Related
- https://github.com/anthropics/claude-code/issues/8237 — tools/list support cursor (closed as duplicate)
- https://github.com/anthropics/claude-code/issues/3141 — MCP Resources Pagination Support (closed due to inactivity, not fixed)
- https://github.com/anthropics/claude-code/issues/24785 - Closed due to inactivity, not fixed
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗