MCPcopy Index your code
hub / github.com/codeaashu/claude-code / MCPServerApprovalDialog

Function MCPServerApprovalDialog

src/components/MCPServerApprovalDialog.tsx:12–114  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

10 onDone(): void;
11};
12export function MCPServerApprovalDialog(t0) {
13 const $ = _c(13);
14 const {
15 serverName,
16 onDone
17 } = t0;
18 let t1;
19 if ($[0] !== onDone || $[1] !== serverName) {
20 t1 = function onChange(value) {
21 logEvent("tengu_mcp_dialog_choice", {
22 choice: value as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
23 });
24 bb2: switch (value) {
25 case "yes":
26 case "yes_all":
27 {
28 const currentSettings_0 = getSettings_DEPRECATED() || {};
29 const enabledServers = currentSettings_0.enabledMcpjsonServers || [];
30 if (!enabledServers.includes(serverName)) {
31 updateSettingsForSource("localSettings", {
32 enabledMcpjsonServers: [...enabledServers, serverName]
33 });
34 }
35 if (value === "yes_all") {
36 updateSettingsForSource("localSettings", {
37 enableAllProjectMcpServers: true
38 });
39 }
40 onDone();
41 break bb2;
42 }
43 case "no":
44 {
45 const currentSettings = getSettings_DEPRECATED() || {};
46 const disabledServers = currentSettings.disabledMcpjsonServers || [];
47 if (!disabledServers.includes(serverName)) {
48 updateSettingsForSource("localSettings", {
49 disabledMcpjsonServers: [...disabledServers, serverName]
50 });
51 }
52 onDone();
53 }
54 }
55 };
56 $[0] = onDone;
57 $[1] = serverName;
58 $[2] = t1;
59 } else {
60 t1 = $[2];
61 }
62 const onChange = t1;
63 const t2 = `New MCP server found in .mcp.json: ${serverName}`;
64 let t3;
65 if ($[3] !== onChange) {
66 t3 = () => onChange("no");
67 $[3] = onChange;
68 $[4] = t3;
69 } else {

Callers

nothing calls this directly

Calls 4

logEventFunction · 0.85
updateSettingsForSourceFunction · 0.85
onDoneFunction · 0.50
onChangeFunction · 0.50

Tested by

no test coverage detected