Interface McpResourceReadHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Programmatic MCP resource-read handler.

Routing proves neither authorization nor safe dereference. An application that maps a resource URI to a filesystem must canonicalize its configured root and requested target, reject targets outside that root after symlink resolution, authorize the canonical target under the current admitted identity, and address deployment-specific races between validation and opening. Soklet provides no filesystem mapper or containment guarantee.

The application must also define URI policy by delivery intent. A URI permitted for direct client loading may need a different scheme, authority, credential, query, and fragment policy from an application-handler-only URI. Soklet's URI syntax validation and routing do not establish that a URI is safe or consumable for either purpose.

Handlers may complete with McpCompleteResult.fromResourceOutput(McpResourceOutput) or return a declared multi-round-trip result. Implementations must be safe for concurrent invocation.

Author:
Mark Allen