MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / onSubmit

Function onSubmit

src/components/MCPServerDesktopImportDialog.tsx:27–49  ·  view source on GitHub ↗
(selectedServers: string[])

Source from the content-addressed store, hash-verified

25 const collisions = serverNames.filter(name => existingServers[name] !== undefined);
26
27 async function onSubmit(selectedServers: string[]) {
28 let importedCount = 0;
29
30 for (const serverName of selectedServers) {
31 const serverConfig = servers[serverName];
32 if (serverConfig) {
33 // If the server name already exists, find a new name with _1, _2, etc.
34 let finalName = serverName;
35 if (existingServers[finalName] !== undefined) {
36 let counter = 1;
37 while (existingServers[`${serverName}_${counter}`] !== undefined) {
38 counter++;
39 }
40 finalName = `${serverName}_${counter}`;
41 }
42
43 await addMcpConfig(finalName, serverConfig, scope);
44 importedCount++;
45 }
46 }
47
48 done(importedCount);
49 }
50
51 const [theme] = useTheme();
52

Callers

nothing calls this directly

Calls 2

addMcpConfigFunction · 0.85
doneFunction · 0.50

Tested by

no test coverage detected