Commit b37e901
Extract Tasks into ModelContextProtocol.Extensions.Tasks package
- Create src/ModelContextProtocol.Extensions.Tasks/ with csproj, JSON context,
server builder extensions, client extension methods
- Move task protocol DTOs (CreateTaskResult, GetTaskResult, UpdateTask*,
CancelTask*, McpTaskStatus, TaskStatusNotificationParams) to extension
- Move server types (IMcpTaskStore, InMemoryMcpTaskStore, McpTaskInfo,
InputResponseReceivedEventArgs) to extension
- Move task constants (RequestMethods.Tasks*, NotificationMethods.TaskStatus*,
MetaKeys.RelatedTask, McpExtensions.Tasks) into TasksProtocol static class
- Delete McpTaskExecutionContext, ResultOrCreatedTask from Core
- Remove ~18 task [JsonSerializable] entries from McpJsonUtilities
- Remove McpServerOptions.TaskStore and McpClientOptions.MaxConsecutiveStuckPolls
- Remove task client methods from McpClient (CallToolRawAsync, PollTaskToCompletion,
GetTaskAsync, UpdateTaskAsync, CancelTaskAsync, GetMetaWithTaskCapability,
ThrowIfTasksNotSupported)
- Remove task server methods/handlers (GetTaskHandler, UpdateTaskHandler,
CancelTaskHandler, ConfigureTasks, InvokeToolAsTask, task cancellation sources)
- Add Tasks_DiagnosticId (MCPEXP001) to Experimentals.cs
- Extension WithTasks(store) registers request handlers via seam #1,
alternate filter via seam #2, interceptor via seam #3
- Extension client methods: CallToolAsTaskAsync, CallToolWithPollingAsync,
GetTaskAsync, UpdateTaskAsync, CancelTaskAsync
- Manually serialize/deserialize InputResponses in UpdateTaskAsync to handle
internal Core property visibility across assembly boundary
- Update test project and TasksExtension sample to reference new package
- Update all task test files with new using and extension API
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 7ff51fc commit b37e901
53 files changed
Lines changed: 1321 additions & 1394 deletions
File tree
- samples/TasksExtension
- src
- ModelContextProtocol.Core
- Client
- Protocol
- Server
- ModelContextProtocol.Extensions.Tasks
- Client
- Protocol
- Server
- tests/ModelContextProtocol.Tests
- Client
- Protocol
- Server
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 5 | + | |
11 | 6 | | |
12 | 7 | | |
13 | 8 | | |
14 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
15 | 13 | | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
43 | 39 | | |
44 | | - | |
45 | | - | |
| 40 | + | |
| 41 | + | |
46 | 42 | | |
47 | 43 | | |
48 | | - | |
49 | | - | |
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
| |||
70 | 64 | | |
71 | 65 | | |
72 | 66 | | |
73 | | - | |
74 | 67 | | |
75 | 68 | | |
76 | 69 | | |
| |||
88 | 81 | | |
89 | 82 | | |
90 | 83 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 84 | | |
95 | 85 | | |
96 | 86 | | |
| |||
101 | 91 | | |
102 | 92 | | |
103 | 93 | | |
104 | | - | |
105 | | - | |
106 | 94 | | |
107 | 95 | | |
108 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
0 commit comments