@@ -1078,6 +1078,23 @@ pub struct SessionConfig {
10781078 /// Defaults to `Some(true)` via [`SessionConfig::default`].
10791079 #[ serde( skip_serializing_if = "Option::is_none" ) ]
10801080 pub request_elicitation : Option < bool > ,
1081+ /// Enable MCP Apps (SEP-1865) UI passthrough on this session.
1082+ ///
1083+ /// When `Some(true)`, the runtime adds the `mcp-apps` capability to the
1084+ /// session, which causes it to advertise the
1085+ /// `extensions.io.modelcontextprotocol/ui` extension to MCP servers (so
1086+ /// they expose `_meta.ui.resourceUri` on tools) and to expose the
1087+ /// `session.rpc.mcp.apps.{listTools,callTool,readResource,setHostContext,
1088+ /// getHostContext}` JSON-RPC methods.
1089+ ///
1090+ /// SDK consumers MUST set this to `Some(true)` only when they have an
1091+ /// iframe renderer that can display `ui://` MCP App bundles. Setting it
1092+ /// without a renderer will cause MCP servers to register UI-enabled tool
1093+ /// variants the consumer cannot display.
1094+ ///
1095+ /// Defaults to `None` (disabled).
1096+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1097+ pub request_mcp_apps : Option < bool > ,
10811098 /// Skill directory paths passed through to the GitHub Copilot CLI.
10821099 #[ serde( skip_serializing_if = "Option::is_none" ) ]
10831100 pub skill_directories : Option < Vec < PathBuf > > ,
@@ -1208,6 +1225,7 @@ impl std::fmt::Debug for SessionConfig {
12081225 . field ( "request_exit_plan_mode" , & self . request_exit_plan_mode )
12091226 . field ( "request_auto_mode_switch" , & self . request_auto_mode_switch )
12101227 . field ( "request_elicitation" , & self . request_elicitation )
1228+ . field ( "request_mcp_apps" , & self . request_mcp_apps )
12111229 . field ( "skill_directories" , & self . skill_directories )
12121230 . field ( "instruction_directories" , & self . instruction_directories )
12131231 . field ( "disabled_skills" , & self . disabled_skills )
@@ -1271,6 +1289,7 @@ impl Default for SessionConfig {
12711289 request_exit_plan_mode : Some ( true ) ,
12721290 request_auto_mode_switch : Some ( true ) ,
12731291 request_elicitation : Some ( true ) ,
1292+ request_mcp_apps : None ,
12741293 skill_directories : None ,
12751294 instruction_directories : None ,
12761295 disabled_skills : None ,
@@ -1491,6 +1510,13 @@ impl SessionConfig {
14911510 self
14921511 }
14931512
1513+ /// Enable MCP Apps (SEP-1865) UI passthrough on this session. Defaults
1514+ /// to `None` (disabled). See [`SessionConfig::request_mcp_apps`].
1515+ pub fn with_request_mcp_apps ( mut self , enable : bool ) -> Self {
1516+ self . request_mcp_apps = Some ( enable) ;
1517+ self
1518+ }
1519+
14941520 /// Set skill directory paths passed through to the CLI.
14951521 pub fn with_skill_directories < I , P > ( mut self , paths : I ) -> Self
14961522 where
@@ -1680,6 +1706,10 @@ pub struct ResumeSessionConfig {
16801706 /// Advertise elicitation provider capability on resume.
16811707 #[ serde( skip_serializing_if = "Option::is_none" ) ]
16821708 pub request_elicitation : Option < bool > ,
1709+ /// Enable MCP Apps (SEP-1865) UI passthrough on resume. See
1710+ /// [`SessionConfig::request_mcp_apps`].
1711+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1712+ pub request_mcp_apps : Option < bool > ,
16831713 /// Skill directory paths passed through to the GitHub Copilot CLI on resume.
16841714 #[ serde( skip_serializing_if = "Option::is_none" ) ]
16851715 pub skill_directories : Option < Vec < PathBuf > > ,
@@ -1790,6 +1820,7 @@ impl std::fmt::Debug for ResumeSessionConfig {
17901820 . field ( "request_exit_plan_mode" , & self . request_exit_plan_mode )
17911821 . field ( "request_auto_mode_switch" , & self . request_auto_mode_switch )
17921822 . field ( "request_elicitation" , & self . request_elicitation )
1823+ . field ( "request_mcp_apps" , & self . request_mcp_apps )
17931824 . field ( "skill_directories" , & self . skill_directories )
17941825 . field ( "instruction_directories" , & self . instruction_directories )
17951826 . field ( "disabled_skills" , & self . disabled_skills )
@@ -1852,6 +1883,7 @@ impl ResumeSessionConfig {
18521883 request_exit_plan_mode : Some ( true ) ,
18531884 request_auto_mode_switch : Some ( true ) ,
18541885 request_elicitation : Some ( true ) ,
1886+ request_mcp_apps : None ,
18551887 skill_directories : None ,
18561888 instruction_directories : None ,
18571889 disabled_skills : None ,
@@ -2043,6 +2075,13 @@ impl ResumeSessionConfig {
20432075 self
20442076 }
20452077
2078+ /// Enable MCP Apps (SEP-1865) UI passthrough on resume. Defaults to
2079+ /// `None` (disabled). See [`SessionConfig::request_mcp_apps`].
2080+ pub fn with_request_mcp_apps ( mut self , enable : bool ) -> Self {
2081+ self . request_mcp_apps = Some ( enable) ;
2082+ self
2083+ }
2084+
20462085 /// Set skill directory paths passed through to the CLI on resume.
20472086 pub fn with_skill_directories < I , P > ( mut self , paths : I ) -> Self
20482087 where
@@ -3366,6 +3405,7 @@ mod tests {
33663405 assert_eq ! ( cfg. request_elicitation, Some ( true ) ) ;
33673406 assert_eq ! ( cfg. request_exit_plan_mode, Some ( true ) ) ;
33683407 assert_eq ! ( cfg. request_auto_mode_switch, Some ( true ) ) ;
3408+ assert_eq ! ( cfg. request_mcp_apps, None ) ;
33693409 }
33703410
33713411 #[ test]
@@ -3376,6 +3416,7 @@ mod tests {
33763416 assert_eq ! ( cfg. request_elicitation, Some ( true ) ) ;
33773417 assert_eq ! ( cfg. request_exit_plan_mode, Some ( true ) ) ;
33783418 assert_eq ! ( cfg. request_auto_mode_switch, Some ( true ) ) ;
3419+ assert_eq ! ( cfg. request_mcp_apps, None ) ;
33793420 }
33803421
33813422 #[ test]
0 commit comments