Skip to content

Commit fcf950e

Browse files
Copilotstephentoub
andauthored
Mark DynamicClientRegistrationOptions.ApplicationType as [Experimental] per SEP-837
Agent-Logs-Url: https://github.com/modelcontextprotocol/csharp-sdk/sessions/ef973045-314b-4c42-821b-c467c7a0e8e6 Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 71a2c97 commit fcf950e

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

docs/list-of-diagnostics.md

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

2424
| Diagnostic ID | Description |
2525
| :------------ | :---------- |
26-
| `MCPEXP001` | Experimental APIs for features in the MCP specification itself, 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)). |
26+
| `MCPEXP001` | Experimental APIs for features in the MCP specification itself, including Tasks, Extensions, and the `application_type` parameter in Dynamic Client Registration. 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)). The `application_type` parameter in Dynamic Client Registration is part of a future MCP specification version (see [SEP-837](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/837)). |
2727
| `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). |
2828

2929
## Obsolete APIs

src/Common/Experimentals.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,23 @@ internal static class Experimentals
110110
/// URL for the experimental <c>RunSessionHandler</c> API.
111111
/// </summary>
112112
public const string RunSessionHandler_Url = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp002";
113+
114+
/// <summary>
115+
/// Diagnostic ID for the experimental <c>application_type</c> parameter in Dynamic Client Registration per SEP-837.
116+
/// </summary>
117+
/// <remarks>
118+
/// This uses the same diagnostic ID as <see cref="Tasks_DiagnosticId"/> because it is an experimental
119+
/// feature in the MCP specification itself.
120+
/// </remarks>
121+
public const string DcrApplicationType_DiagnosticId = "MCPEXP001";
122+
123+
/// <summary>
124+
/// Message for the experimental <c>application_type</c> parameter in Dynamic Client Registration.
125+
/// </summary>
126+
public const string DcrApplicationType_Message = "The application_type parameter in Dynamic Client Registration is part of a future MCP specification version (SEP-837) and is subject to change.";
127+
128+
/// <summary>
129+
/// URL for the experimental <c>application_type</c> parameter in Dynamic Client Registration.
130+
/// </summary>
131+
public const string DcrApplicationType_Url = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp001";
113132
}

src/ModelContextProtocol.Core/Authentication/ClientOAuthProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ public ClientOAuthProvider(
9090
_dcrClientUri = options.DynamicClientRegistration?.ClientUri;
9191
_dcrInitialAccessToken = options.DynamicClientRegistration?.InitialAccessToken;
9292
_dcrResponseDelegate = options.DynamicClientRegistration?.ResponseDelegate;
93+
#pragma warning disable MCPEXP001 // application_type in DCR is experimental per SEP-837
9394
_dcrApplicationType = options.DynamicClientRegistration?.ApplicationType;
95+
#pragma warning restore MCPEXP001
9496
_tokenCache = options.TokenCache ?? new InMemoryTokenCache();
9597
}
9698

src/ModelContextProtocol.Core/Authentication/DynamicClientRegistrationOptions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Diagnostics.CodeAnalysis;
2+
13
namespace ModelContextProtocol.Authentication;
24

35
/// <summary>
@@ -61,5 +63,6 @@ public sealed class DynamicClientRegistrationOptions
6163
/// should use "native", and web applications (remote browser-based) should use "web".
6264
/// </para>
6365
/// </remarks>
66+
[Experimental(Experimentals.DcrApplicationType_DiagnosticId, UrlFormat = Experimentals.DcrApplicationType_Url)]
6467
public string? ApplicationType { get; set; }
6568
}

tests/ModelContextProtocol.AspNetCore.Tests/OAuth/AuthTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ public async Task DynamicClientRegistration_SendsWebApplicationType_ForNonLocalh
13131313
}
13141314

13151315
[Fact]
1316+
#pragma warning disable MCPEXP001 // application_type in DCR is experimental per SEP-837
13161317
public async Task DynamicClientRegistration_UsesExplicitApplicationType_WhenConfigured()
13171318
{
13181319
await using var app = await StartMcpServerAsync();
@@ -1333,6 +1334,7 @@ public async Task DynamicClientRegistration_UsesExplicitApplicationType_WhenConf
13331334
},
13341335
},
13351336
}, HttpClient, LoggerFactory);
1337+
#pragma warning restore MCPEXP001
13361338

13371339
await using var client = await McpClient.CreateAsync(
13381340
transport, loggerFactory: LoggerFactory, cancellationToken: TestContext.Current.CancellationToken);

0 commit comments

Comments
 (0)