Skip to content

Commit f2ce62c

Browse files
authored
Rename MCPEXP002 Subclassing_* constants to Extensibility_* (#1739)
Co-authored-by: arimu1 <19286898+arimu1@users.noreply.github.com>
1 parent dfb2205 commit f2ce62c

13 files changed

Lines changed: 25 additions & 24 deletions

File tree

.github/skills/breaking-changes/references/classification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Before dismissing a potential break, review the PR description and all PR commen
122122
Every dismissed potential break must be reported to the user with enough detail for them to verify the conclusion. The audit must:
123123

124124
1. **Identify what would normally be breaking and why** (e.g., "CP0005 — adding abstract member `Completion` to abstract class `McpClient`")
125-
2. **Explain the specific reason for dismissal** (e.g., "Bug fix correcting incorrect behavior per the MCP spec" or "`McpClient`'s only accessible constructor is `protected` and marked `[Experimental(MCPEXP002)]` with message 'Subclassing McpClient and McpServer is experimental and subject to change.'")
125+
2. **Explain the specific reason for dismissal** (e.g., "Bug fix correcting incorrect behavior per the MCP spec" or "`McpClient`'s only accessible constructor is `protected` and marked `[Experimental(MCPEXP002)]` with message 'This C# SDK extensibility API is experimental and subject to change.'")
126126
3. **Cite any supporting discussion** from the PR description or comments (e.g., "Reviewers discussed the addition and did not flag it as a breaking concern; compatibility suppressions were added for CP0005")
127127
4. **Conclude with the dismissal and its category** (e.g., "Dismissed — bug fix correcting spec-non-compliant behavior" or "Dismissed — exclusively gated by `[Experimental]` API. Do not apply the `breaking-change` label.")
128128

docs/list-of-diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If you use experimental APIs, you will get one of the diagnostics shown below. T
2828
| Diagnostic ID | Description |
2929
| :------------ | :---------- |
3030
| `MCPEXP001` | Experimental APIs tied to MCP specification features. Reuse this ID for newly introduced experimental spec features, and add feature-specific messages/URLs in `Experimentals`. |
31-
| `MCPEXP002` | Experimental SDK APIs unrelated to the MCP specification itself, including subclassing `McpClient`/`McpServer` (see [#1363](https://github.com/modelcontextprotocol/csharp-sdk/pull/1363)) and `RunSessionHandler`, which may be removed or change signatures in a future release (consider using `ConfigureSessionOptions` instead). |
31+
| `MCPEXP002` | Experimental SDK extensibility APIs used to implement features in standalone packages without requiring Core to understand those features. For example, the Tasks package uses these APIs to extend the SDK while keeping the Tasks concept out of Core. This includes `McpClient`/`McpServer` subclassing, custom request handlers, alternate handlers and filters, outgoing request interception, and `RunSessionHandler`. These APIs remain experimental until additional extensibility scenarios validate the design. |
3232
| `MCPEXP003` | Experimental MCP Apps extension APIs. MCP Apps is the first official MCP extension (`io.modelcontextprotocol/ui`), enabling servers to deliver interactive UIs inside AI clients (see [MCP Apps specification](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx)). |
3333

3434
## Obsolete APIs

src/Common/Experimentals.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ namespace ModelContextProtocol;
1313
/// These APIs may change as the specification evolves.
1414
/// </description></item>
1515
/// <item><description>
16-
/// <c>MCPEXP002</c> covers experimental SDK APIs that are unrelated to the MCP specification,
17-
/// such as subclassing internal types or SDK-specific extensibility hooks. These APIs may
18-
/// change or be removed based on SDK design feedback.
16+
/// <c>MCPEXP002</c> covers SDK extensibility APIs that enable features to be implemented
17+
/// in standalone packages without requiring Core to understand those features. The Tasks
18+
/// package is one such consumer. These APIs remain experimental until additional
19+
/// extensibility scenarios validate the design.
1920
/// </description></item>
2021
/// </list>
2122
/// <para>
@@ -65,31 +66,31 @@ internal static class Experimentals
6566
public const string Apps_Url = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp003";
6667

6768
/// <summary>
68-
/// Diagnostic ID for experimental SDK APIs unrelated to the MCP specification,
69-
/// such as subclassing <c>McpClient</c>/<c>McpServer</c> or referencing <c>RunSessionHandler</c>.
69+
/// Diagnostic ID for SDK extensibility APIs that enable independently packaged features,
70+
/// such as Tasks, without requiring Core awareness of those features.
7071
/// </summary>
7172
/// <remarks>
7273
/// This diagnostic ID covers experimental SDK-level extensibility APIs. All constants
7374
/// in this group share the same diagnostic ID so users need only one suppression point
7475
/// for SDK design preview features.
7576
/// </remarks>
76-
public const string Subclassing_DiagnosticId = "MCPEXP002";
77+
public const string Extensibility_DiagnosticId = "MCPEXP002";
7778

7879
/// <summary>
79-
/// Message for experimental subclassing of McpClient and McpServer.
80+
/// Message for experimental extensibility points in the C# SDK implementation.
8081
/// </summary>
81-
public const string Subclassing_Message = "Subclassing McpClient and McpServer is experimental and subject to change.";
82+
public const string Extensibility_Message = "This C# SDK extensibility API is experimental and subject to change.";
8283

8384
/// <summary>
84-
/// URL for experimental subclassing of McpClient and McpServer.
85+
/// URL for experimental extensibility points in the C# SDK implementation.
8586
/// </summary>
86-
public const string Subclassing_Url = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp002";
87+
public const string Extensibility_Url = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp002";
8788

8889
/// <summary>
8990
/// Diagnostic ID for the experimental <c>RunSessionHandler</c> API.
9091
/// </summary>
9192
/// <remarks>
92-
/// This uses the same diagnostic ID as <see cref="Subclassing_DiagnosticId"/> because
93+
/// This uses the same diagnostic ID as <see cref="Extensibility_DiagnosticId"/> because
9394
/// both are experimental SDK APIs unrelated to the MCP specification.
9495
/// </remarks>
9596
public const string RunSessionHandler_DiagnosticId = "MCPEXP002";

src/ModelContextProtocol.Core/Client/McpClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public abstract partial class McpClient : McpSession
1212
/// <summary>
1313
/// Initializes a new instance of the <see cref="McpClient"/> class.
1414
/// </summary>
15-
[Experimental(Experimentals.Subclassing_DiagnosticId, UrlFormat = Experimentals.Subclassing_Url)]
15+
[Experimental(Experimentals.Extensibility_DiagnosticId, UrlFormat = Experimentals.Extensibility_Url)]
1616
protected McpClient()
1717
{
1818
}

src/ModelContextProtocol.Core/Protocol/JsonRpcMessageContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public sealed class JsonRpcMessageContext
8383
/// Streamable HTTP transports emit this value in the <c>Mcp-Name</c> header. This enables
8484
/// extension methods to identify the named resource targeted by a request.
8585
/// </remarks>
86-
[Experimental(Experimentals.Subclassing_DiagnosticId, UrlFormat = Experimentals.Subclassing_Url)]
86+
[Experimental(Experimentals.Extensibility_DiagnosticId, UrlFormat = Experimentals.Extensibility_Url)]
8787
[JsonIgnore]
8888
public string? RoutingName { get; set; }
8989

src/ModelContextProtocol.Core/Protocol/ResultOrAlternate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace ModelContextProtocol.Protocol;
2020
/// <see cref="Result"/> for the immediate result or <see cref="Alternate"/> for the alternate.
2121
/// </para>
2222
/// </remarks>
23-
[Experimental(Experimentals.Subclassing_DiagnosticId, UrlFormat = Experimentals.Subclassing_Url)]
23+
[Experimental(Experimentals.Extensibility_DiagnosticId, UrlFormat = Experimentals.Extensibility_Url)]
2424
public class ResultOrAlternate<TResult> where TResult : Result
2525
{
2626
private readonly TResult? _result;

src/ModelContextProtocol.Core/Server/McpRequestFilters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public IList<McpRequestFilter<CallToolRequestParams, CallToolResult>> CallToolFi
8484
/// asynchronously, filters registered after it execute as part of that asynchronous operation.
8585
/// </para>
8686
/// </remarks>
87-
[Experimental(Experimentals.Subclassing_DiagnosticId, UrlFormat = Experimentals.Subclassing_Url)]
87+
[Experimental(Experimentals.Extensibility_DiagnosticId, UrlFormat = Experimentals.Extensibility_Url)]
8888
public IList<McpRequestInvocationFilter<CallToolRequestParams, ResultOrAlternate<CallToolResult>>> CallToolWithAlternateFilters
8989
{
9090
get => field ??= [];

src/ModelContextProtocol.Core/Server/McpRequestInvocationFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace ModelContextProtocol.Server;
1111
/// <param name="next">The next request handler in the pipeline for this invocation.</param>
1212
/// <param name="cancellationToken">The cancellation token for the current request.</param>
1313
/// <returns>The result of the filtered request invocation.</returns>
14-
[Experimental(Experimentals.Subclassing_DiagnosticId, UrlFormat = Experimentals.Subclassing_Url)]
14+
[Experimental(Experimentals.Extensibility_DiagnosticId, UrlFormat = Experimentals.Extensibility_Url)]
1515
public delegate ValueTask<TResult> McpRequestInvocationFilter<TParams, TResult>(
1616
RequestContext<TParams> context,
1717
McpRequestHandler<TParams, TResult> next,

src/ModelContextProtocol.Core/Server/McpServer.Methods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public abstract partial class McpServer : McpSession
3939
/// On the returned facade, redirected methods skip their client-capability checks,
4040
/// because the alternate channel is responsible for delivering the request to the client.
4141
/// </remarks>
42-
[Experimental(Experimentals.Subclassing_DiagnosticId, UrlFormat = Experimentals.Subclassing_Url)]
42+
[Experimental(Experimentals.Extensibility_DiagnosticId, UrlFormat = Experimentals.Extensibility_Url)]
4343
public McpServer WithOutgoingRequestInterceptor(Func<string, JsonNode?, CancellationToken, ValueTask<JsonNode?>> interceptor)
4444
{
4545
Throw.IfNull(interceptor);

src/ModelContextProtocol.Core/Server/McpServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public abstract partial class McpServer : McpSession
1111
/// <summary>
1212
/// Initializes a new instance of the <see cref="McpServer"/> class.
1313
/// </summary>
14-
[Experimental(Experimentals.Subclassing_DiagnosticId, UrlFormat = Experimentals.Subclassing_Url)]
14+
[Experimental(Experimentals.Extensibility_DiagnosticId, UrlFormat = Experimentals.Extensibility_Url)]
1515
protected McpServer()
1616
{
1717
}

0 commit comments

Comments
 (0)