File tree Expand file tree Collapse file tree
src/cortex-tui/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ impl CommandExecutor {
9696 // ============ MCP ============
9797 // All MCP commands redirect to the interactive panel
9898 "mcp" => self . cmd_mcp ( cmd) ,
99+ "mcp-list" => CommandResult :: OpenModal ( ModalType :: McpManager ) ,
99100 "mcp-tools" | "tools" | "lt" => CommandResult :: OpenModal ( ModalType :: McpManager ) ,
100101 "mcp-auth" | "auth" => CommandResult :: OpenModal ( ModalType :: McpManager ) ,
101102 "mcp-reload" => CommandResult :: OpenModal ( ModalType :: McpManager ) ,
Original file line number Diff line number Diff line change @@ -256,6 +256,16 @@ fn test_async_commands() {
256256 ) ) ;
257257}
258258
259+ #[ test]
260+ fn test_mcp_list_opens_mcp_manager ( ) {
261+ let executor = CommandExecutor :: new ( ) ;
262+
263+ assert ! ( matches!(
264+ executor. execute_str( "/mcp-list" ) ,
265+ CommandResult :: OpenModal ( ModalType :: McpManager )
266+ ) ) ;
267+ }
268+
259269#[ test]
260270fn test_add_command ( ) {
261271 let executor = CommandExecutor :: new ( ) ;
Original file line number Diff line number Diff line change @@ -581,6 +581,15 @@ pub fn register_builtin_commands(registry: &mut CommandRegistry) {
581581 false ,
582582 ) ) ;
583583
584+ registry. register ( CommandDef :: new (
585+ "mcp-list" ,
586+ & [ ] ,
587+ "List MCP servers" ,
588+ "/mcp-list" ,
589+ CommandCategory :: Mcp ,
590+ false ,
591+ ) ) ;
592+
584593 registry. register ( CommandDef :: new (
585594 "mcp-auth" ,
586595 & [ "auth" ] ,
Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ mod tests {
193193
194194 // MCP
195195 assert ! ( registry. exists( "mcp" ) ) ;
196+ assert ! ( registry. exists( "mcp-list" ) ) ;
196197 assert ! ( registry. exists( "mcp-tools" ) ) ;
197198 assert ! ( registry. exists( "mcp-auth" ) ) ;
198199 assert ! ( registry. exists( "mcp-reload" ) ) ;
You can’t perform that action at this time.
0 commit comments