Class McpTasksServerExtensions
- Namespace
- ModelContextProtocol.Extensions.Tasks
- Assembly
- ModelContextProtocol.Extensions.Tasks.dll
Extension methods for task-aware server operations.
public static class McpTasksServerExtensions
- Inheritance
-
McpTasksServerExtensions
- Inherited Members
Methods
CreateMcpTaskScope(McpServer, string, IMcpTaskStore)
Creates a scope that routes server-initiated requests through the specified task store.
public static IDisposable CreateMcpTaskScope(this McpServer server, string taskId, IMcpTaskStore store)
Parameters
serverMcpServerThe server whose outgoing requests should be redirected.
taskIdstringThe related task identifier.
storeIMcpTaskStoreThe task store used to surface input requests.
Returns
- IDisposable
An IDisposable that restores the previous outgoing-request behavior.
SendTaskStatusNotificationAsync(McpServer, TaskStatusNotificationParams, CancellationToken)
Sends a task status notification to the connected client.
public static Task SendTaskStatusNotificationAsync(this McpServer server, TaskStatusNotificationParams notificationParams, CancellationToken cancellationToken = default)
Parameters
serverMcpServerThe server sending the notification.
notificationParamsTaskStatusNotificationParamsThe notification payload.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
A task representing the send operation.