Skip to content

IMcpResourceClient

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The client that lists and reads an MCP server’s resources.

public interface IMcpResourceClient

Capability checking is mandatory: if the server does not report ServerCapabilities.Resources, the request is never sent.

Only declared URIs can be read. IMcpResourceClient.ReadResourceAsync first compares against the set the server reported via ListResourcesAsync; a URI not in that set is rejected with McpOperationStatus.UriNotDeclared. Otherwise this would be an SSRF tool.

ListResourcesAsync(string, string, CancellationToken)

Section titled “ ListResourcesAsync(string, string, CancellationToken)”

Fetches a server’s resource list.

ValueTask<McpResourceListResult> ListResourcesAsync(string tenantId, string serverName, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

serverName string

The server name.

cancellationToken CancellationToken

The cancellation token.

ValueTask<McpResourceListResult>

ReadResourceAsync(string, string, string, CancellationToken)

Section titled “ ReadResourceAsync(string, string, string, CancellationToken)”

Reads a resource.

ValueTask<(McpOperationStatus Status, McpResourceContent? Content)> ReadResourceAsync(string tenantId, string serverName, string uri, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

serverName string

The server name.

uri string

The URI of the resource to read; must be in the server’s declared set.

cancellationToken CancellationToken

The cancellation token.

ValueTask<(McpOperationStatus Status, McpResourceContent? Content)>