Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions dotnet/src/Generated/SessionEvents.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions dotnet/src/Types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,21 @@ public class AzureOptions
// MCP Server Configuration Types
// ============================================================================

/// <summary>
/// OAuth grant type for a remote MCP server.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<McpHttpServerConfigOauthGrantType>))]
public enum McpHttpServerConfigOauthGrantType
{
/// <summary>Use the authorization code OAuth flow.</summary>
[JsonStringEnumMemberName("authorization_code")]
AuthorizationCode,

/// <summary>Use the client credentials OAuth flow.</summary>
[JsonStringEnumMemberName("client_credentials")]
ClientCredentials
}

/// <summary>
/// Abstract base class for MCP server configurations.
/// </summary>
Expand Down Expand Up @@ -1611,6 +1626,24 @@ public sealed class McpHttpServerConfig : McpServerConfig
/// </summary>
[JsonPropertyName("headers")]
public IDictionary<string, string>? Headers { get; set; }

/// <summary>
/// Optional OAuth client ID for the remote server.
/// </summary>
[JsonPropertyName("oauthClientId")]
public string? OauthClientId { get; set; }

/// <summary>
/// Whether this is a public OAuth client.
/// </summary>
[JsonPropertyName("oauthPublicClient")]
public bool? OauthPublicClient { get; set; }

/// <summary>
/// Optional OAuth grant type for the remote server.
/// </summary>
[JsonPropertyName("oauthGrantType")]
public McpHttpServerConfigOauthGrantType? OauthGrantType { get; set; }
}

// ============================================================================
Expand Down
38 changes: 38 additions & 0 deletions dotnet/test/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,44 @@ public void SendMessageRequest_CanSerializeRequestHeaders_WithSdkOptions()
Assert.Equal("trace-value", root.GetProperty("requestHeaders").GetProperty("X-Trace").GetString());
}

[Fact]
public void McpHttpServerConfig_CanSerializeOauthOptions_WithSdkOptions()
{
var options = GetSerializerOptions();
McpServerConfig original = new McpHttpServerConfig
{
Url = "https://example.com/mcp",
Headers = new Dictionary<string, string> { ["Authorization"] = "Bearer token" },
OauthClientId = "client-id",
OauthPublicClient = false,
OauthGrantType = McpHttpServerConfigOauthGrantType.ClientCredentials,
Tools = ["*"],
Timeout = 3000
};

var json = JsonSerializer.Serialize(original, options);
using var document = JsonDocument.Parse(json);
var root = document.RootElement;
Assert.Equal("http", root.GetProperty("type").GetString());
Assert.Equal("https://example.com/mcp", root.GetProperty("url").GetString());
Assert.Equal("Bearer token", root.GetProperty("headers").GetProperty("Authorization").GetString());
Assert.Equal("client-id", root.GetProperty("oauthClientId").GetString());
Assert.False(root.GetProperty("oauthPublicClient").GetBoolean());
Assert.Equal("client_credentials", root.GetProperty("oauthGrantType").GetString());
Assert.Equal("*", root.GetProperty("tools")[0].GetString());
Assert.Equal(3000, root.GetProperty("timeout").GetInt32());

var deserialized = JsonSerializer.Deserialize<McpServerConfig>(json, options);
var httpConfig = Assert.IsType<McpHttpServerConfig>(deserialized);
Assert.Equal("https://example.com/mcp", httpConfig.Url);
Assert.Equal("Bearer token", httpConfig.Headers!["Authorization"]);
Assert.Equal("client-id", httpConfig.OauthClientId);
Assert.False(httpConfig.OauthPublicClient);
Assert.Equal(McpHttpServerConfigOauthGrantType.ClientCredentials, httpConfig.OauthGrantType);
Assert.Equal("*", Assert.Single(httpConfig.Tools));
Assert.Equal(3000, httpConfig.Timeout);
}

private static JsonSerializerOptions GetSerializerOptions()
{
var prop = typeof(CopilotClient)
Expand Down
2 changes: 2 additions & 0 deletions go/generated_session_events.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 20 additions & 10 deletions go/rpc/generated_rpc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@github/copilot": "^1.0.40-1",
"@github/copilot": "^1.0.40-3",
"vscode-jsonrpc": "^8.2.1",
"zod": "^4.3.6"
},
Expand Down
2 changes: 1 addition & 1 deletion nodejs/samples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions nodejs/src/generated/rpc.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions nodejs/src/generated/session-events.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading