From 07a4febff056030677af4c741051dd41bd366d11 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 23:22:36 +0000 Subject: [PATCH 1/2] Update @github/copilot to 1.0.40-3 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code --- dotnet/src/Generated/SessionEvents.cs | 5 ++ go/generated_session_events.go | 2 + go/rpc/generated_rpc.go | 30 ++++++++---- nodejs/package-lock.json | 56 +++++++++++----------- nodejs/package.json | 2 +- nodejs/samples/package-lock.json | 2 +- nodejs/src/generated/rpc.ts | 3 ++ nodejs/src/generated/session-events.ts | 4 ++ python/copilot/generated/rpc.py | 21 ++++++-- python/copilot/generated/session_events.py | 5 ++ test/harness/package-lock.json | 56 +++++++++++----------- test/harness/package.json | 2 +- 12 files changed, 116 insertions(+), 72 deletions(-) diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 7002c2f38..d560002ae 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -4643,6 +4643,11 @@ public partial class McpOauthRequiredStaticClientConfig [JsonPropertyName("clientId")] public required string ClientId { get; set; } + /// Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("grantType")] + public string? GrantType { get; set; } + /// Whether this is a public OAuth client. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("publicClient")] diff --git a/go/generated_session_events.go b/go/generated_session_events.go index 5fd844aae..9a3be1337 100644 --- a/go/generated_session_events.go +++ b/go/generated_session_events.go @@ -2061,6 +2061,8 @@ type UserMessageAttachmentSelectionDetailsStart struct { type McpOauthRequiredStaticClientConfig struct { // OAuth client ID for the server ClientID string `json:"clientId"` + // Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). + GrantType *string `json:"grantType,omitempty"` // Whether this is a public OAuth client PublicClient *bool `json:"publicClient,omitempty"` } diff --git a/go/rpc/generated_rpc.go b/go/rpc/generated_rpc.go index c56418a24..ab1c897a7 100644 --- a/go/rpc/generated_rpc.go +++ b/go/rpc/generated_rpc.go @@ -93,6 +93,7 @@ type RPCTypes struct { MCPServer MCPServer `json:"McpServer"` MCPServerConfig MCPServerConfig `json:"McpServerConfig"` MCPServerConfigHTTP MCPServerConfigHTTP `json:"McpServerConfigHttp"` + MCPServerConfigHTTPOauthGrantType MCPServerConfigHTTPOauthGrantType `json:"McpServerConfigHttpOauthGrantType"` MCPServerConfigHTTPType MCPServerConfigHTTPType `json:"McpServerConfigHttpType"` MCPServerConfigLocal MCPServerConfigLocal `json:"McpServerConfigLocal"` MCPServerConfigLocalType MCPServerConfigLocalType `json:"McpServerConfigLocalType"` @@ -712,11 +713,12 @@ type MCPServerConfig struct { // Tools to include. Defaults to all tools if not specified. Tools []string `json:"tools,omitempty"` // Remote transport type. Defaults to "http" when omitted. - Type *MCPServerConfigType `json:"type,omitempty"` - Headers map[string]string `json:"headers,omitempty"` - OauthClientID *string `json:"oauthClientId,omitempty"` - OauthPublicClient *bool `json:"oauthPublicClient,omitempty"` - URL *string `json:"url,omitempty"` + Type *MCPServerConfigType `json:"type,omitempty"` + Headers map[string]string `json:"headers,omitempty"` + OauthClientID *string `json:"oauthClientId,omitempty"` + OauthGrantType *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"` + OauthPublicClient *bool `json:"oauthPublicClient,omitempty"` + URL *string `json:"url,omitempty"` } type MCPConfigAddResult struct { @@ -833,11 +835,12 @@ type MCPServer struct { } type MCPServerConfigHTTP struct { - FilterMapping *FilterMapping `json:"filterMapping"` - Headers map[string]string `json:"headers,omitempty"` - IsDefaultServer *bool `json:"isDefaultServer,omitempty"` - OauthClientID *string `json:"oauthClientId,omitempty"` - OauthPublicClient *bool `json:"oauthPublicClient,omitempty"` + FilterMapping *FilterMapping `json:"filterMapping"` + Headers map[string]string `json:"headers,omitempty"` + IsDefaultServer *bool `json:"isDefaultServer,omitempty"` + OauthClientID *string `json:"oauthClientId,omitempty"` + OauthGrantType *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"` + OauthPublicClient *bool `json:"oauthPublicClient,omitempty"` // Timeout in milliseconds for tool calls to this server. Timeout *int64 `json:"timeout,omitempty"` // Tools to include. Defaults to all tools if not specified. @@ -2173,6 +2176,13 @@ const ( SessionLogLevelWarning SessionLogLevel = "warning" ) +type MCPServerConfigHTTPOauthGrantType string + +const ( + MCPServerConfigHTTPOauthGrantTypeAuthorizationCode MCPServerConfigHTTPOauthGrantType = "authorization_code" + MCPServerConfigHTTPOauthGrantTypeClientCredentials MCPServerConfigHTTPOauthGrantType = "client_credentials" +) + // Remote transport type. Defaults to "http" when omitted. type MCPServerConfigType string diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 8f8f12a00..20c168edc 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.40-1", + "@github/copilot": "^1.0.40-3", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, @@ -663,26 +663,26 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.40-1.tgz", - "integrity": "sha512-jdohe7CcjlmbNR0bnL/uAbaYDtmqZnHcHo3t/ZspVb9vo7+yk7AdTc4AF4TpV7M/tCKc+ynoqgQNCalWAmXYWQ==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.40-3.tgz", + "integrity": "sha512-bgvE59bJFsT/tN2CvMR7f5a6NH1tWxYTl9skVrRDk4YS6ZcFP0bclYg/NMDR8D5sfQYngdNN8vxmv85eB8rPVA==", "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.40-1", - "@github/copilot-darwin-x64": "1.0.40-1", - "@github/copilot-linux-arm64": "1.0.40-1", - "@github/copilot-linux-x64": "1.0.40-1", - "@github/copilot-win32-arm64": "1.0.40-1", - "@github/copilot-win32-x64": "1.0.40-1" + "@github/copilot-darwin-arm64": "1.0.40-3", + "@github/copilot-darwin-x64": "1.0.40-3", + "@github/copilot-linux-arm64": "1.0.40-3", + "@github/copilot-linux-x64": "1.0.40-3", + "@github/copilot-win32-arm64": "1.0.40-3", + "@github/copilot-win32-x64": "1.0.40-3" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.40-1.tgz", - "integrity": "sha512-DSArBmv1A6BstJs23QgXzes7B8Hu+sz4Ccqh1NhY/4NPfxck1rD2v61ZWz8kdwpgTdjP6lWSZ5nLWdi9Go+PhA==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.40-3.tgz", + "integrity": "sha512-QRVt15j3azPs8foceUfwT8COnR5DULOhc+5hUp8UgSJagNGEMv8zwVPYoWiJyeApeLdERDeqBF6M6MHHbMjD+A==", "cpu": [ "arm64" ], @@ -696,9 +696,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.40-1.tgz", - "integrity": "sha512-fTOL2XChDSsPc/q//mIFlq47ABNgyUKqz1+ix5oxloE9RlT1YpD7v3O+dqU/tmdxXwMTfQqgZsYglRY/nna3yw==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.40-3.tgz", + "integrity": "sha512-8P2EBAtxjLfk8mG2DR9laWeX6WT4WkrHG+FcTciTNwzRy5YqaFAommwd+nc8I7ddktZvzgQEz8tdM8SAlQ2d2A==", "cpu": [ "x64" ], @@ -712,9 +712,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.40-1.tgz", - "integrity": "sha512-+aon/9kAxgGlxLZrxzwUrNO1G/eUIhhEB6W4u1sMs2GwXjANrDr6WIsp056dOnU2TY9oEnn8vWTJQSIwyFlGHQ==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.40-3.tgz", + "integrity": "sha512-ItrOgrQ/2QKsrcUHvcSs/y/4HVypzNNFNF/0vL/30yDy89w+5z3hzydZ0uAyMHwf//sWJauAWdkQYmZqaSjT2A==", "cpu": [ "arm64" ], @@ -728,9 +728,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.40-1.tgz", - "integrity": "sha512-p44TeuI01EpizsJmQX0W21f7pPXyTvrXYkv/5W1GgCiNEP4HKLG9rdgdIEtqaIMnXFKssxpGF45+hJuz0iep5g==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.40-3.tgz", + "integrity": "sha512-WwRaJeqy+Ywx8XCKH1X/joLK1xbi6MLwWU+ZnRosr8pkvoLnewlBZRVT3dkxkPYvnTIn/PBJKjhtC2lgptbrTg==", "cpu": [ "x64" ], @@ -744,9 +744,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.40-1.tgz", - "integrity": "sha512-nrbMh1qc8VWL1KU2N+VdQ2M+4jiGlugApIFNUbfywnUITktWEpQ62Jqf2YQlrMr51f1F1fjSE/YBuDW6InzzYg==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.40-3.tgz", + "integrity": "sha512-B/JvunL2xFJ6xGLppTehIotaEqEaWOYg+P929rpx90FG2GdsR5oQ5zVHTiMJWX6YFqmW+Kwc5utCMUj7MjDmQQ==", "cpu": [ "arm64" ], @@ -760,9 +760,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.40-1.tgz", - "integrity": "sha512-n5qmzAn4OKbdHJeOmdt4eUA7XWSUOmNSJUtRswKVqgCxrmMOR/0FXCPzVS0gAJn+UEj9ApHulC6G09HR5Nhp7Q==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.40-3.tgz", + "integrity": "sha512-80ZFwdKzpRTVjq3MHMU6LjsWjYlVEyI0+rFiM/5s5EmbQDvSnXt4vLT4O+UTbQs+YSi5jRLtm4Q6QkIChE7AWQ==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index b04d19511..b1820e818 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -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" }, diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index dfc68c929..551223a5f 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,7 +18,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.40-1", + "@github/copilot": "^1.0.40-3", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 349201951..42cdc039b 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -123,6 +123,8 @@ export type McpServerConfigLocalType = "local" | "stdio"; * via the `definition` "McpServerConfigHttpType". */ export type McpServerConfigHttpType = "http" | "sse"; + +export type McpServerConfigHttpOauthGrantType = "authorization_code" | "client_credentials"; /** * Connection status: connected, failed, needs-auth, pending, disabled, or not_configured * @@ -878,6 +880,7 @@ export interface McpServerConfigHttp { }; oauthClientId?: string; oauthPublicClient?: boolean; + oauthGrantType?: McpServerConfigHttpOauthGrantType; } export interface McpConfigDisableRequest { diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 23c61710f..33b8081db 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -4324,6 +4324,10 @@ export interface McpOauthRequiredStaticClientConfig { * OAuth client ID for the server */ clientId: string; + /** + * Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). + */ + grantType?: "client_credentials"; /** * Whether this is a public OAuth client */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 560ea29a0..dac331aa6 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -629,6 +629,10 @@ def to_dict(self) -> dict: result["eventId"] = str(self.event_id) return result +class MCPServerConfigHTTPOauthGrantType(Enum): + AUTHORIZATION_CODE = "authorization_code" + CLIENT_CREDENTIALS = "client_credentials" + class MCPServerConfigType(Enum): """Remote transport type. Defaults to "http" when omitted.""" @@ -2934,6 +2938,7 @@ class MCPServerConfig: headers: dict[str, str] | None = None oauth_client_id: str | None = None + oauth_grant_type: MCPServerConfigHTTPOauthGrantType | None = None oauth_public_client: bool | None = None url: str | None = None @@ -2951,9 +2956,10 @@ def from_dict(obj: Any) -> 'MCPServerConfig': type = from_union([MCPServerConfigType, from_none], obj.get("type")) headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("headers")) oauth_client_id = from_union([from_str, from_none], obj.get("oauthClientId")) + oauth_grant_type = from_union([MCPServerConfigHTTPOauthGrantType, from_none], obj.get("oauthGrantType")) oauth_public_client = from_union([from_bool, from_none], obj.get("oauthPublicClient")) url = from_union([from_str, from_none], obj.get("url")) - return MCPServerConfig(args, command, cwd, env, filter_mapping, is_default_server, timeout, tools, type, headers, oauth_client_id, oauth_public_client, url) + return MCPServerConfig(args, command, cwd, env, filter_mapping, is_default_server, timeout, tools, type, headers, oauth_client_id, oauth_grant_type, oauth_public_client, url) def to_dict(self) -> dict: result: dict = {} @@ -2979,6 +2985,8 @@ def to_dict(self) -> dict: result["headers"] = from_union([lambda x: from_dict(from_str, x), from_none], self.headers) if self.oauth_client_id is not None: result["oauthClientId"] = from_union([from_str, from_none], self.oauth_client_id) + if self.oauth_grant_type is not None: + result["oauthGrantType"] = from_union([lambda x: to_enum(MCPServerConfigHTTPOauthGrantType, x), from_none], self.oauth_grant_type) if self.oauth_public_client is not None: result["oauthPublicClient"] = from_union([from_bool, from_none], self.oauth_public_client) if self.url is not None: @@ -3025,6 +3033,7 @@ class MCPServerConfigHTTP: headers: dict[str, str] | None = None is_default_server: bool | None = None oauth_client_id: str | None = None + oauth_grant_type: MCPServerConfigHTTPOauthGrantType | None = None oauth_public_client: bool | None = None timeout: int | None = None """Timeout in milliseconds for tool calls to this server.""" @@ -3043,11 +3052,12 @@ def from_dict(obj: Any) -> 'MCPServerConfigHTTP': headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("headers")) is_default_server = from_union([from_bool, from_none], obj.get("isDefaultServer")) oauth_client_id = from_union([from_str, from_none], obj.get("oauthClientId")) + oauth_grant_type = from_union([MCPServerConfigHTTPOauthGrantType, from_none], obj.get("oauthGrantType")) oauth_public_client = from_union([from_bool, from_none], obj.get("oauthPublicClient")) timeout = from_union([from_int, from_none], obj.get("timeout")) tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("tools")) type = from_union([MCPServerConfigHTTPType, from_none], obj.get("type")) - return MCPServerConfigHTTP(url, filter_mapping, headers, is_default_server, oauth_client_id, oauth_public_client, timeout, tools, type) + return MCPServerConfigHTTP(url, filter_mapping, headers, is_default_server, oauth_client_id, oauth_grant_type, oauth_public_client, timeout, tools, type) def to_dict(self) -> dict: result: dict = {} @@ -3060,6 +3070,8 @@ def to_dict(self) -> dict: result["isDefaultServer"] = from_union([from_bool, from_none], self.is_default_server) if self.oauth_client_id is not None: result["oauthClientId"] = from_union([from_str, from_none], self.oauth_client_id) + if self.oauth_grant_type is not None: + result["oauthGrantType"] = from_union([lambda x: to_enum(MCPServerConfigHTTPOauthGrantType, x), from_none], self.oauth_grant_type) if self.oauth_public_client is not None: result["oauthPublicClient"] = from_union([from_bool, from_none], self.oauth_public_client) if self.timeout is not None: @@ -5606,6 +5618,7 @@ class RPC: mcp_server: MCPServer mcp_server_config: MCPServerConfig mcp_server_config_http: MCPServerConfigHTTP + mcp_server_config_http_oauth_grant_type: MCPServerConfigHTTPOauthGrantType mcp_server_config_http_type: MCPServerConfigHTTPType mcp_server_config_local: MCPServerConfigLocal mcp_server_config_local_type: MCPServerConfigLocalType @@ -5831,6 +5844,7 @@ def from_dict(obj: Any) -> 'RPC': mcp_server = MCPServer.from_dict(obj.get("McpServer")) mcp_server_config = MCPServerConfig.from_dict(obj.get("McpServerConfig")) mcp_server_config_http = MCPServerConfigHTTP.from_dict(obj.get("McpServerConfigHttp")) + mcp_server_config_http_oauth_grant_type = MCPServerConfigHTTPOauthGrantType(obj.get("McpServerConfigHttpOauthGrantType")) mcp_server_config_http_type = MCPServerConfigHTTPType(obj.get("McpServerConfigHttpType")) mcp_server_config_local = MCPServerConfigLocal.from_dict(obj.get("McpServerConfigLocal")) mcp_server_config_local_type = MCPServerConfigLocalType(obj.get("McpServerConfigLocalType")) @@ -5984,7 +5998,7 @@ def from_dict(obj: Any) -> 'RPC': workspaces_list_files_result = WorkspacesListFilesResult.from_dict(obj.get("WorkspacesListFilesResult")) workspaces_read_file_request = WorkspacesReadFileRequest.from_dict(obj.get("WorkspacesReadFileRequest")) workspaces_read_file_result = WorkspacesReadFileResult.from_dict(obj.get("WorkspacesReadFileResult")) - return RPC(account_get_quota_request, account_get_quota_result, account_quota_snapshot, agent_get_current_result, agent_info, agent_list, agent_reload_result, agent_select_request, agent_select_result, auth_info_type, commands_handle_pending_command_request, commands_handle_pending_command_result, current_model, discovered_mcp_server, discovered_mcp_server_source, discovered_mcp_server_type, embedded_blob_resource_contents, embedded_text_resource_contents, extension, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, filter_mapping_string, filter_mapping_value, fleet_start_request, fleet_start_result, handle_pending_tool_call_request, handle_pending_tool_call_result, history_compact_context_window, history_compact_result, history_truncate_request, history_truncate_result, instructions_get_sources_result, instructions_sources, instructions_sources_location, instructions_sources_type, log_request, log_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_oauth_login_request, mcp_oauth_login_result, mcp_server, mcp_server_config, mcp_server_config_http, mcp_server_config_http_type, mcp_server_config_local, mcp_server_config_local_type, mcp_server_list, mcp_server_source, mcp_server_status, model, model_billing, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_policy, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, name_get_result, name_set_request, permission_decision, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_request_result, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, ping_request, ping_result, plan_read_result, plan_update_request, plugin, plugin_list, server_skill, server_skill_list, session_auth_status, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_log_level, session_mode, sessions_fork_request, sessions_fork_result, shell_exec_request, shell_exec_result, shell_kill_request, shell_kill_result, shell_kill_signal, skill, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, task_agent_info, task_agent_info_execution_mode, task_agent_info_status, task_info, task_list, tasks_cancel_request, tasks_cancel_result, task_shell_info, task_shell_info_attachment_mode, task_shell_info_execution_mode, task_shell_info_status, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_remove_request, tasks_remove_result, tasks_start_agent_request, tasks_start_agent_result, tool, tool_list, tools_list_request, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_handle_pending_elicitation_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, workspaces_create_file_request, workspaces_get_workspace_result, workspaces_list_files_result, workspaces_read_file_request, workspaces_read_file_result) + return RPC(account_get_quota_request, account_get_quota_result, account_quota_snapshot, agent_get_current_result, agent_info, agent_list, agent_reload_result, agent_select_request, agent_select_result, auth_info_type, commands_handle_pending_command_request, commands_handle_pending_command_result, current_model, discovered_mcp_server, discovered_mcp_server_source, discovered_mcp_server_type, embedded_blob_resource_contents, embedded_text_resource_contents, extension, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, filter_mapping_string, filter_mapping_value, fleet_start_request, fleet_start_result, handle_pending_tool_call_request, handle_pending_tool_call_result, history_compact_context_window, history_compact_result, history_truncate_request, history_truncate_result, instructions_get_sources_result, instructions_sources, instructions_sources_location, instructions_sources_type, log_request, log_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_oauth_login_request, mcp_oauth_login_result, mcp_server, mcp_server_config, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_local, mcp_server_config_local_type, mcp_server_list, mcp_server_source, mcp_server_status, model, model_billing, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_policy, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, name_get_result, name_set_request, permission_decision, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_request_result, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, ping_request, ping_result, plan_read_result, plan_update_request, plugin, plugin_list, server_skill, server_skill_list, session_auth_status, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_log_level, session_mode, sessions_fork_request, sessions_fork_result, shell_exec_request, shell_exec_result, shell_kill_request, shell_kill_result, shell_kill_signal, skill, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, task_agent_info, task_agent_info_execution_mode, task_agent_info_status, task_info, task_list, tasks_cancel_request, tasks_cancel_result, task_shell_info, task_shell_info_attachment_mode, task_shell_info_execution_mode, task_shell_info_status, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_remove_request, tasks_remove_result, tasks_start_agent_request, tasks_start_agent_result, tool, tool_list, tools_list_request, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_handle_pending_elicitation_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, workspaces_create_file_request, workspaces_get_workspace_result, workspaces_list_files_result, workspaces_read_file_request, workspaces_read_file_result) def to_dict(self) -> dict: result: dict = {} @@ -6056,6 +6070,7 @@ def to_dict(self) -> dict: result["McpServer"] = to_class(MCPServer, self.mcp_server) result["McpServerConfig"] = to_class(MCPServerConfig, self.mcp_server_config) result["McpServerConfigHttp"] = to_class(MCPServerConfigHTTP, self.mcp_server_config_http) + result["McpServerConfigHttpOauthGrantType"] = to_enum(MCPServerConfigHTTPOauthGrantType, self.mcp_server_config_http_oauth_grant_type) result["McpServerConfigHttpType"] = to_enum(MCPServerConfigHTTPType, self.mcp_server_config_http_type) result["McpServerConfigLocal"] = to_class(MCPServerConfigLocal, self.mcp_server_config_local) result["McpServerConfigLocalType"] = to_enum(MCPServerConfigLocalType, self.mcp_server_config_local_type) diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 0cdd5eab0..0ee3bdf68 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -1556,21 +1556,26 @@ def to_dict(self) -> dict: class McpOauthRequiredStaticClientConfig: "Static OAuth client configuration, if the server specifies one" client_id: str + grant_type: str | None = None public_client: bool | None = None @staticmethod def from_dict(obj: Any) -> "McpOauthRequiredStaticClientConfig": assert isinstance(obj, dict) client_id = from_str(obj.get("clientId")) + grant_type = from_union([from_none, from_str], obj.get("grantType")) public_client = from_union([from_none, from_bool], obj.get("publicClient")) return McpOauthRequiredStaticClientConfig( client_id=client_id, + grant_type=grant_type, public_client=public_client, ) def to_dict(self) -> dict: result: dict = {} result["clientId"] = from_str(self.client_id) + if self.grant_type is not None: + result["grantType"] = from_union([from_none, from_str], self.grant_type) if self.public_client is not None: result["publicClient"] = from_union([from_none, from_bool], self.public_client) return result diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index d4f646085..e944a2b2a 100644 --- a/test/harness/package-lock.json +++ b/test/harness/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@github/copilot": "^1.0.40-1", + "@github/copilot": "^1.0.40-3", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "openai": "^6.17.0", @@ -462,27 +462,27 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.40-1.tgz", - "integrity": "sha512-jdohe7CcjlmbNR0bnL/uAbaYDtmqZnHcHo3t/ZspVb9vo7+yk7AdTc4AF4TpV7M/tCKc+ynoqgQNCalWAmXYWQ==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.40-3.tgz", + "integrity": "sha512-bgvE59bJFsT/tN2CvMR7f5a6NH1tWxYTl9skVrRDk4YS6ZcFP0bclYg/NMDR8D5sfQYngdNN8vxmv85eB8rPVA==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.40-1", - "@github/copilot-darwin-x64": "1.0.40-1", - "@github/copilot-linux-arm64": "1.0.40-1", - "@github/copilot-linux-x64": "1.0.40-1", - "@github/copilot-win32-arm64": "1.0.40-1", - "@github/copilot-win32-x64": "1.0.40-1" + "@github/copilot-darwin-arm64": "1.0.40-3", + "@github/copilot-darwin-x64": "1.0.40-3", + "@github/copilot-linux-arm64": "1.0.40-3", + "@github/copilot-linux-x64": "1.0.40-3", + "@github/copilot-win32-arm64": "1.0.40-3", + "@github/copilot-win32-x64": "1.0.40-3" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.40-1.tgz", - "integrity": "sha512-DSArBmv1A6BstJs23QgXzes7B8Hu+sz4Ccqh1NhY/4NPfxck1rD2v61ZWz8kdwpgTdjP6lWSZ5nLWdi9Go+PhA==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.40-3.tgz", + "integrity": "sha512-QRVt15j3azPs8foceUfwT8COnR5DULOhc+5hUp8UgSJagNGEMv8zwVPYoWiJyeApeLdERDeqBF6M6MHHbMjD+A==", "cpu": [ "arm64" ], @@ -497,9 +497,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.40-1.tgz", - "integrity": "sha512-fTOL2XChDSsPc/q//mIFlq47ABNgyUKqz1+ix5oxloE9RlT1YpD7v3O+dqU/tmdxXwMTfQqgZsYglRY/nna3yw==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.40-3.tgz", + "integrity": "sha512-8P2EBAtxjLfk8mG2DR9laWeX6WT4WkrHG+FcTciTNwzRy5YqaFAommwd+nc8I7ddktZvzgQEz8tdM8SAlQ2d2A==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.40-1.tgz", - "integrity": "sha512-+aon/9kAxgGlxLZrxzwUrNO1G/eUIhhEB6W4u1sMs2GwXjANrDr6WIsp056dOnU2TY9oEnn8vWTJQSIwyFlGHQ==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.40-3.tgz", + "integrity": "sha512-ItrOgrQ/2QKsrcUHvcSs/y/4HVypzNNFNF/0vL/30yDy89w+5z3hzydZ0uAyMHwf//sWJauAWdkQYmZqaSjT2A==", "cpu": [ "arm64" ], @@ -531,9 +531,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.40-1.tgz", - "integrity": "sha512-p44TeuI01EpizsJmQX0W21f7pPXyTvrXYkv/5W1GgCiNEP4HKLG9rdgdIEtqaIMnXFKssxpGF45+hJuz0iep5g==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.40-3.tgz", + "integrity": "sha512-WwRaJeqy+Ywx8XCKH1X/joLK1xbi6MLwWU+ZnRosr8pkvoLnewlBZRVT3dkxkPYvnTIn/PBJKjhtC2lgptbrTg==", "cpu": [ "x64" ], @@ -548,9 +548,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.40-1.tgz", - "integrity": "sha512-nrbMh1qc8VWL1KU2N+VdQ2M+4jiGlugApIFNUbfywnUITktWEpQ62Jqf2YQlrMr51f1F1fjSE/YBuDW6InzzYg==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.40-3.tgz", + "integrity": "sha512-B/JvunL2xFJ6xGLppTehIotaEqEaWOYg+P929rpx90FG2GdsR5oQ5zVHTiMJWX6YFqmW+Kwc5utCMUj7MjDmQQ==", "cpu": [ "arm64" ], @@ -565,9 +565,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.40-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.40-1.tgz", - "integrity": "sha512-n5qmzAn4OKbdHJeOmdt4eUA7XWSUOmNSJUtRswKVqgCxrmMOR/0FXCPzVS0gAJn+UEj9ApHulC6G09HR5Nhp7Q==", + "version": "1.0.40-3", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.40-3.tgz", + "integrity": "sha512-80ZFwdKzpRTVjq3MHMU6LjsWjYlVEyI0+rFiM/5s5EmbQDvSnXt4vLT4O+UTbQs+YSi5jRLtm4Q6QkIChE7AWQ==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index 7bca45eaa..26748569e 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -11,7 +11,7 @@ "test": "vitest run" }, "devDependencies": { - "@github/copilot": "^1.0.40-1", + "@github/copilot": "^1.0.40-3", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "openai": "^6.17.0", From c6c53337deac9a9b9720656cd2046f0463b715ef Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Thu, 30 Apr 2026 20:49:30 -0400 Subject: [PATCH 2/2] Add C# MCP OAuth config parity Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/src/Types.cs | 33 +++++++++++++++++++++++++++ dotnet/test/SerializationTests.cs | 38 +++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index f674a9404..3ecc483bf 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -1526,6 +1526,21 @@ public class AzureOptions // MCP Server Configuration Types // ============================================================================ +/// +/// OAuth grant type for a remote MCP server. +/// +[JsonConverter(typeof(JsonStringEnumConverter))] +public enum McpHttpServerConfigOauthGrantType +{ + /// Use the authorization code OAuth flow. + [JsonStringEnumMemberName("authorization_code")] + AuthorizationCode, + + /// Use the client credentials OAuth flow. + [JsonStringEnumMemberName("client_credentials")] + ClientCredentials +} + /// /// Abstract base class for MCP server configurations. /// @@ -1611,6 +1626,24 @@ public sealed class McpHttpServerConfig : McpServerConfig /// [JsonPropertyName("headers")] public IDictionary? Headers { get; set; } + + /// + /// Optional OAuth client ID for the remote server. + /// + [JsonPropertyName("oauthClientId")] + public string? OauthClientId { get; set; } + + /// + /// Whether this is a public OAuth client. + /// + [JsonPropertyName("oauthPublicClient")] + public bool? OauthPublicClient { get; set; } + + /// + /// Optional OAuth grant type for the remote server. + /// + [JsonPropertyName("oauthGrantType")] + public McpHttpServerConfigOauthGrantType? OauthGrantType { get; set; } } // ============================================================================ diff --git a/dotnet/test/SerializationTests.cs b/dotnet/test/SerializationTests.cs index 720844533..1e5a9e858 100644 --- a/dotnet/test/SerializationTests.cs +++ b/dotnet/test/SerializationTests.cs @@ -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 { ["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(json, options); + var httpConfig = Assert.IsType(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)