Skip to main content
sunpeak API

Overview

Returns a function to read a resource from the originating MCP server. The request is proxied through the host. Use useListServerResources to discover available resources first.

Wraps readServerResource

MCP Apps SDK reference

Import

Signature

ReadServerResourceParams

uri
string
required
URI of the resource to read (e.g. file:///path or a custom scheme like videos://intro).

Returns

readServerResource
(params: ReadServerResourceParams) => Promise<ReadServerResourceResult | undefined>
Function to read a server resource by URI.

ReadServerResourceResult

contents
Array<{ uri: string; mimeType?: string; text?: string; blob?: string }>
required
Resource contents returned by the server. Each item contains either text (UTF-8 string) or blob (base64-encoded binary).

Usage