installedServerNames returns, for each supported client, the set of installed server names at scope. Clients whose config cannot be parsed (e.g. codex's TOML via the JSON path, or missing files) contribute an empty set instead of failing the listing.
(scope mcp.Scope)
| 170 | // TOML via the JSON path, or missing files) contribute an empty set instead of |
| 171 | // failing the listing. |
| 172 | func installedServerNames(scope mcp.Scope) map[string]map[string]bool { |
| 173 | out := map[string]map[string]bool{} |
| 174 | for _, client := range mcp.SupportedClients { |
| 175 | names := map[string]bool{} |
| 176 | if servers, _, err := mcp.ListServers(client, scope); err == nil { |
| 177 | for _, server := range servers { |
| 178 | names[server.Name] = true |
| 179 | } |
| 180 | } |
| 181 | out[client.Name] = names |
| 182 | } |
| 183 | return out |
| 184 | } |
| 185 | |
| 186 | func sortedClientNames() []string { |
| 187 | names := mcp.ClientNames() |
no test coverage detected