Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cec5d99
Remove SEP-1686 experimental tasks
PranavSenthilnathan May 15, 2026
142a8b3
Merge branch 'main' of https://github.com/modelcontextprotocol/csharp…
PranavSenthilnathan May 15, 2026
b1cc0a6
Add DTOs
PranavSenthilnathan May 19, 2026
59da0c7
Client changes
PranavSenthilnathan May 21, 2026
dd1d2a0
Handlers
PranavSenthilnathan May 21, 2026
bbaee1d
tests
PranavSenthilnathan May 21, 2026
eaa7f1c
Add a store and handle input required
PranavSenthilnathan May 23, 2026
34a0999
Add more tests
PranavSenthilnathan May 29, 2026
d4905fa
cleanup
PranavSenthilnathan May 29, 2026
e47ced7
edge cases
PranavSenthilnathan May 29, 2026
2dd629c
Merge remote-tracking branch 'upstream/main' into new-tasks
PranavSenthilnathan May 29, 2026
12c522f
Merge upstream/main; integrate tasks input-requests with MRTR types
PranavSenthilnathan Jun 5, 2026
17f95f7
Fix _meta
PranavSenthilnathan Jun 10, 2026
8b47086
Address PR feedback: typed Failed payload, orphan task fix, MRTR catch
PranavSenthilnathan Jun 10, 2026
0b8944f
Address PR feedback: docs, tests, and rename TaskResult to Result
PranavSenthilnathan Jun 10, 2026
5050d79
Make MaxConsecutiveStuckPolls configurable on McpClientOptions
PranavSenthilnathan Jun 10, 2026
29ca3e7
Add TasksExtension sample and fix two stale references in tasks.md
PranavSenthilnathan Jun 10, 2026
b1d3786
Merge upstream/main; resolve McpServer.Methods.cs <remarks> conflicts
PranavSenthilnathan Jun 11, 2026
81da12f
Fix AoT serialization errors
PranavSenthilnathan Jun 11, 2026
6e485a9
Order notification round-trip test by server-set LastUpdatedAt
PranavSenthilnathan Jun 11, 2026
8ba52bf
Fix docfx UidNotFound and InvalidBookmark warnings
PranavSenthilnathan Jun 11, 2026
1d3ebb8
Sync AddIncomingMessageFilter_Intercepts_Request_Messages on initiali…
PranavSenthilnathan Jun 11, 2026
d8aeb4e
Add CompatibilitySuppressions.xml for MRTR (SEP-1686) removal
PranavSenthilnathan Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<!-- Product dependencies .NET Standard -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageVersion Include="Microsoft.Bcl.Memory" Version="$(System10Version)" />
<PackageVersion Include="System.Collections.Immutable" Version="$(System10Version)" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(System10Version)" />
<PackageVersion Include="System.IO.Pipelines" Version="$(System10Version)" />
<PackageVersion Include="System.Text.Json" Version="$(System10Version)" />
Expand Down
2 changes: 1 addition & 1 deletion ModelContextProtocol.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
<Project Path="samples/ChatWithTools/ChatWithTools.csproj" />
<Project Path="samples/EverythingServer/EverythingServer.csproj" />
<Project Path="samples/InMemoryTransport/InMemoryTransport.csproj" />
<Project Path="samples/LongRunningTasks/LongRunningTasks.csproj" />
<Project Path="samples/ProtectedMcpClient/ProtectedMcpClient.csproj" />
<Project Path="samples/ProtectedMcpServer/ProtectedMcpServer.csproj" />
<Project Path="samples/QuickstartClient/QuickstartClient.csproj" />
<Project Path="samples/QuickstartWeatherServer/QuickstartWeatherServer.csproj" />
<Project Path="samples/TasksExtension/TasksExtension.csproj" />
<Project Path="samples/TestServerWithHosting/TestServerWithHosting.csproj" />
</Folder>
<Folder Name="/Solution Items/">
Expand Down
8 changes: 4 additions & 4 deletions docs/concepts/stateless/stateless.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ In stateless mode, each HTTP request creates and disposes a short-lived `McpServ

## Tasks and session modes

[Tasks](xref:tasks) enable a "call-now, fetch-later" pattern for long-running tool calls. Task support depends on having an <xref:ModelContextProtocol.IMcpTaskStore> configured (`McpServerOptions.TaskStore`), and behavior differs between session modes.
[Tasks](xref:tasks) enable a "call-now, fetch-later" pattern for long-running tool calls. Task support depends on having an <xref:ModelContextProtocol.Server.IMcpTaskStore> configured (`McpServerOptions.TaskStore`), and behavior differs between session modes.

### Stateless mode

Expand All @@ -578,9 +578,9 @@ In stateless mode, there is no `SessionId`, so the task store does not apply ses

### Stateful mode

In stateful mode, the `IMcpTaskStore` receives the session's `SessionId` on every operation — `CreateTaskAsync`, `GetTaskAsync`, `ListTasksAsync`, `CancelTaskAsync`, etc. The built-in <xref:ModelContextProtocol.InMemoryMcpTaskStore> enforces session isolation: tasks created in one session cannot be accessed from another.
In stateful mode, the `IMcpTaskStore` receives the session's `SessionId` on every operation — `CreateTaskAsync`, `GetTaskAsync`, `ListTasksAsync`, `CancelTaskAsync`, etc. The built-in <xref:ModelContextProtocol.Server.InMemoryMcpTaskStore> enforces session isolation: tasks created in one session cannot be accessed from another.

Tasks can outlive individual HTTP requests because the tool executes in the background after returning the initial `CreateTaskResult`. Task cleanup is governed by the task's TTL (time-to-live), not by session termination. However, the `InMemoryMcpTaskStore` loses all tasks if the server process restarts. For durable tasks, implement a custom <xref:ModelContextProtocol.IMcpTaskStore> backed by an external store. See [Fault-tolerant task implementations](xref:tasks#fault-tolerant-task-implementations) for guidance.
Tasks can outlive individual HTTP requests because the tool executes in the background after returning the initial `CreateTaskResult`. Task cleanup is governed by the task's TTL (time-to-live), not by session termination. However, the `InMemoryMcpTaskStore` loses all tasks if the server process restarts. For durable tasks, implement a custom <xref:ModelContextProtocol.Server.IMcpTaskStore> backed by an external store. See [Implementing a custom task store](xref:tasks#implementing-a-custom-task-store) for guidance.

### Task cancellation vs request cancellation

Expand Down Expand Up @@ -632,7 +632,7 @@ The `EventStreamStore` itself has TTL-based limits (default: 2-hour event expira

### With tasks (experimental)

[Tasks](xref:tasks) are an experimental feature that enables a "call-now, fetch-later" pattern for long-running tool calls. When a client sends a task-augmented `tools/call` request, the server creates a task record in the <xref:ModelContextProtocol.IMcpTaskStore>, starts the tool handler as a fire-and-forget background task, and returns the task ID immediately — the POST response completes **before the handler starts its real work**.
[Tasks](xref:tasks) are an experimental feature that enables a "call-now, fetch-later" pattern for long-running tool calls. When a client sends a task-augmented `tools/call` request, the server creates a task record in the <xref:ModelContextProtocol.Server.IMcpTaskStore>, starts the tool handler as a fire-and-forget background task, and returns the task ID immediately — the POST response completes **before the handler starts its real work**.

This means:

Expand Down
Loading
Loading