()
| 78 | |
| 79 | // Main menu items (includes servers) |
| 80 | const getMainMenuItems = (): MCPMenuItem[] => { |
| 81 | const options: MCPMenuItem[] = []; |
| 82 | |
| 83 | // Add individual servers first |
| 84 | if (connections.length > 0) { |
| 85 | connections.forEach((conn) => { |
| 86 | const { icon } = getServerStatusDisplay(conn); |
| 87 | |
| 88 | let serverLabel = `${icon} ${conn.config.name}`; |
| 89 | |
| 90 | // Add tools and prompts count if server is connected |
| 91 | if (conn.status === "connected") { |
| 92 | const toolsCount = conn.tools.length; |
| 93 | const promptsCount = conn.prompts.length; |
| 94 | |
| 95 | const counts = []; |
| 96 | if (toolsCount > 0) { |
| 97 | counts.push(`🔧${toolsCount}`); |
| 98 | } |
| 99 | if (promptsCount > 0) { |
| 100 | counts.push(`📝${promptsCount}`); |
| 101 | } |
| 102 | |
| 103 | if (counts.length > 0) { |
| 104 | serverLabel += ` (${counts.join(" ")})`; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | options.push({ |
| 109 | label: serverLabel, |
| 110 | value: `server:${conn.config.name}`, |
| 111 | }); |
| 112 | }); |
| 113 | |
| 114 | // Add bulk actions |
| 115 | options.push( |
| 116 | { label: "🔄 Restart all servers", value: "restart-all" }, |
| 117 | { label: "⏹️ Stop all servers", value: "stop-all" }, |
| 118 | ); |
| 119 | } |
| 120 | |
| 121 | // Add "Explore MCP Servers" option at the bottom |
| 122 | options.push({ |
| 123 | label: "🔍 Explore MCP Servers", |
| 124 | value: "explore-mcp-servers", |
| 125 | }); |
| 126 | |
| 127 | return options; |
| 128 | }; |
| 129 | |
| 130 | // Server detail items |
| 131 | const getServerDetailItems = (): MCPMenuItem[] => { |
no test coverage detected