Skip to main content

Pagination & Subscriptions — Resources

← Back to Dashboard
1. Resource Fundamentals2. Resource Templates3. Pagination & Subscriptions

Pagination & Subscriptions

📚 Resources⏱ 9 min⭐ 80 XP⌨ Hands-on lab

Pagination via Cursors

For API endpoints that return massive lists, MCP supports cursor-based pagination. If a resource list response contains too much data, the server returns a nextCursor.

const listResources = async (cursor?: string) => {
  const result = await db.query({ limit: 100, cursor });
  return {
    resources: result.items.map(toResource),
    nextCursor: result.nextCursor
  };
};

Resource Subscriptions & Cache Hints

MCP supports real-time updates! In 2024-11-05–2025-11-25, clients subscribed to individual URIs via resources/subscribe and received notifications/resources/updated. In the 2026-07-28 stateless specification, individual subscribe RPCs were unified into a single filtered stream via subscriptions/listen, and list responses can include HTTP-friendly cache hints (ttlMs and cacheScope).

⌨ HANDS-ON LABSubscribe to Resource Update Notifications
⭐ +150 XP

Subscribe to real-time resource change notifications on a dynamic file URI.

1Send resources/subscribe request over stdio.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 1 — type "hint" if stuck
🧪 Knowledge Check
Press 1-4 to select1 of 3
How does MCP handle massive lists of resources limit-checking?
It streams them over WebSockets.
It zips them into a single file.
It uses standard cursor-based pagination.
It truncates data after 1000 items.