| 330 | } |
| 331 | |
| 332 | func (cli *ChatCLI) mcpLogs(name string) { |
| 333 | if name == "" { |
| 334 | fmt.Println(colorize(" "+i18n.T("mcp.cmd.usage_logs"), ColorYellow)) |
| 335 | return |
| 336 | } |
| 337 | if !cli.mcpServerExists(name) { |
| 338 | fmt.Println(colorize(" "+i18n.T("mcp.cmd.unknown_server", name), ColorRed)) |
| 339 | return |
| 340 | } |
| 341 | lines := cli.mcpManager.RecentLogs(name) |
| 342 | fmt.Println() |
| 343 | fmt.Println(uiBox("📜", i18n.T("mcp.cmd.box_logs_title", name), ColorCyan)) |
| 344 | p := uiPrefix(ColorCyan) |
| 345 | if len(lines) == 0 { |
| 346 | fmt.Println(p + colorize(i18n.T("mcp.cmd.no_logs"), ColorGray)) |
| 347 | fmt.Println(uiBoxEnd(ColorCyan)) |
| 348 | return |
| 349 | } |
| 350 | for _, line := range lines { |
| 351 | fmt.Println(p + " " + line) |
| 352 | } |
| 353 | fmt.Println(uiBoxEnd(ColorCyan)) |
| 354 | fmt.Println() |
| 355 | } |
| 356 | |
| 357 | // mcpServerExists returns true when the named server is currently |
| 358 | // configured (either running or stopped-but-known). Used to give a |