Skip to content

Commit 31e2e47

Browse files
Copilotstephentoub
andcommitted
Add MCP Extensions support to ClientCapabilities and ServerCapabilities
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent ee37372 commit 31e2e47

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

docs/list-of-diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ If you use experimental APIs, you will get one of the diagnostics shown below. T
2323

2424
| Diagnostic ID | Description |
2525
| :------------ | :---------- |
26-
| `MCPEXP001` | MCP task-related APIs are experimental. Tasks provide a mechanism for asynchronous long-running operations that can be polled for status and results. See [MCP Tasks specification](https://modelcontextprotocol.io/specification/draft/basic/utilities/tasks) for details. |
26+
| `MCPEXP001` | MCP experimental APIs including Tasks and Extensions. Tasks provide a mechanism for asynchronous long-running operations that can be polled for status and results (see [MCP Tasks specification](https://modelcontextprotocol.io/specification/draft/basic/utilities/tasks)). Extensions provide a framework for extending the Model Context Protocol while maintaining interoperability (see [SEP-2133](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2133)). |

src/ModelContextProtocol.Core/Protocol/ClientCapabilities.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.ComponentModel;
2+
using System.Diagnostics.CodeAnalysis;
23
using System.Text.Json.Serialization;
34
using ModelContextProtocol.Client;
45
using ModelContextProtocol.Server;
@@ -82,4 +83,23 @@ public sealed class ClientCapabilities
8283
/// </remarks>
8384
[JsonPropertyName("tasks")]
8485
public McpTasksCapability? Tasks { get; set; }
86+
87+
/// <summary>
88+
/// Gets or sets optional MCP extensions that the client supports.
89+
/// </summary>
90+
/// <remarks>
91+
/// <para>
92+
/// Keys are extension identifiers in reverse domain notation with an extension name
93+
/// (e.g., <c>"io.modelcontextprotocol/oauth-client-credentials"</c>), and values are
94+
/// per-extension settings objects. An empty object indicates support with no additional settings.
95+
/// </para>
96+
/// <para>
97+
/// Extensions provide a framework for extending the Model Context Protocol while maintaining
98+
/// interoperability. Both clients and servers advertise extension support via this field during
99+
/// the initialization handshake.
100+
/// </para>
101+
/// </remarks>
102+
[JsonPropertyName("extensions")]
103+
[Experimental(Experimentals.Tasks_DiagnosticId, UrlFormat = Experimentals.Tasks_Url)] // SEP-2133: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2133
104+
public IDictionary<string, object>? Extensions { get; set; }
85105
}

src/ModelContextProtocol.Core/Protocol/ServerCapabilities.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.ComponentModel;
2+
using System.Diagnostics.CodeAnalysis;
23
using System.Text.Json.Serialization;
34
using ModelContextProtocol.Server;
45

@@ -81,4 +82,23 @@ public sealed class ServerCapabilities
8182
/// </remarks>
8283
[JsonPropertyName("tasks")]
8384
public McpTasksCapability? Tasks { get; set; }
85+
86+
/// <summary>
87+
/// Gets or sets optional MCP extensions that the server supports.
88+
/// </summary>
89+
/// <remarks>
90+
/// <para>
91+
/// Keys are extension identifiers in reverse domain notation with an extension name
92+
/// (e.g., <c>"io.modelcontextprotocol/apps"</c>), and values are per-extension settings
93+
/// objects. An empty object indicates support with no additional settings.
94+
/// </para>
95+
/// <para>
96+
/// Extensions provide a framework for extending the Model Context Protocol while maintaining
97+
/// interoperability. Both clients and servers advertise extension support via this field during
98+
/// the initialization handshake.
99+
/// </para>
100+
/// </remarks>
101+
[JsonPropertyName("extensions")]
102+
[Experimental(Experimentals.Tasks_DiagnosticId, UrlFormat = Experimentals.Tasks_Url)] // SEP-2133: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2133
103+
public IDictionary<string, object>? Extensions { get; set; }
84104
}

0 commit comments

Comments
 (0)