Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.AspNetCore.dll Namespace: Microsoft.OData.Mcp.AspNetCore.Hosting Inheritance: System.Object

Syntax

Summary

Configures OData MCP Tasks on AddODataMcp. Hosts call ODataMcpServerBuilder.WithTasks and WaitForAnnotatedAction“1 here, not on UseODataMcp and not via SDK WithTasks from app code.

Examples

Constructors

.ctor Inherited

Inherited from object

Syntax

Properties

Server

Gets the SDK builder already used for WithHttpTransport and catalog handlers. Hosts may attach logging filters. They must not call SDK WithTasks on it.

Syntax

Property Value

Type: Microsoft.Extensions.DependencyInjection.IMcpServerBuilder

Methods

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?

WaitForAnnotatedAction

Registers the host waiter used after URL elicitation is accepted.

Syntax

Returns

Type: Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpServerBuilder This builder.

Type Parameters

  • TWaiter - The waiter type.

Remarks

Required for Succeeded after elicitation. Without it, the call completes with the Started payload after the URL is shown.

WithTasks

Enables MCP Tasks for annotated actions only, using InMemoryMcpTaskStorePlus. Authenticated callers are isolated by user id. Unauthenticated callers share owner UnauthenticatedTaskOwner and the task id is the secret.

Syntax

Returns

Type: Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpServerBuilder This builder.

WithTasks

Enables MCP Tasks and selects a plus store provider.

Syntax

Parameters

Returns

Type: Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpServerBuilder This builder.

Exceptions

Examples

WithTasks

Enables MCP Tasks for annotated actions only. CRUD, functions, and unannotated actions stay one-shot.

Syntax

Parameters

Returns

Type: Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpServerBuilder This builder.

Exceptions

Remarks

Wires tasks/get, tasks/update, and tasks/cancel from ModelContextProtocol.Extensions.Tasks. Does not wrap every catalog tool: the execution-mode selector returns Optional only for annotated actions whose request advertised the Tasks extension. Stamps DefaultTimeToLive on IMcpTaskStorePlus so Claude Code receives ttlMs.