You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issue Report: Infinite Loop in MCP Client When Handling Empty nextCursor During Tool Listing #628
Infinite Loop in MCP Client When Processing Empty nextCursor During listTools() Call
2. Description
The MCP Java SDK client enters an infinite loop when processing the /tools response from Alibaba Cloud DashScope MCP applications. The client incorrectly interprets an empty nextCursor value ("") as a signal to continue pagination, resulting in repeated requests that eventually time out (10s default timeout).
Affected SDK Version: io.modelcontextprotocol.client:client-java:0.14.1 (and likely all prior versions)
3. Steps to Reproduce
Configure MCP client to connect to Alibaba Cloud DashScope MCP application with market-cmapi00035184 (Global IP Geolocation)
[DEBUG] Sending message for method tools/list (ID: 2e9e1828-904)
[DEBUG] Received JSON message: {"jsonrpc":"2.0","id":"2e9e1828-904","result":{"nextCursor":"","tools":[...]}}
[DEBUG] Sending message for method tools/list (ID: 2e9e1828-905)
[DEBUG] Received JSON message: {"jsonrpc":"2.0","id":"2e9e1828-905","result":{"nextCursor":"","tools":[...]}}
[DEBUG] Sending message for method tools/list (ID: 2e9e1828-906)
...
[ERROR] TimeoutException: Did not observe any item within 10000ms
Activity
chemicL commentedon Feb 20, 2026
This looks like a duplicate of #575. Please reopen if I'm mistaken.
io.modelcontextprotocol.client.McpAsyncClient#listTools()never returns if theresult.nextCursor()is an empty string instead of a null #575