Skip to content
Open
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
1 change: 1 addition & 0 deletions src/cortex-tui/src/commands/executor/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ impl CommandExecutor {
// ============ MCP ============
// All MCP commands redirect to the interactive panel
"mcp" => self.cmd_mcp(cmd),
"mcp-list" => CommandResult::OpenModal(ModalType::McpManager),
"mcp-tools" | "tools" | "lt" => CommandResult::OpenModal(ModalType::McpManager),
"mcp-auth" | "auth" => CommandResult::OpenModal(ModalType::McpManager),
"mcp-reload" => CommandResult::OpenModal(ModalType::McpManager),
Expand Down
10 changes: 10 additions & 0 deletions src/cortex-tui/src/commands/executor/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ fn test_async_commands() {
));
}

#[test]
fn test_mcp_list_opens_mcp_manager() {
let executor = CommandExecutor::new();

assert!(matches!(
executor.execute_str("/mcp-list"),
CommandResult::OpenModal(ModalType::McpManager)
));
}

#[test]
fn test_add_command() {
let executor = CommandExecutor::new();
Expand Down
9 changes: 9 additions & 0 deletions src/cortex-tui/src/commands/registry/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,15 @@ pub fn register_builtin_commands(registry: &mut CommandRegistry) {
false,
));

registry.register(CommandDef::new(
"mcp-list",
&[],
"List MCP servers",
"/mcp-list",
CommandCategory::Mcp,
false,
));

registry.register(CommandDef::new(
"mcp-auth",
&["auth"],
Expand Down
1 change: 1 addition & 0 deletions src/cortex-tui/src/commands/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ mod tests {

// MCP
assert!(registry.exists("mcp"));
assert!(registry.exists("mcp-list"));
assert!(registry.exists("mcp-tools"));
assert!(registry.exists("mcp-auth"));
assert!(registry.exists("mcp-reload"));
Expand Down