listAllResources() when you want the complete resource list. It follows
pagination cursors for you and returns { resources }.
Paginate resources
listResources(cursor?) returns an envelope with resources and an optional
nextCursor. Handle the cursor yourself when you want to process one page at a
time:
Resource templates
Parameterized URIs such asdb://users/{id} are discovered with
listResourceTemplates(). Its result contains resourceTemplates and may
contain nextCursor. The current MCPConnection method retrieves the first
template page and does not accept a cursor argument.
readResource(uri).
Subscribe to updates
If the server supports resource subscriptions, subscribe and unsubscribe with the same concrete URI:React
useMcpServer exposes the resource contents envelope returned by
readResource(uri):
Reference
MCPConnection —
listResources, listAllResources, listResourceTemplates, readResource,
subscribeToResource, and unsubscribeFromResource.