Skip to content

Follow pagination cursors when vMCP queries backends #5746

Closed

Description

@JAORMX

Part of #5743 (Workstream B: 2025-11-25 compliance).

Gap

vMCP queries backends with single tools/list / resources/list / prompts/list calls and never follows nextCursor (pkg/vmcp/client/client.go, queryTools/queryResources/queryPrompts). Backends that paginate get silently truncated after page 1 — missing tools with no error.

This got more urgent with the go-sdk migration: go-sdk-based servers paginate tools/list at 1000 by default, so truncation now happens against our own servers too.

Proposed work

  • Loop on nextCursor in all three query paths until exhausted (with a sane upper bound to protect against misbehaving backends).
  • Add a test with a paginating fake backend.

Priority: High — correctness bug.

Activity

  1. added
    needs-triage
    on Jul 8, 2026
  2. removed
    needs-triage
    on Jul 13, 2026
  3. self-assigned this
    on Jul 23, 2026
  4. JAORMX commented on Jul 23, 2026

    @JAORMX
    CollaboratorAuthor

    Closing as completed — this was implemented but the issue was never auto-closed (the PR used Refs, not Closes).

    Implemented by #5851 ("Follow list pagination cursors in vMCP capability discovery", commit cab6e171), later extended by #5875.

    The fix does exactly what this issue asked:

    • A generic pagination.ListAll helper (pkg/vmcp/internal/pagination/pagination.go) follows nextCursor to exhaustion, with the requested safety bound (repeated-cursor abort + a maxIterations cap).
    • All three query paths now loop cursors — queryTools / queryResources / queryPrompts (plus queryResourceTemplates) in pkg/vmcp/client/client.go, and the per-session connector in pkg/vmcp/session/internal/backend/mcp_session.go.
    • A paginating fake-backend test was added (test/integration/vmcp/pagination_regression_test.go, un-skipped and strengthened to assert the full 1100-tool set with distinct names + last-tool routing), plus unit tests for pagination.ListAll and the per-session path.

    Verified present on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions