Class McpTasksBuilderExtensions
- Namespace
- ModelContextProtocol.Extensions.Tasks
- Assembly
- ModelContextProtocol.Extensions.Tasks.dll
Extension methods for IMcpServerBuilder to enable MCP Tasks support.
public static class McpTasksBuilderExtensions
- Inheritance
-
McpTasksBuilderExtensions
- Inherited Members
Methods
WithTasks(IMcpServerBuilder, IMcpTaskStore)
Enables MCP Tasks support backed by the specified task store.
public static IMcpServerBuilder WithTasks(this IMcpServerBuilder builder, IMcpTaskStore store)
Parameters
builderIMcpServerBuilderThe server builder.
storeIMcpTaskStoreThe task store.
Returns
- IMcpServerBuilder
The builder provided in
builder.
Remarks
Tasks are implemented as an alternate-result call-tool filter. Alternate-result filters registered before the Tasks filter run before task creation. Filters registered after it, along with all ordinary call-tool filters, run in the background before the tool.
WithTasks(IMcpServerBuilder, IMcpTaskStore, Action<McpTasksOptions>)
Enables MCP Tasks support backed by the specified task store.
public static IMcpServerBuilder WithTasks(this IMcpServerBuilder builder, IMcpTaskStore store, Action<McpTasksOptions> configure)
Parameters
builderIMcpServerBuilderThe server builder.
storeIMcpTaskStoreThe task store.
configureAction<McpTasksOptions>A callback that configures per-call task execution behavior.
Returns
- IMcpServerBuilder
The builder provided in
builder.