Skip to main content

Definition

Assembly: CloudNimble.McpEssentials.Core.dll Namespace: CloudNimble.McpEssentials.Core.Tasks

Syntax

Summary

The McpEssentials task store: SDK IMcpTaskStore plus owner binding, TTL, and sweep.

Remarks

SEP-2663 binds each task to an authorization context. This interface is that store. The SDK calls the IMcpTaskStore methods, which have no user parameter; implementations resolve the owner from the callback captured at construction. Hosts that already have a ClaimsPrincipal call the overloads directly. Client-facing operations (create, get, cancel, resolve) require an owner and treat another caller’s task as missing. Server-side completion skips the live-owner check because the SDK runs those from a background DI scope after the originating request is gone.

Properties

DefaultTimeToLive Abstract

Gets or sets the default time-to-live for new tasks, or null for unlimited.

Syntax

Property Value

Type: System.Nullable<System.TimeSpan>

Methods

CreateTaskAsync Abstract

Creates a new task owned by user.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task<ModelContextProtocol.Extensions.Tasks.McpTaskInfo> A McpTaskInfo with a unique task id, initial status of Working, and timing metadata.

Exceptions

GetTaskAsync Abstract

Retrieves the current state of a task when user owns it.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task<ModelContextProtocol.Extensions.Tasks.McpTaskInfo?> The current task state, or null when the task is missing, expired, or owned by another user.

Exceptions

ResolveInputRequestsAsync Abstract

Removes matched input requests and raises InputResponseReceived when user owns the task.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task

Exceptions

SetCancelledAsync Abstract

Transitions the task to Cancelled when user owns it.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task<bool> true when the task was cancelled; false when the task is missing, expired, already terminal, or owned by another user.

Exceptions

SweepExpiredAsync Abstract

Removes snapshots the store’s discard criteria say are gone.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task A task that completes when the pass finishes.

Exceptions

Remarks

Always runs a full pass. Automatic create/get pulses are separate and throttled. Set AutoSweep to false and call this method from your own job when you want to own the schedule.
  • ModelContextProtocol.Extensions.Tasks.IMcpTaskStore