Repository navigation
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- 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 existSteps to Reproduce
- Connect Claude Code to an MCP server (or gateway) that exposes more tools than fit on a single page
- The server returns page 1 with nextCursor in the response
- Claude Code displays only the tools from page 1
- Claude Code never sends a follow-up tools/list request with the cursor
- 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
- [FEATURE] tools/list support cursor #8237 — tools/list support cursor (closed as duplicate)
- [ENHANCEMENT] MCP Resources Pagination Support for ListMcpResourcesTool #3141 — MCP Resources Pagination Support (closed due to inactivity, not fixed)
- Claude Code does not follow MCP tools/list pagination (nextCursor) #24785 - Closed due to inactivity, not fixed
Activity
github-actions commentedon Mar 26, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
gpapakyriakopoulos commentedon Mar 26, 2026
Do not close this, it needs to be addressed at some point.
rrajpuro commentedon Apr 6, 2026
Hi maintainers,
Before this issue gets closed, I want to flag an important pattern: related issues #8237, #23179, and #24785 were all previously closed without a fix being shipped. I'd respectfully ask that this issue not be closed as a duplicate for the same reason — the underlying bug has never actually been addressed.
Context: AWS Bedrock AgentCore Use Case
We are running Claude Code against an AWS Bedrock AgentCore MCP gateway. This gateway exposes a large number of tools and returns a paginated
tools/listresponse that includes anextCursorfield when there are more tools available beyond the first page.The problem is that Claude Code only fetches the first 30 tools and does not follow the
nextCursorto retrieve subsequent pages. This means any tools beyond the first page are silently invisible to the agent.Why This Matters
This behavior violates the MCP specification, which explicitly requires clients to follow
nextCursorpagination until the cursor is absent (i.e., all pages have been fetched). A spec-compliant MCP client must not stop after the first page.The impact is significant for gateway-style MCP deployments (like Bedrock AgentCore, or any enterprise tool catalog) where the tool count easily exceeds a single page. Users in these environments have no workaround short of reducing their tool set.
Request
Please treat this as a spec compliance bug rather than a feature request, and consider keeping it open until pagination is properly implemented in the MCP client layer.
Thank you for your time and attention on this.
cdapprich-bt commentedon Apr 14, 2026
I was able to reproduce this with a similar AWS Bedrock AgentCore gateway configuration:
nextCursorviacurlretrieves all 81 tools correctly.This confirms the issue across platforms (Windows v2.1.108) and with higher tool counts spanning 3+ pages.
maekawataiki commentedon Apr 15, 2026
For anyone experiencing the same issue, here's a temporary workaround while we wait for official support in Claude Code.
I've implemented an API Gateway proxy with AWS Lambda that handles pagination and returns the concatenated tools. You can find my implementation here:
https://github.com/maekawataiki/sample-agentcore-gateway-claude-code/blob/main/cdk/lambda/mcp_oauth_proxy.py#L482
gpapakyriakopoulos commentedon Apr 15, 2026
The thing is this repository has 9400 open issues at the time of writing. There is no way any development team in the world is ever sorting out through all these, let alone the 5-10 new ones that pop-up every hour. So I don't expect issues like that to ever be fixed.
txtade commentedon Apr 17, 2026
This is not a duplicate of the suggested issues. Those involve tools not loading at all in Claude Code CLI or VS Code. My issue is specific to Claude Desktop Chat loading a partial tool set from a Craft MCP server, while the same endpoint loads all tools correctly in Cowork. The issue is partial tool manifest loading in Claude Desktop specifically, not a general MCP tool registration failure.
rrajpuro commentedon Apr 17, 2026
Might have to dig into the logs of how Claude desktop handles MCP loading, but if its anythin similar to ClaudeCode then probably a pagination issue
claude commentedon May 19, 2026
This is a duplicate of #59538, which was fixed as of version 2.1.144.
griffithsbs commentedon Jun 8, 2026
The same bug has long existed in Claude for Desktop: has it been fixed there too?
The many related issues mostly seem to be filed against Claude Code but the Desktop MCP client has the identical defect: it sends a single tools/list request and silently discards nextCursor, so any tool past the first page is never registered and can't be called.
What the problem looks like in our setup (Desktop + AWS Bedrock AgentCore gateway):
Impact: We've had to hard-cap every MCP server at 30 tools as a workaround, purely to stay under the gateway's single-page limit. That's a real constraint on tool design and rules out the multi-target gateway aggregation pattern that AgentCore is built for. And it feels a much bigger constraint in the desktop environment than it does in Claude Code, since Claude for Desktop users don't want to have to think about connecting a dozen different small custom connectors and keeping them authenticated
github-actions commentedon Aug 10, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.