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.
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
-
Method Summary
Modifier and TypeMethodDescriptionhandle(@NonNull McpRequestContext requestContext, @NonNull McpResourceReadContext resourceReadContext, @NonNull McpInvocationFeatures invocationFeatures) Reads one routed resource under application authorization and policy.
-
Method Details
-
handle
@NonNull McpOperationResult handle(@NonNull McpRequestContext requestContext, @NonNull McpResourceReadContext resourceReadContext, @NonNull McpInvocationFeatures invocationFeatures) throws Exception Reads one routed resource under application authorization and policy.- Parameters:
requestContext- request metadataresourceReadContext- resolved resource URI and template variablesinvocationFeatures- invocation-scoped optional features- Returns:
- recognized non-null operation result
- Throws:
Exception- if application handling fails
-