MCPcopy Create free account
hub / github.com/ShipSecAI/studio / fetchServers

Function fetchServers

frontend/src/components/workflow/McpGroupConfig.tsx:40–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39 // Fetch group servers on mount
40 const fetchServers = async () => {
41 try {
42 setIsLoading(true);
43 setError(null);
44
45 // First, find the group by slug
46 const groups = await mcpGroupsApi.listGroups();
47 const group = groups.find((g) => g.slug === groupSlug);
48
49 if (!group) {
50 throw new Error(`Group "${groupSlug}" not found`);
51 }
52
53 // Then fetch the servers
54 const groupServers = await mcpGroupsApi.getGroupServers(group.id);
55 setServers(groupServers.filter((s) => s.enabled));
56 } catch (err) {
57 setError(err instanceof Error ? err.message : 'Failed to load group servers');
58 setServers([]);
59 } finally {
60 setIsLoading(false);
61 }
62 };
63
64 useEffect(() => {
65 fetchServers();

Callers 9

McpGroupConfigFunction · 0.85
handleRefreshFunction · 0.85
McpLibraryToolSelectorFunction · 0.85
handleRefreshFunction · 0.85
McpLibraryConfigFunction · 0.85
handleRefreshFunction · 0.85
McpLibraryPageFunction · 0.85
handleSaveFunction · 0.85
handleJsonSaveFunction · 0.85

Calls 1

listGroupsMethod · 0.45

Tested by

no test coverage detected