GitHub Repo
Dify Community Proposes MCP Pagination Fix After Tool Discovery May Silently Miss Tools Beyond the First Page
A report from the Dify community on October 10 found that the MCP client does not track pagination cursors, so it may retrieve only the server’s first page of tools. The proposed fix includes partial regression tests but has not been merged; the full deployment and verification process remains to be confirmed.

On October 10, the Dify community reported an MCP tool discovery defect: MCPClient.list_tools() returns the tool list immediately after retrieving the first page, without using the response’s nextCursor. The reporter reproduced the issue using version 1.17.1 and the source code on main at the time. If a server paginates its tools, later tools may silently disappear. This was a local backend module test, not an end-to-end verification of a complete Dify deployment. Issue report
The minimal reproduction uses Dify’s native client, session, and JSON-RPC types with an in-memory mock server. The first page provides alpha and a cursor; the second page is set up to provide beta. In practice, only one request is made, and the result contains only alpha. If the first page is empty but has a next page, the returned list will also be empty. The report notes that the client reads only response.tools, while the underlying session method has no cursor parameter. Reproduction details
The MCP pagination specification lists tools/list as an operation that supports pagination. The server determines the page size, and clients should support both paginated and non-paginated flows. They should pass nextCursor unchanged as params.cursor in the next request; the cursor must be treated as an opaque string and should not be parsed or modified. Therefore, a successful connection and a normal response from the first page are not enough to establish that the tool list is complete. MCP pagination specification
Proposed fix #43842 adds an optional cursor to the session, allowing the client to accumulate tools page by page while preserving their order; it throws an error if it encounters a duplicate or cyclic cursor. The author reports that seven new tests and 29 existing tests pass, and that the tests cover reconnecting and fetching again from the first page after an authentication failure on a later page. However, the authentication and transport boundaries are mocked, and full backend, Docker, and database integration have not been verified. The proposal is still awaiting review. Fix and tests
For engineering teams, this means the candidate tools visible to an agent may depend on how the server paginates, potentially limiting the capabilities available for a task. This impact is an inference based on the discovery flow; no public measurements of task success rates are available. When connecting a large tool directory, teams can first compare the server’s list with the names retrieved by Dify, and test empty first pages and reconnection scenarios. Next, they should track whether the fix is merged, its release in an official version, and integration results with a real paginated service.