> ## Documentation Index
> Fetch the complete documentation index at: https://ai.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# McpTaskStoreBuilder

> Selects an [IMcpTaskStorePlus](/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/IMcpTaskStorePlus) provider for `WithTasksPlus` and OData `WithTasks`. Cor...

## Definition

**Assembly:** CloudNimble.McpEssentials.Core.dll

**Namespace:** CloudNimble.McpEssentials.Core.Tasks

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder
```

## Summary

Selects an [IMcpTaskStorePlus](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/IMcpTaskStorePlus.md) provider for `WithTasksPlus` and OData
`WithTasks`. Core ships `McpTaskStoreOptions})`.
Provider packages add `UseEntityFramework`, `UseRedis`, and so on.

## Constructors

### &#x20;.ctor

Initializes a new instance of the [McpTaskStoreBuilder](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/McpTaskStoreBuilder.md) class.

#### Syntax

```csharp theme={"dark"}
public McpTaskStoreBuilder(Microsoft.Extensions.DependencyInjection.IServiceCollection services)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `services` | `Microsoft.Extensions.DependencyInjection.IServiceCollection` | The application service collection. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *services* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### &#x20;CapturedServices

Gets the built [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) after MCP options compose, or
[`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) until the first request.

#### Syntax

```csharp theme={"dark"}
public System.IServiceProvider CapturedServices { get; }
```

#### Property Value

Type: `System.IServiceProvider?`

### &#x20;Services

Gets the application service collection.

#### Syntax

```csharp theme={"dark"}
public Microsoft.Extensions.DependencyInjection.IServiceCollection Services { get; }
```

#### Property Value

Type: `Microsoft.Extensions.DependencyInjection.IServiceCollection`

### &#x20;Store

Gets the store selected by the last `Use*` call.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.McpEssentials.Core.Tasks.IMcpTaskStorePlus Store { get; private set; }
```

#### Property Value

Type: `CloudNimble.McpEssentials.Core.Tasks.IMcpTaskStorePlus?`

## Methods

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

### &#x20;UseEntityFramework Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_EntityFrameworkCore_McpTaskStoreBuilderExtensions`

Uses `EFCoreMcpTaskStore`1\` with a constant owner.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseEntityFramework<TContext>(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, string userId, System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions> configure = null) where TContext : Microsoft.EntityFrameworkCore.DbContext
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `userId` | `string` | The owner stamped on every task this process creates. |
| `configure` | `System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Type Parameters

* `TContext` - The host [DbContext](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.dbcontext) that maps [McpTaskEntity](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/EntityFrameworkCore/Tasks/McpTaskEntity.md).

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |
| `ArgumentException` | Thrown when *userId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or whitespace. |

### &#x20;UseEntityFramework Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_EntityFrameworkCore_McpTaskStoreBuilderExtensions`

Uses `EFCoreMcpTaskStore`1\` with an owner callback.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseEntityFramework<TContext>(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, System.Func<string> getCurrentUserId, System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions> configure = null) where TContext : Microsoft.EntityFrameworkCore.DbContext
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `getCurrentUserId` | `System.Func<string?>` | Returns the current user identifier, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unauthenticated. |
| `configure` | `System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Type Parameters

* `TContext` - The host [DbContext](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.dbcontext) that maps [McpTaskEntity](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/EntityFrameworkCore/Tasks/McpTaskEntity.md).

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* or *getCurrentUserId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseEntityFramework Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_EntityFrameworkCore_McpTaskStoreBuilderExtensions`

Uses `EFCoreMcpTaskStore`1\`, resolving the owner from a principal.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseEntityFramework<TContext>(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, System.Func<System.Security.Claims.ClaimsPrincipal> getPrincipal, System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions> configure = null) where TContext : Microsoft.EntityFrameworkCore.DbContext
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `getPrincipal` | `System.Func<System.Security.Claims.ClaimsPrincipal?>` | Returns the principal for the current request. |
| `configure` | `System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Type Parameters

* `TContext` - The host [DbContext](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.dbcontext) that maps [McpTaskEntity](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/EntityFrameworkCore/Tasks/McpTaskEntity.md).

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* or *getPrincipal* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseEntityFramework Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_EntityFrameworkCore_McpTaskStoreBuilderExtensions`

Uses `EFCoreMcpTaskStore`1\`, resolving the owner from the built provider.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseEntityFramework<TContext>(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, System.Func<System.IServiceProvider, System.Security.Claims.ClaimsPrincipal> getPrincipal, System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions> configure = null) where TContext : Microsoft.EntityFrameworkCore.DbContext
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `getPrincipal` | `System.Func<System.IServiceProvider, System.Security.Claims.ClaimsPrincipal?>` | Returns the principal for the current request. ASP.NET Core hosts pass |
| `sp =&gt; sp.GetRequiredService&lt;IHttpContextAccessor&gt;().HttpContext?.User`. | | |
| `configure` | `System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Type Parameters

* `TContext` - The host [DbContext](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.dbcontext) that maps [McpTaskEntity](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/EntityFrameworkCore/Tasks/McpTaskEntity.md).

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* or *getPrincipal* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseEntityFramework Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_EntityFrameworkCore_McpTaskStoreBuilderExtensions`

Uses `EFCoreMcpTaskStore`1\` with an owner id from the built provider.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseEntityFramework<TContext>(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, System.Func<System.IServiceProvider, string> getCurrentUserId, System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions> configure = null) where TContext : Microsoft.EntityFrameworkCore.DbContext
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `getCurrentUserId` | `System.Func<System.IServiceProvider, string?>` | Returns the current user identifier from the built provider. |
| `configure` | `System.Action<CloudNimble.McpEssentials.EntityFrameworkCore.Tasks.EFCoreMcpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Type Parameters

* `TContext` - The host [DbContext](https://learn.microsoft.com/dotnet/api/microsoft.entityframeworkcore.dbcontext) that maps [McpTaskEntity](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/EntityFrameworkCore/Tasks/McpTaskEntity.md).

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* or *getCurrentUserId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseInMemory

Uses [InMemoryMcpTaskStorePlus](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/InMemoryMcpTaskStorePlus.md) with a constant owner.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseInMemory(string userId, System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `userId` | `string` | The owner stamped on every task this process creates. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
This builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentException` | Thrown when *userId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or whitespace. |

### &#x20;UseInMemory

Uses [InMemoryMcpTaskStorePlus](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/InMemoryMcpTaskStorePlus.md) with an owner callback.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseInMemory(System.Func<string> getCurrentUserId, System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `getCurrentUserId` | `System.Func<string?>` | Returns the current user identifier, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unauthenticated. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
This builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *getCurrentUserId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseInMemory

Uses [InMemoryMcpTaskStorePlus](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/InMemoryMcpTaskStorePlus.md), resolving the owner from a principal.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseInMemory(System.Func<System.Security.Claims.ClaimsPrincipal> getPrincipal, System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `getPrincipal` | `System.Func<System.Security.Claims.ClaimsPrincipal?>` | Returns the principal for the current request. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
This builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *getPrincipal* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseInMemory

Uses [InMemoryMcpTaskStorePlus](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/InMemoryMcpTaskStorePlus.md), resolving the owner from the built
[IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider). ASP.NET Core hosts pass
`sp =&gt; sp.GetRequiredService&lt;IHttpContextAccessor&gt;().HttpContext?.User`.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseInMemory(System.Func<System.IServiceProvider, System.Security.Claims.ClaimsPrincipal> getPrincipal, System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `getPrincipal` | `System.Func<System.IServiceProvider, System.Security.Claims.ClaimsPrincipal?>` | Returns the principal for the current request. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
This builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *getPrincipal* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseInMemory

Uses [InMemoryMcpTaskStorePlus](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/InMemoryMcpTaskStorePlus.md) with an owner id resolved from the built
[IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider).

#### Syntax

```csharp theme={"dark"}
public CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseInMemory(System.Func<System.IServiceProvider, string> getCurrentUserId, System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `getCurrentUserId` | `System.Func<System.IServiceProvider, string?>` | Returns the current user identifier, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unauthenticated. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreOptions>?` | Optional store options (TTL, poll interval). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
This builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *getCurrentUserId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseRedis Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_Redis_McpTaskStoreBuilderExtensions`

Uses [RedisMcpTaskStore](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Redis/Tasks/RedisMcpTaskStore.md) with a constant owner.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseRedis(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, string userId, System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `userId` | `string` | The owner stamped on every task this process creates. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions>?` | Optional store options (TTL, key prefix, replica wait). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |
| `ArgumentException` | Thrown when *userId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or whitespace. |

### &#x20;UseRedis Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_Redis_McpTaskStoreBuilderExtensions`

Uses [RedisMcpTaskStore](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Redis/Tasks/RedisMcpTaskStore.md) with an owner callback.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseRedis(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, System.Func<string> getCurrentUserId, System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `getCurrentUserId` | `System.Func<string?>` | Returns the current user identifier, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unauthenticated. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions>?` | Optional store options (TTL, key prefix, replica wait). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* or *getCurrentUserId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseRedis Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_Redis_McpTaskStoreBuilderExtensions`

Uses [RedisMcpTaskStore](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Redis/Tasks/RedisMcpTaskStore.md), resolving the owner from a principal.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseRedis(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, System.Func<System.Security.Claims.ClaimsPrincipal> getPrincipal, System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `getPrincipal` | `System.Func<System.Security.Claims.ClaimsPrincipal?>` | Returns the principal for the current request. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions>?` | Optional store options (TTL, key prefix, replica wait). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* or *getPrincipal* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseRedis Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_Redis_McpTaskStoreBuilderExtensions`

Uses [RedisMcpTaskStore](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Redis/Tasks/RedisMcpTaskStore.md), resolving the owner from the built provider.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseRedis(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, System.Func<System.IServiceProvider, System.Security.Claims.ClaimsPrincipal> getPrincipal, System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `getPrincipal` | `System.Func<System.IServiceProvider, System.Security.Claims.ClaimsPrincipal?>` | Returns the principal for the current request. ASP.NET Core hosts pass |
| `sp =&gt; sp.GetRequiredService&lt;IHttpContextAccessor&gt;().HttpContext?.User`. | | |
| `configure` | `System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions>?` | Optional store options (TTL, key prefix, replica wait). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* or *getPrincipal* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseRedis Extension

> [!NOTE]
>
> Extension method from `Microsoft.Extensions.DependencyInjection.McpEssentials_Redis_McpTaskStoreBuilderExtensions`

Uses [RedisMcpTaskStore](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Redis/Tasks/RedisMcpTaskStore.md) with an owner id from the built provider.
Resolves `IConnectionMultiplexer` from DI.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseRedis(CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder builder, System.Func<System.IServiceProvider, string> getCurrentUserId, System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions> configure = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder` | The task-store builder. |
| `getCurrentUserId` | `System.Func<System.IServiceProvider, string?>` | Returns the current user identifier from the built provider. |
| `configure` | `System.Action<CloudNimble.McpEssentials.Redis.Tasks.RedisMcpTaskStoreOptions>?` | Optional store options (TTL, key prefix, replica wait). |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
The builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *builder* or *getCurrentUserId* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;UseStore

Registers *store* as the selected provider. Durable packages call this
from their `Use*` extensions.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder UseStore(CloudNimble.McpEssentials.Core.Tasks.IMcpTaskStorePlus store, bool captureProvider = true)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `store` | `CloudNimble.McpEssentials.Core.Tasks.IMcpTaskStorePlus` | The plus store. |
| `captureProvider` | `bool` | When [`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), captures [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) on first options |
| compose so owner factories can resolve scoped services. | | |

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.McpTaskStoreBuilder`
This builder.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *store* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.