Definition
Assembly: CloudNimble.McpEssentials.Core.dll Namespace: CloudNimble.McpEssentials.Core.Tasks Inheritance: System.ObjectSyntax
Summary
Base type for authenticated MCP task stores. Wires the current-user callback, fail-closed identity, McpTaskStoreBase.InputResponseReceived, flush pulses, and the mapping from IMcpTaskStore / IMcpTaskStorePlus into per-user core methods.Remarks
Subclass and implement theCore methods plus CancellationToken) to
persist snapshots. Create inserts then pulses a throttled flush; get pulses then reads.
Set McpTaskStoreBase.AutoSweep to false and call CancellationToken)
from your own job to own the schedule. Override DateTimeOffset) to change keep
rules. Do not wrap the SDK InMemoryMcpTaskStore; each provider owns its storage.
Constructors
.ctor Inherited
Inherited from
objectSyntax
Properties
AutoSweep Virtual
Gets or sets whether the store pulses a throttled flush after create and on get.Syntax
Property Value
Type:bool
The default is true.
Remarks
Set tofalse and call CancellationToken) from your own job
when you want to own the schedule. The public flush handle always runs a full pass.
DefaultPollIntervalMs Virtual
Gets or sets the default poll interval in milliseconds for new tasks.Syntax
Property Value
Type:long
The default is 1000 milliseconds.
DefaultTimeToLive Virtual
Gets or sets the default time-to-live for new tasks, ornull for unlimited.
Syntax
Property Value
Type:System.Nullable<System.TimeSpan>
Remarks
When set to a positive value, the work window ends atCreatedAt + TimeToLive and
the row is discarded at CreatedAt + 2×TimeToLive (stamped as
StoredMcpTask.DiscardAfter), or sooner when a terminal
GetTaskAsync serves it. A null or non-positive value keeps tasks
until a terminal get or until the store discards them.
ServeAndDrop Virtual
Gets or sets whether an owner get of a terminal snapshot serves it and then drops the row.Syntax
Property Value
Type:bool
The default is true.
SweepInterval Virtual
Gets or sets the minimum interval between automatic flush pulses.Syntax
Property Value
Type:System.TimeSpan
The default is 30 seconds. Zero skips the throttle.
Methods
CreateTaskAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<ModelContextProtocol.Extensions.Tasks.McpTaskInfo>
CreateTaskAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<ModelContextProtocol.Extensions.Tasks.McpTaskInfo>
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetTaskAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<ModelContextProtocol.Extensions.Tasks.McpTaskInfo?>
GetTaskAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<ModelContextProtocol.Extensions.Tasks.McpTaskInfo?>
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
GetUserId
Resolves a stable user identifier from principal.Syntax
Parameters
Returns
Type:string?
The first non-whitespace claim in SDK session-identity order, or null
when the principal is missing or unauthenticated.
Remarks
Claim lookup matches the MCP C# SDK session identity order: NameIdentifier,sub, Upn,
Name, then Name.
The principal must be authenticated.
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
ResolveInputRequestsAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task
ResolveInputRequestsAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task
SetCancelledAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<bool>
SetCancelledAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<bool>
SetCompletedAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task
SetFailedAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task
SetInputRequestsAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task
SweepExpiredAsync Virtual
Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
Events
InputResponseReceived
Syntax
Related APIs
- CloudNimble.McpEssentials.Core.Tasks.IMcpTaskStorePlus
- ModelContextProtocol.Extensions.Tasks.IMcpTaskStore