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

Function McpLibraryPage

frontend/src/pages/McpLibraryPage.tsx:255–2874  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253};
254
255export function McpLibraryPage() {
256 const { toast } = useToast();
257 const [searchQuery, setSearchQuery] = useState('');
258 const [editorOpen, setEditorOpen] = useState(false);
259 const [editingServer, setEditingServer] = useState<string | null>(null);
260 const [formData, setFormData] = useState<ServerFormData>(INITIAL_FORM_DATA);
261 const [isSaving, setIsSaving] = useState(false);
262 const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
263 const [serverToDelete, setServerToDelete] = useState<string | null>(null);
264 const [isDeleting, setIsDeleting] = useState(false);
265 const [testingServer, setTestingServer] = useState<string | null>(null);
266 const [checkingServers, setCheckingServers] = useState<Set<string>>(new Set());
267 const [toolsDialogOpen, setToolsDialogOpen] = useState(false);
268 const [selectedServerForTools, setSelectedServerForTools] = useState<string | null>(null);
269 const [jsonValue, setJsonValue] = useState('');
270 const [jsonParseError, setJsonParseError] = useState<string | null>(null);
271 const [isImporting, setIsImporting] = useState(false);
272 const [isTestingDiscovery, setIsTestingDiscovery] = useState(false);
273 const [discoveryPreview, setDiscoveryPreview] = useState<
274 | {
275 name: string;
276 transportType: 'http' | 'stdio';
277 toolCount: number;
278 tools?: { name: string; description?: string }[];
279 error?: string;
280 status: 'pending' | 'discovering' | 'completed' | 'failed';
281 cacheToken?: string;
282 }[]
283 | null
284 >(null);
285 const [discoveryCacheTokens, setDiscoveryCacheTokens] = useState<
286 Map<
287 string,
288 {
289 cacheToken: string;
290 tools: { name: string; description?: string; inputSchema?: Record<string, unknown> }[];
291 }
292 >
293 >(new Map());
294 const [activeTab, setActiveTab] = useState<'manual' | 'json'>('manual');
295 const [headerEntries, setHeaderEntries] = useState<HeaderEntry[]>([]);
296 const [secretPickerEntryIndex, setSecretPickerEntryIndex] = useState<number | null>(null);
297 const [discoveringServerIds, setDiscoveringServerIds] = useState<Set<string>>(new Set());
298 const [groupTemplates, setGroupTemplates] = useState<McpGroupTemplateResponse[]>([]);
299 const [isLoadingTemplates, setIsLoadingTemplates] = useState(false);
300 const [importingTemplates, setImportingTemplates] = useState<Set<string>>(new Set());
301 const [templatesOpen, setTemplatesOpen] = useState(true);
302 const [templatesManuallyToggled, setTemplatesManuallyToggled] = useState(false);
303 // Group template discovery preview state - keyed by template slug
304 const [groupDiscoveryPreview, setGroupDiscoveryPreview] = useState<
305 Record<
306 string,
307 {
308 name: string;
309 transportType: 'http' | 'stdio';
310 toolCount: number;
311 tools?: { name: string; description?: string }[];
312 error?: string;

Callers

nothing calls this directly

Calls 15

useToastFunction · 0.90
cnFunction · 0.90
fetchServersFunction · 0.85
fetchGroupServersFunction · 0.85
parseClaudeCodeConfigFunction · 0.85
getGroupServersFunction · 0.85
refreshTemplatesFunction · 0.85
getGroupThemeFunction · 0.85
handleRemoveGroupFunction · 0.85
renderServerTableHeaderFunction · 0.85

Tested by

no test coverage detected