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 @@ -98,6 +98,7 @@ impl CommandExecutor {
"mcp" => self.cmd_mcp(cmd),
"mcp-tools" | "tools" | "lt" => CommandResult::OpenModal(ModalType::McpManager),
"mcp-auth" | "auth" => CommandResult::OpenModal(ModalType::McpManager),
"mcp-remove" | "mcp-rm" => CommandResult::OpenModal(ModalType::McpManager),
"mcp-reload" => CommandResult::OpenModal(ModalType::McpManager),
"mcp-logs" => CommandResult::OpenModal(ModalType::McpManager),

Expand Down
12 changes: 12 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,18 @@ fn test_async_commands() {
));
}

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

for command in ["/mcp-remove", "/mcp-rm"] {
assert!(matches!(
executor.execute_str(command),
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 @@ -590,6 +590,15 @@ pub fn register_builtin_commands(registry: &mut CommandRegistry) {
false,
));

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

registry.register(CommandDef::new(
"mcp-reload",
&[],
Expand Down
2 changes: 2 additions & 0 deletions src/cortex-tui/src/commands/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ mod tests {
assert!(registry.exists("mcp"));
assert!(registry.exists("mcp-tools"));
assert!(registry.exists("mcp-auth"));
assert!(registry.exists("mcp-remove"));
assert!(registry.exists("mcp-rm"));
assert!(registry.exists("mcp-reload"));

// Auth
Expand Down