@mcpjam/inspector 0.2.4 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OAuthCallback-DkLMDxkx.js","assets/oauthUtils-DTcoXpSP.js","assets/OAuthDebugCallback-DaNmVTKt.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OAuthCallback-mxRvi54D.js","assets/oauthUtils-DTcoXpSP.js","assets/OAuthDebugCallback-CjHmkokp.js"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -16041,6 +16041,16 @@ const Activity = createLucideIcon("Activity", [
16041
16041
  }
16042
16042
  ]
16043
16043
  ]);
16044
+ /**
16045
+ * @license lucide-react v0.447.0 - ISC
16046
+ *
16047
+ * This source code is licensed under the ISC license.
16048
+ * See the LICENSE file in the root directory of this source tree.
16049
+ */
16050
+ const ArrowLeft = createLucideIcon("ArrowLeft", [
16051
+ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
16052
+ ["path", { d: "M19 12H5", key: "x3x0zl" }]
16053
+ ]);
16044
16054
  /**
16045
16055
  * @license lucide-react v0.447.0 - ISC
16046
16056
  *
@@ -16074,6 +16084,31 @@ const Bot = createLucideIcon("Bot", [
16074
16084
  ["path", { d: "M15 13v2", key: "1xurst" }],
16075
16085
  ["path", { d: "M9 13v2", key: "rq6x2g" }]
16076
16086
  ]);
16087
+ /**
16088
+ * @license lucide-react v0.447.0 - ISC
16089
+ *
16090
+ * This source code is licensed under the ISC license.
16091
+ * See the LICENSE file in the root directory of this source tree.
16092
+ */
16093
+ const Bug = createLucideIcon("Bug", [
16094
+ ["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
16095
+ ["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
16096
+ ["path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1", key: "d7y7pr" }],
16097
+ [
16098
+ "path",
16099
+ {
16100
+ d: "M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",
16101
+ key: "xs1cw7"
16102
+ }
16103
+ ],
16104
+ ["path", { d: "M12 20v-9", key: "1qisl0" }],
16105
+ ["path", { d: "M6.53 9C4.6 8.8 3 7.1 3 5", key: "32zzws" }],
16106
+ ["path", { d: "M6 13H2", key: "82j7cp" }],
16107
+ ["path", { d: "M3 21c0-2.1 1.7-3.9 3.8-4", key: "4p0ekp" }],
16108
+ ["path", { d: "M20.97 5c0 2.1-1.6 3.8-3.5 4", key: "18gb23" }],
16109
+ ["path", { d: "M22 13h-4", key: "1jl80f" }],
16110
+ ["path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4", key: "k3fwyw" }]
16111
+ ]);
16077
16112
  /**
16078
16113
  * @license lucide-react v0.447.0 - ISC
16079
16114
  *
@@ -16212,6 +16247,18 @@ const CodeXml = createLucideIcon("CodeXml", [
16212
16247
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
16213
16248
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
16214
16249
  ]);
16250
+ /**
16251
+ * @license lucide-react v0.447.0 - ISC
16252
+ *
16253
+ * This source code is licensed under the ISC license.
16254
+ * See the LICENSE file in the root directory of this source tree.
16255
+ */
16256
+ const CopyPlus = createLucideIcon("CopyPlus", [
16257
+ ["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
16258
+ ["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
16259
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
16260
+ ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
16261
+ ]);
16215
16262
  /**
16216
16263
  * @license lucide-react v0.447.0 - ISC
16217
16264
  *
@@ -16377,6 +16424,17 @@ const History = createLucideIcon("History", [
16377
16424
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
16378
16425
  ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
16379
16426
  ]);
16427
+ /**
16428
+ * @license lucide-react v0.447.0 - ISC
16429
+ *
16430
+ * This source code is licensed under the ISC license.
16431
+ * See the LICENSE file in the root directory of this source tree.
16432
+ */
16433
+ const Info = createLucideIcon("Info", [
16434
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
16435
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
16436
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
16437
+ ]);
16380
16438
  /**
16381
16439
  * @license lucide-react v0.447.0 - ISC
16382
16440
  *
@@ -16563,6 +16621,25 @@ const Settings = createLucideIcon("Settings", [
16563
16621
  ],
16564
16622
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
16565
16623
  ]);
16624
+ /**
16625
+ * @license lucide-react v0.447.0 - ISC
16626
+ *
16627
+ * This source code is licensed under the ISC license.
16628
+ * See the LICENSE file in the root directory of this source tree.
16629
+ */
16630
+ const Sparkles = createLucideIcon("Sparkles", [
16631
+ [
16632
+ "path",
16633
+ {
16634
+ d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",
16635
+ key: "4pj2yx"
16636
+ }
16637
+ ],
16638
+ ["path", { d: "M20 3v4", key: "1olli1" }],
16639
+ ["path", { d: "M22 5h-4", key: "1gvqau" }],
16640
+ ["path", { d: "M4 17v2", key: "vumght" }],
16641
+ ["path", { d: "M5 18H3", key: "zchphs" }]
16642
+ ]);
16566
16643
  /**
16567
16644
  * @license lucide-react v0.447.0 - ISC
16568
16645
  *
@@ -16629,6 +16706,18 @@ const User = createLucideIcon("User", [
16629
16706
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
16630
16707
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
16631
16708
  ]);
16709
+ /**
16710
+ * @license lucide-react v0.447.0 - ISC
16711
+ *
16712
+ * This source code is licensed under the ISC license.
16713
+ * See the LICENSE file in the root directory of this source tree.
16714
+ */
16715
+ const Users = createLucideIcon("Users", [
16716
+ ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
16717
+ ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
16718
+ ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
16719
+ ["path", { d: "M16 3.13a4 4 0 0 1 0 7.75", key: "1da9ce" }]
16720
+ ]);
16632
16721
  /**
16633
16722
  * @license lucide-react v0.447.0 - ISC
16634
16723
  *
@@ -16976,11 +17065,6 @@ class DebugInspectorOAuthClientProvider extends InspectorOAuthClientProvider {
16976
17065
  );
16977
17066
  }
16978
17067
  }
16979
- const auth$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16980
- __proto__: null,
16981
- DebugInspectorOAuthClientProvider,
16982
- InspectorOAuthClientProvider
16983
- }, Symbol.toStringTag, { value: "Module" }));
16984
17068
  const OAuthStepDetails = ({
16985
17069
  label,
16986
17070
  isComplete,
@@ -18183,7 +18267,11 @@ const JsonNode = reactExports.memo(
18183
18267
  }
18184
18268
  );
18185
18269
  JsonNode.displayName = "JsonNode";
18186
- const RequestHistoryItem = ({ request, index: index2, totalRequests }) => {
18270
+ const RequestHistoryItem = ({
18271
+ request,
18272
+ index: index2,
18273
+ totalRequests
18274
+ }) => {
18187
18275
  const [isExpanded, setIsExpanded] = reactExports.useState(false);
18188
18276
  const toggleExpansion = () => {
18189
18277
  setIsExpanded(!isExpanded);
@@ -18225,7 +18313,15 @@ const RequestHistoryItem = ({ request, index: index2, totalRequests }) => {
18225
18313
  )
18226
18314
  ] });
18227
18315
  };
18228
- const RequestHeader = ({ requestNumber, method, server, timestamp, latency, isExpanded, onToggle }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
18316
+ const RequestHeader = ({
18317
+ requestNumber,
18318
+ method,
18319
+ server,
18320
+ timestamp,
18321
+ latency,
18322
+ isExpanded,
18323
+ onToggle
18324
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
18229
18325
  "header",
18230
18326
  {
18231
18327
  className: "flex justify-between items-center cursor-pointer group",
@@ -18241,12 +18337,27 @@ const RequestHeader = ({ requestNumber, method, server, timestamp, latency, isEx
18241
18337
  "aria-expanded": isExpanded,
18242
18338
  "aria-label": `Request ${requestNumber}: ${method}`,
18243
18339
  children: [
18244
- /* @__PURE__ */ jsxRuntimeExports.jsx(RequestInfo, { requestNumber, method, server, timestamp, latency }),
18340
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
18341
+ RequestInfo,
18342
+ {
18343
+ requestNumber,
18344
+ method,
18345
+ server,
18346
+ timestamp,
18347
+ latency
18348
+ }
18349
+ ),
18245
18350
  /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandIcon, { isExpanded })
18246
18351
  ]
18247
18352
  }
18248
18353
  );
18249
- const RequestInfo = ({ requestNumber, method, server, timestamp, latency }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
18354
+ const RequestInfo = ({
18355
+ requestNumber,
18356
+ method,
18357
+ server,
18358
+ timestamp,
18359
+ latency
18360
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
18250
18361
  /* @__PURE__ */ jsxRuntimeExports.jsx(RequestBadge, { number: requestNumber }),
18251
18362
  /* @__PURE__ */ jsxRuntimeExports.jsx(TimeStamp, { timestamp }),
18252
18363
  /* @__PURE__ */ jsxRuntimeExports.jsx(MethodLabel, { method, server }),
@@ -18288,77 +18399,99 @@ const RequestSection = ({ title: title2, data: data2 }) => /* @__PURE__ */ jsxRu
18288
18399
  )
18289
18400
  ] });
18290
18401
  const SectionHeader = ({ title: title2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "flex items-center mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-foreground text-sm", children: title2 }) });
18402
+ const formatRequestCount = (count2) => {
18403
+ return `${count2} request${count2 !== 1 ? "s" : ""}`;
18404
+ };
18405
+ const ClearHistoryButton = ({ onClick }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
18406
+ "button",
18407
+ {
18408
+ onClick,
18409
+ className: "p-2 rounded-lg hover:bg-destructive/10 hover:text-destructive transition-all duration-200 group",
18410
+ title: "Clear all activity",
18411
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-4 h-4 text-muted-foreground group-hover:text-destructive" })
18412
+ }
18413
+ );
18414
+ const RequestCountBadge = ({ count: count2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-muted-foreground bg-muted/50 px-3 py-1 rounded-full", children: formatRequestCount(count2) });
18415
+ const CollapseToggleButton = ({ onClick }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
18416
+ "button",
18417
+ {
18418
+ onClick,
18419
+ className: "p-2 rounded-lg hover:bg-accent/50 transition-all duration-200",
18420
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-muted-foreground hover:text-foreground" })
18421
+ }
18422
+ );
18423
+ const ActivityHeader = ({
18424
+ requestHistory,
18425
+ onClearHistory,
18426
+ onToggleCollapse
18427
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18428
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-bold text-foreground flex items-center space-x-2", children: [
18429
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-5 h-5 text-primary" }),
18430
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "All Activity" })
18431
+ ] }),
18432
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
18433
+ requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
18434
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RequestCountBadge, { count: requestHistory.length }),
18435
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ClearHistoryButton, { onClick: onClearHistory })
18436
+ ] }),
18437
+ onToggleCollapse && /* @__PURE__ */ jsxRuntimeExports.jsx(CollapseToggleButton, { onClick: onToggleCollapse })
18438
+ ] })
18439
+ ] });
18440
+ const CompactHeader = ({
18441
+ requestHistory,
18442
+ onClearHistory
18443
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18444
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RequestCountBadge, { count: requestHistory.length }),
18445
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ClearHistoryButton, { onClick: onClearHistory })
18446
+ ] });
18447
+ const EmptyState$1 = () => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
18448
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-12 h-12 text-muted-foreground/40 mb-4" }),
18449
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground text-lg font-medium mb-2", children: "No activity yet" }),
18450
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground/60 text-sm", children: "MCP requests and responses will appear here" })
18451
+ ] });
18452
+ const RequestHistoryList = ({
18453
+ requestHistory
18454
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-4", children: requestHistory.slice().reverse().map((request, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
18455
+ RequestHistoryItem,
18456
+ {
18457
+ request,
18458
+ index: index2,
18459
+ totalRequests: requestHistory.length
18460
+ },
18461
+ index2
18462
+ )) });
18291
18463
  const ActivityTab = ({
18292
18464
  requestHistory,
18293
18465
  onClearHistory,
18294
18466
  onToggleCollapse,
18295
18467
  showHeader = true
18296
18468
  }) => {
18297
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex-1 overflow-y-auto ${showHeader ? "p-6 border-r border-border/20" : ""}`, children: [
18298
- showHeader && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18299
- /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-bold text-foreground flex items-center space-x-2", children: [
18300
- /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-5 h-5 text-primary" }),
18301
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "All Activity" })
18302
- ] }),
18303
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
18304
- requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
18305
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-muted-foreground bg-muted/50 px-3 py-1 rounded-full", children: [
18306
- requestHistory.length,
18307
- " request",
18308
- requestHistory.length !== 1 ? "s" : ""
18309
- ] }),
18310
- /* @__PURE__ */ jsxRuntimeExports.jsx(
18311
- "button",
18312
- {
18313
- onClick: onClearHistory,
18314
- className: "p-2 rounded-lg hover:bg-destructive/10 hover:text-destructive transition-all duration-200 group",
18315
- title: "Clear all activity",
18316
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-4 h-4 text-muted-foreground group-hover:text-destructive" })
18317
- }
18318
- )
18319
- ] }),
18320
- onToggleCollapse && /* @__PURE__ */ jsxRuntimeExports.jsx(
18321
- "button",
18322
- {
18323
- onClick: onToggleCollapse,
18324
- className: "p-2 rounded-lg hover:bg-accent/50 transition-all duration-200",
18325
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-muted-foreground hover:text-foreground" })
18326
- }
18327
- )
18328
- ] })
18329
- ] }),
18330
- requestHistory.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
18331
- /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-12 h-12 text-muted-foreground/40 mb-4" }),
18332
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground text-lg font-medium mb-2", children: "No activity yet" }),
18333
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground/60 text-sm", children: "MCP requests and responses will appear here" })
18334
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
18335
- !showHeader && requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18336
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-muted-foreground bg-muted/50 px-3 py-1 rounded-full", children: [
18337
- requestHistory.length,
18338
- " request",
18339
- requestHistory.length !== 1 ? "s" : ""
18340
- ] }),
18341
- /* @__PURE__ */ jsxRuntimeExports.jsx(
18342
- "button",
18469
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18470
+ "div",
18471
+ {
18472
+ className: `flex-1 overflow-y-auto ${showHeader ? "p-6 border-r border-border/20" : ""}`,
18473
+ children: [
18474
+ showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx(
18475
+ ActivityHeader,
18343
18476
  {
18344
- onClick: onClearHistory,
18345
- className: "p-2 rounded-lg hover:bg-destructive/10 hover:text-destructive transition-all duration-200 group",
18346
- title: "Clear all activity",
18347
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-4 h-4 text-muted-foreground group-hover:text-destructive" })
18477
+ requestHistory,
18478
+ onClearHistory,
18479
+ onToggleCollapse
18348
18480
  }
18349
- )
18350
- ] }),
18351
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-4", children: requestHistory.slice().reverse().map((request, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
18352
- RequestHistoryItem,
18353
- {
18354
- request,
18355
- index: index2,
18356
- totalRequests: requestHistory.length
18357
- },
18358
- index2
18359
- )) })
18360
- ] })
18361
- ] });
18481
+ ),
18482
+ requestHistory.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyState$1, {}) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
18483
+ !showHeader && requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
18484
+ CompactHeader,
18485
+ {
18486
+ requestHistory,
18487
+ onClearHistory
18488
+ }
18489
+ ),
18490
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RequestHistoryList, { requestHistory })
18491
+ ] })
18492
+ ]
18493
+ }
18494
+ );
18362
18495
  };
18363
18496
  const ToolResult = ({ toolResult }) => {
18364
18497
  if (!toolResult) return null;
@@ -18412,7 +18545,11 @@ const ToolResult = ({ toolResult }) => {
18412
18545
  }
18413
18546
  return null;
18414
18547
  };
18415
- const ResultsTab = ({ toolResult, onToggleCollapse, showHeader = true }) => {
18548
+ const ResultsTab = ({
18549
+ toolResult,
18550
+ onToggleCollapse,
18551
+ showHeader = true
18552
+ }) => {
18416
18553
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex-1 overflow-y-auto ${showHeader ? "p-6" : ""}`, children: [
18417
18554
  showHeader && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18418
18555
  /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-bold text-foreground flex items-center space-x-2", children: [
@@ -18435,21 +18572,139 @@ const ResultsTab = ({ toolResult, onToggleCollapse, showHeader = true }) => {
18435
18572
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-br from-background/80 to-background/60 backdrop-blur-sm p-4 rounded-xl border border-border/30", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ToolResult, { toolResult }) })
18436
18573
  ] });
18437
18574
  };
18575
+ const ClientLogsTab = ({
18576
+ clientLogs,
18577
+ onClearLogs,
18578
+ showHeader = true
18579
+ }) => {
18580
+ const reversedClientLogs = [...clientLogs].reverse();
18581
+ const formatTimestamp = (timestamp) => {
18582
+ const date = new Date(timestamp);
18583
+ return date.toLocaleTimeString("en-US", {
18584
+ hour12: true,
18585
+ hour: "2-digit",
18586
+ minute: "2-digit",
18587
+ second: "2-digit"
18588
+ });
18589
+ };
18590
+ const getLogLevelConfig = (level) => {
18591
+ switch (level) {
18592
+ case "error":
18593
+ return {
18594
+ icon: CircleAlert,
18595
+ bgColor: "bg-red-50 dark:bg-red-950/20",
18596
+ borderColor: "border-red-200 dark:border-red-800/50",
18597
+ textColor: "text-red-800 dark:text-red-300",
18598
+ iconColor: "text-red-500",
18599
+ label: "ERROR"
18600
+ };
18601
+ case "warn":
18602
+ return {
18603
+ icon: TriangleAlert,
18604
+ bgColor: "bg-yellow-50 dark:bg-yellow-950/20",
18605
+ borderColor: "border-yellow-200 dark:border-yellow-800/50",
18606
+ textColor: "text-yellow-800 dark:text-yellow-300",
18607
+ iconColor: "text-yellow-500",
18608
+ label: "WARN"
18609
+ };
18610
+ case "debug":
18611
+ return {
18612
+ icon: Bug,
18613
+ bgColor: "bg-gray-50 dark:bg-gray-950/20",
18614
+ borderColor: "border-gray-200 dark:border-gray-800/50",
18615
+ textColor: "text-gray-800 dark:text-gray-300",
18616
+ iconColor: "text-gray-500",
18617
+ label: "DEBUG"
18618
+ };
18619
+ case "info":
18620
+ default:
18621
+ return {
18622
+ icon: Info,
18623
+ bgColor: "bg-blue-50 dark:bg-blue-950/20",
18624
+ borderColor: "border-blue-200 dark:border-blue-800/50",
18625
+ textColor: "text-blue-800 dark:text-blue-300",
18626
+ iconColor: "text-blue-500",
18627
+ label: "INFO"
18628
+ };
18629
+ }
18630
+ };
18631
+ const LogEntry = ({ log }) => {
18632
+ const config = getLogLevelConfig(log.level);
18633
+ const IconComponent = config.icon;
18634
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18635
+ "div",
18636
+ {
18637
+ className: `flex items-start space-x-3 p-3 rounded-lg border ${config.bgColor} ${config.borderColor} hover:shadow-sm transition-all duration-200`,
18638
+ children: [
18639
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-shrink-0 mt-0.5 ${config.iconColor}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconComponent, { className: "w-4 h-4" }) }),
18640
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
18641
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mb-1", children: [
18642
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
18643
+ "span",
18644
+ {
18645
+ className: `text-xs font-mono font-semibold px-2 py-0.5 rounded ${config.textColor} ${config.bgColor}`,
18646
+ children: config.label
18647
+ }
18648
+ ),
18649
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-muted-foreground font-mono", children: formatTimestamp(log.timestamp) })
18650
+ ] }),
18651
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-sm ${config.textColor} font-mono break-words`, children: log.message })
18652
+ ] })
18653
+ ]
18654
+ }
18655
+ );
18656
+ };
18657
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col", children: [
18658
+ !showHeader && clientLogs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18659
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-muted-foreground bg-muted/50 px-3 py-1 rounded-full", children: [
18660
+ clientLogs.length,
18661
+ " log",
18662
+ clientLogs.length !== 1 ? "s" : ""
18663
+ ] }),
18664
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
18665
+ "button",
18666
+ {
18667
+ onClick: onClearLogs,
18668
+ className: "p-2 rounded-lg hover:bg-destructive/10 hover:text-destructive transition-all duration-200 group",
18669
+ title: "Clear all activity",
18670
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-4 h-4 text-muted-foreground group-hover:text-destructive" })
18671
+ }
18672
+ )
18673
+ ] }),
18674
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-hidden", children: clientLogs.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center h-full text-center p-8", children: [
18675
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Bug, { className: "w-12 h-12 text-muted-foreground/50 mb-4" }),
18676
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium text-muted-foreground mb-2", children: "No logs yet" }),
18677
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground/70 max-w-sm", children: "Client logs will appear here when you perform operations. Logs include info, warnings, errors, and debug messages." })
18678
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full overflow-y-auto p-4 space-y-2", children: reversedClientLogs.map((log, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(LogEntry, { log }, `${log.timestamp}-${index2}`)) }) })
18679
+ ] });
18680
+ };
18438
18681
  const TabbedHistoryPanel = ({
18439
18682
  requestHistory,
18440
18683
  toolResult,
18684
+ clientLogs,
18441
18685
  onClearHistory,
18686
+ onClearLogs,
18442
18687
  onToggleCollapse
18443
18688
  }) => {
18444
18689
  const [activeTab, setActiveTab] = reactExports.useState("activity");
18445
18690
  const [isToolResultError, setIsToolResultError] = reactExports.useState(false);
18446
18691
  reactExports.useEffect(() => {
18447
18692
  if (toolResult) {
18448
- console.log("toolResult", toolResult);
18449
18693
  setIsToolResultError(toolResult.isError === true);
18450
18694
  setActiveTab("results");
18451
18695
  }
18452
18696
  }, [toolResult]);
18697
+ reactExports.useEffect(() => {
18698
+ if (clientLogs.length > 0) {
18699
+ const isLastLogError = clientLogs[clientLogs.length - 1].level === "error";
18700
+ const isLastLogToolCall = clientLogs[clientLogs.length - 1].message.includes(
18701
+ "Error calling tool"
18702
+ );
18703
+ if (isLastLogError && !isLastLogToolCall) {
18704
+ setActiveTab("logs");
18705
+ }
18706
+ }
18707
+ }, [clientLogs]);
18453
18708
  const renderActivityTabButton = () => {
18454
18709
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18455
18710
  "button",
@@ -18466,7 +18721,6 @@ const TabbedHistoryPanel = ({
18466
18721
  );
18467
18722
  };
18468
18723
  const renderResultsTabButton = () => {
18469
- console.log("isToolResultError", isToolResultError);
18470
18724
  const renderCircleIndicator = () => {
18471
18725
  if (toolResult && !isToolResultError) {
18472
18726
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" });
@@ -18490,6 +18744,21 @@ const TabbedHistoryPanel = ({
18490
18744
  "results"
18491
18745
  );
18492
18746
  };
18747
+ const renderLogsTabButton = () => {
18748
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18749
+ "button",
18750
+ {
18751
+ onClick: () => setActiveTab("logs"),
18752
+ className: `flex items-center space-x-2 px-4 py-2 rounded-lg transition-all duration-200 ${activeTab === "logs" ? "bg-primary/10 text-primary border border-primary/20" : "text-muted-foreground hover:text-foreground hover:bg-accent/50"}`,
18753
+ children: [
18754
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Bug, { className: "w-4 h-4" }),
18755
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: "Logs" }),
18756
+ clientLogs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 py-1 text-xs bg-primary/10 text-primary rounded-full", children: clientLogs.length })
18757
+ ]
18758
+ },
18759
+ "logs"
18760
+ );
18761
+ };
18493
18762
  const renderTabContent = () => {
18494
18763
  switch (activeTab) {
18495
18764
  case "activity":
@@ -18503,6 +18772,15 @@ const TabbedHistoryPanel = ({
18503
18772
  ) });
18504
18773
  case "results":
18505
18774
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full overflow-y-auto p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResultsTab, { toolResult, showHeader: false }) });
18775
+ case "logs":
18776
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full overflow-y-auto p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
18777
+ ClientLogsTab,
18778
+ {
18779
+ clientLogs,
18780
+ onClearLogs,
18781
+ showHeader: false
18782
+ }
18783
+ ) });
18506
18784
  default:
18507
18785
  return null;
18508
18786
  }
@@ -18511,7 +18789,8 @@ const TabbedHistoryPanel = ({
18511
18789
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between border-b border-border/20 px-6 py-3", children: [
18512
18790
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-1", children: [
18513
18791
  renderActivityTabButton(),
18514
- renderResultsTabButton()
18792
+ renderResultsTabButton(),
18793
+ renderLogsTabButton()
18515
18794
  ] }),
18516
18795
  /* @__PURE__ */ jsxRuntimeExports.jsx(
18517
18796
  "button",
@@ -18528,7 +18807,9 @@ const TabbedHistoryPanel = ({
18528
18807
  const HistoryAndNotifications = ({
18529
18808
  requestHistory,
18530
18809
  toolResult,
18531
- onClearHistory
18810
+ clientLogs,
18811
+ onClearHistory,
18812
+ onClearLogs
18532
18813
  }) => {
18533
18814
  const [isHistoryCollapsed, setIsHistoryCollapsed] = reactExports.useState(true);
18534
18815
  const {
@@ -18545,6 +18826,15 @@ const HistoryAndNotifications = ({
18545
18826
  setIsHistoryCollapsed(false);
18546
18827
  }
18547
18828
  }, [toolResult, resetHeight]);
18829
+ reactExports.useEffect(() => {
18830
+ if (clientLogs.length > 0) {
18831
+ const isLastError = clientLogs[clientLogs.length - 1].level === "error";
18832
+ if (isLastError) {
18833
+ resetHeight();
18834
+ setIsHistoryCollapsed(false);
18835
+ }
18836
+ }
18837
+ }, [clientLogs, resetHeight]);
18548
18838
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18549
18839
  "div",
18550
18840
  {
@@ -18565,7 +18855,9 @@ const HistoryAndNotifications = ({
18565
18855
  {
18566
18856
  requestHistory,
18567
18857
  toolResult,
18858
+ clientLogs,
18568
18859
  onClearHistory,
18860
+ onClearLogs,
18569
18861
  onToggleCollapse: toggleCollapse
18570
18862
  }
18571
18863
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -18577,6 +18869,7 @@ const HistoryAndNotifications = ({
18577
18869
  /* @__PURE__ */ jsxRuntimeExports.jsx(History, { className: "w-5 h-5" }),
18578
18870
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: "History & Results" }),
18579
18871
  requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 py-1 text-xs bg-primary/10 text-primary rounded-full", children: requestHistory.length }),
18872
+ clientLogs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 py-1 text-xs bg-blue-500/10 text-blue-500 rounded-full", children: clientLogs.length }),
18580
18873
  /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 rotate-180" })
18581
18874
  ] })
18582
18875
  }
@@ -26690,10 +26983,14 @@ const ToolRunCard = ({
26690
26983
  setParams(loadedRequest.parameters);
26691
26984
  setParamsInitialized(true);
26692
26985
  setCurrentRequestId(loadedRequest.id);
26693
- } else if (selectedTool && !paramsInitialized) {
26694
- setParams(initializeParams(selectedTool));
26695
- setParamsInitialized(true);
26696
- setCurrentRequestId(null);
26986
+ } else if (selectedTool) {
26987
+ if (!paramsInitialized) {
26988
+ setParams(initializeParams(selectedTool));
26989
+ setParamsInitialized(true);
26990
+ setCurrentRequestId(null);
26991
+ } else if (!loadedRequest) {
26992
+ setCurrentRequestId(null);
26993
+ }
26697
26994
  }
26698
26995
  }, [selectedTool, loadedRequest, paramsInitialized]);
26699
26996
  const handleParamChange = (key, value) => {
@@ -26971,7 +27268,7 @@ const ToolsTab = ({
26971
27268
  variant: "ghost",
26972
27269
  className: "h-6 w-6 p-0 hover:bg-blue-500/20 hover:text-blue-500 opacity-0 group-hover:opacity-100 transition-opacity",
26973
27270
  title: "Duplicate request",
26974
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "w-3 h-3" })
27271
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyPlus, { className: "w-3 h-3" })
26975
27272
  }
26976
27273
  ),
26977
27274
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -28707,7 +29004,7 @@ var ItemText = SelectItemText;
28707
29004
  var ItemIndicator = SelectItemIndicator;
28708
29005
  var ScrollUpButton = SelectScrollUpButton$1;
28709
29006
  var ScrollDownButton = SelectScrollDownButton$1;
28710
- var Separator = SelectSeparator$1;
29007
+ var Separator$1 = SelectSeparator$1;
28711
29008
  const Select = Root2;
28712
29009
  const SelectValue = Value;
28713
29010
  const SelectTrigger = reactExports.forwardRef(({ className, children, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -28806,14 +29103,14 @@ const SelectItem = reactExports.forwardRef(({ className, children, ...props }, r
28806
29103
  ));
28807
29104
  SelectItem.displayName = Item.displayName;
28808
29105
  const SelectSeparator = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
28809
- Separator,
29106
+ Separator$1,
28810
29107
  {
28811
29108
  ref: ref2,
28812
29109
  className: cn("-mx-1 my-1 h-px bg-muted", className),
28813
29110
  ...props
28814
29111
  }
28815
29112
  ));
28816
- SelectSeparator.displayName = Separator.displayName;
29113
+ SelectSeparator.displayName = Separator$1.displayName;
28817
29114
  const useTheme = () => {
28818
29115
  const [theme, setTheme] = reactExports.useState(() => {
28819
29116
  const savedTheme = localStorage.getItem("theme");
@@ -28853,7 +29150,7 @@ const useTheme = () => {
28853
29150
  [theme, setThemeWithSideEffect]
28854
29151
  );
28855
29152
  };
28856
- const version$1 = "0.2.4";
29153
+ const version$1 = "0.3.1";
28857
29154
  var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
28858
29155
  createPopperScope
28859
29156
  ]);
@@ -29389,22 +29686,10 @@ const Sidebar = ({
29389
29686
  return "text-gray-500 dark:text-gray-400";
29390
29687
  }
29391
29688
  };
29392
- const shouldDisableConnection = (connection) => {
29393
- if (!mcpAgent || connection.connectionStatus === "connected") {
29394
- return false;
29395
- }
29396
- if (connection.config.transportType !== "stdio") {
29397
- const hasConnectedRemote = mcpAgent.hasConnectedRemoteServer();
29398
- const connectedRemoteName = mcpAgent.getConnectedRemoteServerName();
29399
- return hasConnectedRemote && connectedRemoteName !== connection.name;
29400
- }
29689
+ const shouldDisableConnection = () => {
29401
29690
  return false;
29402
29691
  };
29403
- const getConnectTooltipMessage = (connection) => {
29404
- if (shouldDisableConnection(connection)) {
29405
- const connectedRemoteName = mcpAgent == null ? void 0 : mcpAgent.getConnectedRemoteServerName();
29406
- return `Cannot connect: "${connectedRemoteName}" is already connected (only one remote server allowed at a time)`;
29407
- }
29692
+ const getConnectTooltipMessage = () => {
29408
29693
  return "Connect to this server";
29409
29694
  };
29410
29695
  const getConnectionDisplayText = (connection) => {
@@ -29520,11 +29805,11 @@ const Sidebar = ({
29520
29805
  },
29521
29806
  size: "sm",
29522
29807
  className: "h-6 text-xs px-2",
29523
- disabled: shouldDisableConnection(connection),
29808
+ disabled: shouldDisableConnection(),
29524
29809
  children: "Connect"
29525
29810
  }
29526
29811
  ) }) }),
29527
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: getConnectTooltipMessage(connection) })
29812
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: getConnectTooltipMessage() })
29528
29813
  ] });
29529
29814
  };
29530
29815
  const renderConnectionItem = (connection) => /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -29791,7 +30076,7 @@ const SettingsTab = ({
29791
30076
  } catch (error) {
29792
30077
  console.warn("Failed to load API key from localStorage:", error);
29793
30078
  }
29794
- }, [onApiKeyChange]);
30079
+ }, []);
29795
30080
  const validateApiKey = (key) => {
29796
30081
  const claudeApiKeyPattern = /^sk-ant-api03-[A-Za-z0-9_-]+$/;
29797
30082
  return claudeApiKeyPattern.test(key) && key.length > 20;
@@ -29926,7 +30211,9 @@ function validateMCPConfigStructure(config) {
29926
30211
  const mcpServers = config.mcpServers;
29927
30212
  const serverNames = Object.keys(mcpServers);
29928
30213
  if (serverNames.length === 0) {
29929
- errors.push('"mcpServers" object is empty. Please add at least one server configuration');
30214
+ errors.push(
30215
+ '"mcpServers" object is empty. Please add at least one server configuration'
30216
+ );
29930
30217
  }
29931
30218
  return { isGlobal: true, isSingleNamed: false, errors };
29932
30219
  }
@@ -30023,17 +30310,25 @@ function parseConfigFile(jsonString) {
30023
30310
  errors: []
30024
30311
  };
30025
30312
  if (!isValidJSON(jsonString)) {
30026
- result.errors.push("Invalid JSON format. Please check for missing quotes, commas, or brackets");
30313
+ result.errors.push(
30314
+ "Invalid JSON format. Please check for missing quotes, commas, or brackets"
30315
+ );
30027
30316
  return result;
30028
30317
  }
30029
30318
  let parsedConfig;
30030
30319
  try {
30031
30320
  parsedConfig = JSON.parse(jsonString);
30032
30321
  } catch (error) {
30033
- result.errors.push(`JSON parsing error: ${error instanceof Error ? error.message : String(error)}`);
30322
+ result.errors.push(
30323
+ `JSON parsing error: ${error instanceof Error ? error.message : String(error)}`
30324
+ );
30034
30325
  return result;
30035
30326
  }
30036
- const { isGlobal, isSingleNamed, errors: structureErrors } = validateMCPConfigStructure(parsedConfig);
30327
+ const {
30328
+ isGlobal,
30329
+ isSingleNamed,
30330
+ errors: structureErrors
30331
+ } = validateMCPConfigStructure(parsedConfig);
30037
30332
  if (structureErrors.length > 0) {
30038
30333
  result.errors.push(...structureErrors);
30039
30334
  return result;
@@ -30042,7 +30337,9 @@ function parseConfigFile(jsonString) {
30042
30337
  const allErrors = [];
30043
30338
  if (isGlobal) {
30044
30339
  const validConfig = parsedConfig;
30045
- for (const [serverName, serverConfig] of Object.entries(validConfig.mcpServers)) {
30340
+ for (const [serverName, serverConfig] of Object.entries(
30341
+ validConfig.mcpServers
30342
+ )) {
30046
30343
  if (typeof serverName !== "string" || serverName.trim() === "") {
30047
30344
  allErrors.push("Server names must be non-empty strings");
30048
30345
  continue;
@@ -30067,7 +30364,10 @@ function parseConfigFile(jsonString) {
30067
30364
  } else if (isSingleNamed) {
30068
30365
  const serverConfig = parsedConfig;
30069
30366
  const serverName = Object.keys(serverConfig)[0];
30070
- const validationErrors = validateServerConfig(serverName, serverConfig[serverName]);
30367
+ const validationErrors = validateServerConfig(
30368
+ serverName,
30369
+ serverConfig[serverName]
30370
+ );
30071
30371
  if (validationErrors.length > 0) {
30072
30372
  allErrors.push(...validationErrors);
30073
30373
  } else {
@@ -30118,7 +30418,9 @@ const ConfigImportDialog = ({
30118
30418
  onImportServers
30119
30419
  }) => {
30120
30420
  const [configText, setConfigText] = reactExports.useState("");
30121
- const [parseResult, setParseResult] = reactExports.useState(null);
30421
+ const [parseResult, setParseResult] = reactExports.useState(
30422
+ null
30423
+ );
30122
30424
  const [isValidating, setIsValidating] = reactExports.useState(false);
30123
30425
  const { toast: toast2 } = useToast();
30124
30426
  const handleConfigChange = reactExports.useCallback((value) => {
@@ -30142,7 +30444,9 @@ const ConfigImportDialog = ({
30142
30444
  setParseResult({
30143
30445
  success: false,
30144
30446
  servers: [],
30145
- errors: [`Unexpected error: ${error instanceof Error ? error.message : String(error)}`]
30447
+ errors: [
30448
+ `Unexpected error: ${error instanceof Error ? error.message : String(error)}`
30449
+ ]
30146
30450
  });
30147
30451
  } finally {
30148
30452
  setIsValidating(false);
@@ -30324,18 +30628,10 @@ or
30324
30628
  ] }) })
30325
30629
  ] }),
30326
30630
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 pt-4 border-t", children: [
30327
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
30328
- Button,
30329
- {
30330
- variant: "outline",
30331
- onClick: handleClose,
30332
- className: "flex-1",
30333
- children: [
30334
- /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "h-4 w-4 mr-2" }),
30335
- "Cancel"
30336
- ]
30337
- }
30338
- ),
30631
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "outline", onClick: handleClose, className: "flex-1", children: [
30632
+ /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "h-4 w-4 mr-2" }),
30633
+ "Cancel"
30634
+ ] }),
30339
30635
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
30340
30636
  Button,
30341
30637
  {
@@ -30943,6 +31239,95 @@ const ConnectionSection = ({
30943
31239
  )
30944
31240
  ] });
30945
31241
  };
31242
+ const Card = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31243
+ "div",
31244
+ {
31245
+ ref: ref2,
31246
+ className: cn(
31247
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
31248
+ className
31249
+ ),
31250
+ ...props
31251
+ }
31252
+ ));
31253
+ Card.displayName = "Card";
31254
+ const CardHeader = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31255
+ "div",
31256
+ {
31257
+ ref: ref2,
31258
+ className: cn("flex flex-col space-y-1.5 p-6", className),
31259
+ ...props
31260
+ }
31261
+ ));
31262
+ CardHeader.displayName = "CardHeader";
31263
+ const CardTitle = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31264
+ "h3",
31265
+ {
31266
+ ref: ref2,
31267
+ className: cn(
31268
+ "text-2xl font-semibold leading-none tracking-tight",
31269
+ className
31270
+ ),
31271
+ ...props
31272
+ }
31273
+ ));
31274
+ CardTitle.displayName = "CardTitle";
31275
+ const CardDescription = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31276
+ "p",
31277
+ {
31278
+ ref: ref2,
31279
+ className: cn("text-sm text-muted-foreground", className),
31280
+ ...props
31281
+ }
31282
+ ));
31283
+ CardDescription.displayName = "CardDescription";
31284
+ const CardContent = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: ref2, className: cn("p-6 pt-0", className), ...props }));
31285
+ CardContent.displayName = "CardContent";
31286
+ const CardFooter = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31287
+ "div",
31288
+ {
31289
+ ref: ref2,
31290
+ className: cn("flex items-center p-6 pt-0", className),
31291
+ ...props
31292
+ }
31293
+ ));
31294
+ CardFooter.displayName = "CardFooter";
31295
+ const Separator = reactExports.forwardRef(
31296
+ ({ className, orientation = "horizontal", decorative = true, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31297
+ "div",
31298
+ {
31299
+ ref: ref2,
31300
+ role: decorative ? "none" : "separator",
31301
+ "aria-orientation": orientation,
31302
+ className: cn(
31303
+ "shrink-0 bg-border",
31304
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
31305
+ className
31306
+ ),
31307
+ ...props
31308
+ }
31309
+ )
31310
+ );
31311
+ Separator.displayName = "Separator";
31312
+ const badgeVariants = cva(
31313
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
31314
+ {
31315
+ variants: {
31316
+ variant: {
31317
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
31318
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
31319
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
31320
+ outline: "text-foreground"
31321
+ }
31322
+ },
31323
+ defaultVariants: {
31324
+ variant: "default"
31325
+ }
31326
+ }
31327
+ );
31328
+ function Badge({ className, variant, ...props }) {
31329
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
31330
+ }
30946
31331
  const ClientFormSection = ({
30947
31332
  isCreating,
30948
31333
  editingClientName,
@@ -30962,16 +31347,30 @@ const ClientFormSection = ({
30962
31347
  onSaveMultiple
30963
31348
  }) => {
30964
31349
  const [argsString, setArgsString] = reactExports.useState("");
31350
+ const [sseUrlString, setSseUrlString] = reactExports.useState("");
30965
31351
  const [multipleClients, setMultipleClients] = reactExports.useState([]);
30966
31352
  const [isMultipleMode, setIsMultipleMode] = reactExports.useState(false);
31353
+ const [isManualConfigExpanded, setIsManualConfigExpanded] = reactExports.useState(false);
30967
31354
  const { toast: toast2 } = useToast();
30968
31355
  const [showImportDialog, setShowImportDialog] = reactExports.useState(false);
31356
+ const [nameError, setNameError] = reactExports.useState("");
30969
31357
  reactExports.useEffect(() => {
30970
- var _a2;
31358
+ var _a2, _b;
30971
31359
  if (clientFormConfig.transportType === "stdio" && "args" in clientFormConfig) {
30972
31360
  setArgsString(((_a2 = clientFormConfig.args) == null ? void 0 : _a2.join(" ")) || "");
31361
+ setSseUrlString("");
31362
+ } else if (clientFormConfig.transportType !== "stdio" && "url" in clientFormConfig) {
31363
+ setArgsString("");
31364
+ setSseUrlString(((_b = clientFormConfig.url) == null ? void 0 : _b.toString()) || "");
30973
31365
  }
30974
31366
  }, [clientFormConfig]);
31367
+ reactExports.useEffect(() => {
31368
+ if (clientFormName.trim()) {
31369
+ setNameError("");
31370
+ } else {
31371
+ setNameError("Client name is required");
31372
+ }
31373
+ }, [clientFormName]);
30975
31374
  const handleArgsChange = (newArgsString) => {
30976
31375
  setArgsString(newArgsString);
30977
31376
  if (clientFormConfig.transportType === "stdio") {
@@ -30981,16 +31380,20 @@ const ClientFormSection = ({
30981
31380
  });
30982
31381
  }
30983
31382
  };
31383
+ const handleSseUrlChange = (newSseUrlString) => {
31384
+ setSseUrlString(newSseUrlString);
31385
+ };
30984
31386
  const handleImportServers = (servers) => {
30985
- var _a2;
31387
+ var _a2, _b;
30986
31388
  if (servers.length > 1) {
30987
31389
  const clients = servers.map((server, index2) => {
30988
- var _a3;
31390
+ var _a3, _b2;
30989
31391
  return {
30990
31392
  id: `client-${Date.now()}-${index2}`,
30991
31393
  name: server.name,
30992
31394
  config: server.config,
30993
- argsString: server.config.transportType === "stdio" && "args" in server.config ? ((_a3 = server.config.args) == null ? void 0 : _a3.join(" ")) || "" : ""
31395
+ argsString: server.config.transportType === "stdio" && "args" in server.config ? ((_a3 = server.config.args) == null ? void 0 : _a3.join(" ")) || "" : "",
31396
+ sseUrlString: server.config.transportType !== "stdio" && "url" in server.config ? ((_b2 = server.config.url) == null ? void 0 : _b2.toString()) || "" : ""
30994
31397
  };
30995
31398
  });
30996
31399
  setMultipleClients(clients);
@@ -31007,6 +31410,10 @@ const ClientFormSection = ({
31007
31410
  }
31008
31411
  if (firstServer.config.transportType === "stdio" && "args" in firstServer.config) {
31009
31412
  setArgsString(((_a2 = firstServer.config.args) == null ? void 0 : _a2.join(" ")) || "");
31413
+ setSseUrlString("");
31414
+ } else if (firstServer.config.transportType !== "stdio" && "url" in firstServer.config) {
31415
+ setArgsString("");
31416
+ setSseUrlString(((_b = firstServer.config.url) == null ? void 0 : _b.toString()) || "");
31010
31417
  }
31011
31418
  toast2({
31012
31419
  title: "Configuration imported",
@@ -31025,7 +31432,9 @@ const ClientFormSection = ({
31025
31432
  );
31026
31433
  };
31027
31434
  const handleRemoveClient = (clientId) => {
31028
- setMultipleClients((prev) => prev.filter((client2) => client2.id !== clientId));
31435
+ setMultipleClients(
31436
+ (prev) => prev.filter((client2) => client2.id !== clientId)
31437
+ );
31029
31438
  };
31030
31439
  const handleAddClient = () => {
31031
31440
  const newClient = {
@@ -31037,12 +31446,34 @@ const ClientFormSection = ({
31037
31446
  args: ["@modelcontextprotocol/server-everything"],
31038
31447
  env: {}
31039
31448
  },
31040
- argsString: "@modelcontextprotocol/server-everything"
31449
+ argsString: "@modelcontextprotocol/server-everything",
31450
+ sseUrlString: ""
31041
31451
  };
31042
31452
  setMultipleClients((prev) => [...prev, newClient]);
31043
31453
  };
31454
+ const handleSingleSave = () => {
31455
+ let configToSave = { ...clientFormConfig };
31456
+ if (configToSave.transportType !== "stdio") {
31457
+ try {
31458
+ const url = new URL(sseUrlString);
31459
+ configToSave = {
31460
+ ...configToSave,
31461
+ url
31462
+ };
31463
+ } catch {
31464
+ toast2({
31465
+ title: "Invalid URL",
31466
+ description: "Please enter a valid URL for the client.",
31467
+ variant: "destructive"
31468
+ });
31469
+ return;
31470
+ }
31471
+ }
31472
+ onSave(configToSave);
31473
+ };
31044
31474
  const handleSaveAll = async () => {
31045
- const validClients = multipleClients.filter((client2) => client2.name.trim());
31475
+ if (!onSaveMultiple) return;
31476
+ const validClients = multipleClients.filter((c) => c.name.trim());
31046
31477
  if (validClients.length === 0) {
31047
31478
  toast2({
31048
31479
  title: "No valid clients",
@@ -31051,43 +31482,45 @@ const ClientFormSection = ({
31051
31482
  });
31052
31483
  return;
31053
31484
  }
31054
- const names = validClients.map((c) => c.name.trim());
31055
- const duplicates = names.filter((name, index2) => names.indexOf(name) !== index2);
31056
- if (duplicates.length > 0) {
31057
- toast2({
31058
- title: "Duplicate client names",
31059
- description: `Please ensure all client names are unique. Duplicates: ${[...new Set(duplicates)].join(", ")}`,
31060
- variant: "destructive"
31061
- });
31062
- return;
31063
- }
31064
- if (onSaveMultiple) {
31065
- try {
31066
- const results = await onSaveMultiple(validClients.map((client2) => ({
31067
- name: client2.name.trim(),
31068
- config: client2.config
31069
- })));
31070
- if (results.success.length > 0) {
31071
- toast2({
31072
- title: "Clients created",
31073
- description: `Successfully created ${results.success.length} client(s): ${results.success.join(", ")}`
31074
- });
31075
- }
31076
- if (results.failed.length > 0) {
31077
- toast2({
31078
- title: "Some clients failed",
31079
- description: `${results.failed.length} client(s) failed to create. Check console for details.`,
31080
- variant: "destructive"
31081
- });
31485
+ const clientsToSave = validClients.map((client2) => {
31486
+ let configToSave = { ...client2.config };
31487
+ if (configToSave.transportType !== "stdio") {
31488
+ try {
31489
+ const url = new URL(client2.sseUrlString);
31490
+ configToSave = {
31491
+ ...configToSave,
31492
+ url
31493
+ };
31494
+ } catch {
31495
+ throw new Error(`Invalid URL for client "${client2.name}"`);
31082
31496
  }
31083
- } catch (error) {
31084
- console.error("Failed to create clients:", error);
31497
+ }
31498
+ return {
31499
+ name: client2.name,
31500
+ config: configToSave
31501
+ };
31502
+ });
31503
+ try {
31504
+ const result = await onSaveMultiple(clientsToSave);
31505
+ if (result.success.length > 0) {
31085
31506
  toast2({
31086
- title: "Creation failed",
31087
- description: `Failed to create clients: ${error instanceof Error ? error.message : String(error)}`,
31507
+ title: "Clients created successfully",
31508
+ description: `Successfully created ${result.success.length} client(s).`
31509
+ });
31510
+ }
31511
+ if (result.failed.length > 0) {
31512
+ toast2({
31513
+ title: "Some clients failed to create",
31514
+ description: `${result.failed.length} client(s) failed to create. Check the console for details.`,
31088
31515
  variant: "destructive"
31089
31516
  });
31090
31517
  }
31518
+ } catch (error) {
31519
+ toast2({
31520
+ title: "Error creating clients",
31521
+ description: error instanceof Error ? error.message : "An unexpected error occurred.",
31522
+ variant: "destructive"
31523
+ });
31091
31524
  }
31092
31525
  };
31093
31526
  const handleBackToSingle = () => {
@@ -31095,110 +31528,335 @@ const ClientFormSection = ({
31095
31528
  setMultipleClients([]);
31096
31529
  };
31097
31530
  if (isMultipleMode) {
31098
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex flex-col overflow-auto p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto w-full", children: [
31099
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
31100
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold mb-2", children: "Create Multiple Clients" }),
31101
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground", children: "Configure each imported server as a separate client. You can modify settings individually." })
31531
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex flex-col overflow-auto bg-gradient-to-br from-background to-muted/20", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto w-full p-6 space-y-6", children: [
31532
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31533
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31534
+ Button,
31535
+ {
31536
+ variant: "ghost",
31537
+ size: "sm",
31538
+ onClick: handleBackToSingle,
31539
+ className: "h-8 w-8 p-0",
31540
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, { className: "h-4 w-4" })
31541
+ }
31542
+ ),
31543
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
31544
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "Create Multiple Clients" }),
31545
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground mt-1", children: "Configure each imported server as a separate client" })
31546
+ ] }),
31547
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, { variant: "secondary", className: "ml-auto", children: [
31548
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Users, { className: "h-3 w-3 mr-1" }),
31549
+ multipleClients.length,
31550
+ " clients"
31551
+ ] })
31102
31552
  ] }),
31103
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
31104
- multipleClients.map((client2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-border rounded-lg p-4 space-y-4", children: [
31105
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
31106
- /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-semibold", children: [
31107
- "Client ",
31108
- index2 + 1
31553
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {}),
31554
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-6", children: [
31555
+ multipleClients.map((client2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
31556
+ Card,
31557
+ {
31558
+ className: "border-2 border-border/50 hover:border-border transition-colors",
31559
+ children: [
31560
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "pb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
31561
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31562
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center w-8 h-8 rounded-full bg-primary/10 text-primary font-semibold text-sm", children: index2 + 1 }),
31563
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
31564
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardTitle, { className: "text-lg", children: [
31565
+ "Client ",
31566
+ index2 + 1
31567
+ ] }),
31568
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardDescription, { children: client2.name || "Unnamed client" })
31569
+ ] })
31570
+ ] }),
31571
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31572
+ Button,
31573
+ {
31574
+ variant: "ghost",
31575
+ size: "sm",
31576
+ onClick: () => handleRemoveClient(client2.id),
31577
+ className: "h-8 w-8 p-0 text-muted-foreground hover:text-destructive",
31578
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "h-4 w-4" })
31579
+ }
31580
+ )
31581
+ ] }) }),
31582
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "space-y-6", children: [
31583
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
31584
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31585
+ Label$1,
31586
+ {
31587
+ htmlFor: `client-name-${client2.id}`,
31588
+ className: "text-sm font-medium",
31589
+ children: "Client Name"
31590
+ }
31591
+ ),
31592
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31593
+ Input,
31594
+ {
31595
+ id: `client-name-${client2.id}`,
31596
+ value: client2.name,
31597
+ onChange: (e) => handleUpdateClient(client2.id, { name: e.target.value }),
31598
+ placeholder: "Enter a descriptive name for this client",
31599
+ className: "max-w-md"
31600
+ }
31601
+ )
31602
+ ] }),
31603
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
31604
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
31605
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "h-4 w-4 text-muted-foreground" }),
31606
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Connection Settings" })
31607
+ ] }),
31608
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-border/50 rounded-lg p-4 bg-muted/30", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31609
+ ConnectionSection,
31610
+ {
31611
+ connectionStatus: "disconnected",
31612
+ transportType: client2.config.transportType,
31613
+ setTransportType: (type2) => {
31614
+ let newConfig;
31615
+ let newArgsString = "";
31616
+ if (type2 === "stdio") {
31617
+ newConfig = {
31618
+ transportType: type2,
31619
+ command: "npx",
31620
+ args: ["@modelcontextprotocol/server-everything"],
31621
+ env: {}
31622
+ };
31623
+ newArgsString = "@modelcontextprotocol/server-everything";
31624
+ } else {
31625
+ newConfig = {
31626
+ transportType: type2,
31627
+ url: new URL("https://example.com")
31628
+ };
31629
+ }
31630
+ handleUpdateClient(client2.id, {
31631
+ config: newConfig,
31632
+ argsString: newArgsString,
31633
+ sseUrlString: newConfig.transportType !== "stdio" && "url" in newConfig && newConfig.url ? newConfig.url.toString() : ""
31634
+ });
31635
+ },
31636
+ command: client2.config.transportType === "stdio" && "command" in client2.config ? client2.config.command || "" : "",
31637
+ setCommand: (command) => {
31638
+ if (client2.config.transportType === "stdio") {
31639
+ handleUpdateClient(client2.id, {
31640
+ config: {
31641
+ ...client2.config,
31642
+ command
31643
+ }
31644
+ });
31645
+ }
31646
+ },
31647
+ args: client2.argsString,
31648
+ setArgs: (newArgsString) => {
31649
+ if (client2.config.transportType === "stdio") {
31650
+ handleUpdateClient(client2.id, {
31651
+ argsString: newArgsString,
31652
+ config: {
31653
+ ...client2.config,
31654
+ args: newArgsString.trim() ? newArgsString.split(/\s+/) : []
31655
+ }
31656
+ });
31657
+ }
31658
+ },
31659
+ sseUrl: client2.sseUrlString,
31660
+ setSseUrl: (url) => {
31661
+ handleUpdateClient(client2.id, { sseUrlString: url });
31662
+ },
31663
+ env: client2.config.transportType === "stdio" && "env" in client2.config ? client2.config.env || {} : {},
31664
+ setEnv: (env) => {
31665
+ if (client2.config.transportType === "stdio") {
31666
+ handleUpdateClient(client2.id, {
31667
+ config: {
31668
+ ...client2.config,
31669
+ env
31670
+ }
31671
+ });
31672
+ }
31673
+ },
31674
+ config,
31675
+ setConfig,
31676
+ bearerToken,
31677
+ setBearerToken,
31678
+ headerName,
31679
+ setHeaderName,
31680
+ onConnect: () => {
31681
+ },
31682
+ onDisconnect: () => {
31683
+ },
31684
+ stdErrNotifications: [],
31685
+ clearStdErrNotifications: () => {
31686
+ },
31687
+ logLevel: "debug",
31688
+ sendLogLevelRequest: async () => {
31689
+ },
31690
+ loggingSupported: false,
31691
+ hideActionButtons: true
31692
+ }
31693
+ ) })
31694
+ ] })
31695
+ ] })
31696
+ ]
31697
+ },
31698
+ client2.id
31699
+ )),
31700
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "border-2 border-dashed border-border/50 hover:border-border transition-colors", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
31701
+ Button,
31702
+ {
31703
+ variant: "ghost",
31704
+ onClick: handleAddClient,
31705
+ className: "w-full h-16 text-muted-foreground hover:text-foreground",
31706
+ children: [
31707
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "h-5 w-5 mr-2" }),
31708
+ "Add Another Client"
31709
+ ]
31710
+ }
31711
+ ) }) })
31712
+ ] }),
31713
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sticky bottom-0 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border-t pt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
31714
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: multipleClients.some((c) => !c.name.trim()) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-amber-600", children: [
31715
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
31716
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Some clients need names" })
31717
+ ] }) }),
31718
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31719
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", onClick: onCancel, children: "Cancel" }),
31720
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
31721
+ Button,
31722
+ {
31723
+ onClick: handleSaveAll,
31724
+ disabled: multipleClients.filter((c) => c.name.trim()).length === 0,
31725
+ className: "min-w-[200px]",
31726
+ children: [
31727
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Save, { className: "h-4 w-4 mr-2" }),
31728
+ "Create ",
31729
+ multipleClients.filter((c) => c.name.trim()).length,
31730
+ " ",
31731
+ "Client(s)"
31732
+ ]
31733
+ }
31734
+ )
31735
+ ] })
31736
+ ] }) })
31737
+ ] }) });
31738
+ }
31739
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex flex-col overflow-auto bg-gradient-to-br from-background to-muted/20", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-5xl mx-auto w-full p-6 space-y-8", children: [
31740
+ isCreating && /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "border-2 border-primary/20 bg-gradient-to-r from-primary/5 to-primary/10", children: [
31741
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31742
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-2 bg-primary/10 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Upload, { className: "h-5 w-5 text-primary" }) }),
31743
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { className: "text-lg", children: "Quick Import" }) }),
31744
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, { variant: "secondary", className: "ml-auto", children: [
31745
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Sparkles, { className: "h-3 w-3 mr-1" }),
31746
+ "Recommended"
31747
+ ] })
31748
+ ] }) }),
31749
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { children: [
31750
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "Supports the same format used by Claude Desktop and Cursor." }),
31751
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
31752
+ Button,
31753
+ {
31754
+ onClick: () => setShowImportDialog(true),
31755
+ className: "w-full sm:w-auto",
31756
+ children: [
31757
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Upload, { className: "w-4 h-4 mr-2" }),
31758
+ "Import from Configuration File"
31759
+ ]
31760
+ }
31761
+ )
31762
+ ] })
31763
+ ] }),
31764
+ isCreating && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4", children: [
31765
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { className: "w-16" }),
31766
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium text-muted-foreground", children: "or" }),
31767
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { className: "w-16" })
31768
+ ] }) }),
31769
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "border-2 border-border/50", children: [
31770
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31771
+ CardHeader,
31772
+ {
31773
+ className: "cursor-pointer",
31774
+ onClick: () => setIsManualConfigExpanded(!isManualConfigExpanded),
31775
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
31776
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31777
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-2 bg-muted rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "h-5 w-5 text-muted-foreground" }) }),
31778
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { className: "text-lg", children: isCreating ? "Manual Setup" : `Edit: ${editingClientName}` }) })
31109
31779
  ] }),
31110
31780
  /* @__PURE__ */ jsxRuntimeExports.jsx(
31111
31781
  Button,
31112
31782
  {
31113
- variant: "outline",
31783
+ variant: "ghost",
31114
31784
  size: "sm",
31115
- onClick: () => handleRemoveClient(client2.id),
31116
31785
  className: "h-8 w-8 p-0",
31117
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "h-4 w-4" })
31118
- }
31119
- )
31120
- ] }),
31121
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
31122
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium mb-2 block", children: "Client Name" }),
31123
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31124
- Input,
31125
- {
31126
- value: client2.name,
31127
- onChange: (e) => handleUpdateClient(client2.id, { name: e.target.value }),
31128
- placeholder: "Enter client name",
31129
- className: "w-full"
31786
+ onClick: (e) => {
31787
+ e.stopPropagation();
31788
+ setIsManualConfigExpanded(!isManualConfigExpanded);
31789
+ },
31790
+ children: isManualConfigExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "h-4 w-4" })
31130
31791
  }
31131
31792
  )
31132
- ] }),
31133
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-border rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31793
+ ] })
31794
+ }
31795
+ ),
31796
+ isManualConfigExpanded && /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "space-y-6", children: [
31797
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
31798
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { htmlFor: "client-name", className: "text-sm font-medium", children: "Name" }),
31799
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31800
+ Input,
31801
+ {
31802
+ id: "client-name",
31803
+ value: clientFormName,
31804
+ onChange: (e) => setClientFormName(e.target.value),
31805
+ placeholder: "Enter client name",
31806
+ className: `max-w-md ${nameError ? "border-red-500 focus:border-red-500 focus:ring-red-500" : ""}`
31807
+ }
31808
+ ),
31809
+ nameError && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-red-500 flex items-center gap-1", children: [
31810
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-3 w-3" }),
31811
+ nameError
31812
+ ] })
31813
+ ] }),
31814
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
31815
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Connection" }),
31816
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-border/50 rounded-lg p-4 bg-muted/30", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31134
31817
  ConnectionSection,
31135
31818
  {
31136
31819
  connectionStatus: "disconnected",
31137
- transportType: client2.config.transportType,
31820
+ transportType: clientFormConfig.transportType,
31138
31821
  setTransportType: (type2) => {
31139
- let newConfig;
31140
- let newArgsString = "";
31141
31822
  if (type2 === "stdio") {
31142
- newConfig = {
31823
+ const newConfig = {
31143
31824
  transportType: type2,
31144
31825
  command: "npx",
31145
31826
  args: ["@modelcontextprotocol/server-everything"],
31146
31827
  env: {}
31147
31828
  };
31148
- newArgsString = "@modelcontextprotocol/server-everything";
31829
+ setClientFormConfig(newConfig);
31830
+ setArgsString(
31831
+ "@modelcontextprotocol/server-everything"
31832
+ );
31149
31833
  } else {
31150
- newConfig = {
31834
+ setClientFormConfig({
31151
31835
  transportType: type2,
31152
31836
  url: new URL("https://example.com")
31153
- };
31154
- }
31155
- handleUpdateClient(client2.id, {
31156
- config: newConfig,
31157
- argsString: newArgsString
31158
- });
31159
- },
31160
- command: client2.config.transportType === "stdio" && "command" in client2.config ? client2.config.command || "" : "",
31161
- setCommand: (command) => {
31162
- if (client2.config.transportType === "stdio") {
31163
- handleUpdateClient(client2.id, {
31164
- config: {
31165
- ...client2.config,
31166
- command
31167
- }
31168
- });
31169
- }
31170
- },
31171
- args: client2.argsString,
31172
- setArgs: (newArgsString) => {
31173
- if (client2.config.transportType === "stdio") {
31174
- handleUpdateClient(client2.id, {
31175
- argsString: newArgsString,
31176
- config: {
31177
- ...client2.config,
31178
- args: newArgsString.trim() ? newArgsString.split(/\s+/) : []
31179
- }
31180
31837
  });
31838
+ setArgsString("");
31181
31839
  }
31182
31840
  },
31183
- sseUrl: "url" in client2.config && client2.config.url ? client2.config.url.toString() : "",
31184
- setSseUrl: (url) => {
31185
- if (client2.config.transportType !== "stdio") {
31186
- handleUpdateClient(client2.id, {
31187
- config: {
31188
- ...client2.config,
31189
- url: new URL(url)
31190
- }
31841
+ command: clientFormConfig.transportType === "stdio" && "command" in clientFormConfig ? clientFormConfig.command || "" : "",
31842
+ setCommand: (command) => {
31843
+ if (clientFormConfig.transportType === "stdio") {
31844
+ setClientFormConfig({
31845
+ ...clientFormConfig,
31846
+ command
31191
31847
  });
31192
31848
  }
31193
31849
  },
31194
- env: client2.config.transportType === "stdio" && "env" in client2.config ? client2.config.env || {} : {},
31850
+ args: argsString,
31851
+ setArgs: handleArgsChange,
31852
+ sseUrl: sseUrlString,
31853
+ setSseUrl: handleSseUrlChange,
31854
+ env: clientFormConfig.transportType === "stdio" && "env" in clientFormConfig ? clientFormConfig.env || {} : {},
31195
31855
  setEnv: (env) => {
31196
- if (client2.config.transportType === "stdio") {
31197
- handleUpdateClient(client2.id, {
31198
- config: {
31199
- ...client2.config,
31200
- env
31201
- }
31856
+ if (clientFormConfig.transportType === "stdio") {
31857
+ setClientFormConfig({
31858
+ ...clientFormConfig,
31859
+ env
31202
31860
  });
31203
31861
  }
31204
31862
  },
@@ -31222,191 +31880,30 @@ const ClientFormSection = ({
31222
31880
  hideActionButtons: true
31223
31881
  }
31224
31882
  ) })
31225
- ] }, client2.id)),
31226
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
31227
- Button,
31228
- {
31229
- variant: "outline",
31230
- onClick: handleAddClient,
31231
- className: "w-full",
31232
- children: [
31233
- /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "h-4 w-4 mr-2" }),
31234
- "Add Another Client"
31235
- ]
31236
- }
31237
- ),
31238
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-3 pt-4 border-t", children: [
31239
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
31240
- Button,
31241
- {
31242
- onClick: handleSaveAll,
31243
- disabled: multipleClients.filter((c) => c.name.trim()).length === 0,
31244
- className: "flex-1",
31245
- children: [
31246
- /* @__PURE__ */ jsxRuntimeExports.jsx(Save, { className: "h-4 w-4 mr-2" }),
31247
- "Create ",
31248
- multipleClients.filter((c) => c.name.trim()).length,
31249
- " Client(s)"
31250
- ]
31251
- }
31252
- ),
31253
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31254
- Button,
31255
- {
31256
- variant: "outline",
31257
- onClick: handleBackToSingle,
31258
- className: "flex-1",
31259
- children: "Back to Single Mode"
31260
- }
31261
- ),
31262
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31263
- Button,
31264
- {
31265
- variant: "outline",
31266
- onClick: onCancel,
31267
- children: "Cancel"
31268
- }
31269
- )
31270
- ] }),
31271
- multipleClients.some((c) => !c.name.trim()) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-amber-600 text-sm", children: [
31272
- /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
31273
- "Some clients don't have names and won't be created."
31274
31883
  ] })
31275
31884
  ] })
31276
- ] }) });
31277
- }
31278
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex flex-col overflow-auto p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto w-full", children: [
31279
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
31280
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold mb-2", children: isCreating ? "Create New Client" : `Edit Client: ${editingClientName}` }),
31281
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground", children: "Configure your MCP client connection settings below." })
31282
31885
  ] }),
31283
- isCreating && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6 p-4 rounded-lg bg-card border border-border/50 shadow-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [
31284
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-2 bg-muted rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Upload, { className: "h-5 w-5 text-muted-foreground" }) }),
31285
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
31286
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold mb-1", children: "Import Configuration" }),
31287
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground mb-3", children: "Import multiple servers from a configuration file. Supports the same format used by Claude Desktop and Cursor." }),
31288
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
31289
- Button,
31290
- {
31291
- onClick: () => setShowImportDialog(true),
31292
- size: "sm",
31293
- children: [
31294
- /* @__PURE__ */ jsxRuntimeExports.jsx(Upload, { className: "w-4 h-4 mr-2" }),
31295
- "Import from Configuration File"
31296
- ]
31297
- }
31298
- )
31299
- ] })
31300
- ] }) }),
31301
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
31302
- isCreating && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t pt-4", children: [
31303
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium mb-1", children: "Manual Configuration" }),
31304
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "Or configure a single client manually with the options below." })
31305
- ] }),
31306
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
31307
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium mb-2 block", children: "Client Name" }),
31308
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31309
- "input",
31310
- {
31311
- type: "text",
31312
- value: clientFormName,
31313
- onChange: (e) => setClientFormName(e.target.value),
31314
- placeholder: "Enter client name",
31315
- className: "w-full px-3 py-2 border border-border rounded-md bg-background"
31316
- }
31317
- )
31318
- ] }),
31319
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-border rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31320
- ConnectionSection,
31886
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-3 pt-4", children: [
31887
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
31888
+ Button,
31321
31889
  {
31322
- connectionStatus: "disconnected",
31323
- transportType: clientFormConfig.transportType,
31324
- setTransportType: (type2) => {
31325
- if (type2 === "stdio") {
31326
- const newConfig = {
31327
- transportType: type2,
31328
- command: "npx",
31329
- args: ["@modelcontextprotocol/server-everything"],
31330
- env: {}
31331
- };
31332
- setClientFormConfig(newConfig);
31333
- setArgsString("@modelcontextprotocol/server-everything");
31334
- } else {
31335
- setClientFormConfig({
31336
- transportType: type2,
31337
- url: new URL("https://example.com")
31338
- });
31339
- setArgsString("");
31340
- }
31341
- },
31342
- command: clientFormConfig.transportType === "stdio" && "command" in clientFormConfig ? clientFormConfig.command || "" : "",
31343
- setCommand: (command) => {
31344
- if (clientFormConfig.transportType === "stdio") {
31345
- setClientFormConfig({
31346
- ...clientFormConfig,
31347
- command
31348
- });
31349
- }
31350
- },
31351
- args: argsString,
31352
- setArgs: handleArgsChange,
31353
- sseUrl: "url" in clientFormConfig && clientFormConfig.url ? clientFormConfig.url.toString() : "",
31354
- setSseUrl: (url) => {
31355
- if (clientFormConfig.transportType !== "stdio") {
31356
- setClientFormConfig({
31357
- ...clientFormConfig,
31358
- url: new URL(url)
31359
- });
31360
- }
31361
- },
31362
- env: clientFormConfig.transportType === "stdio" && "env" in clientFormConfig ? clientFormConfig.env || {} : {},
31363
- setEnv: (env) => {
31364
- if (clientFormConfig.transportType === "stdio") {
31365
- setClientFormConfig({
31366
- ...clientFormConfig,
31367
- env
31368
- });
31369
- }
31370
- },
31371
- config,
31372
- setConfig,
31373
- bearerToken,
31374
- setBearerToken,
31375
- headerName,
31376
- setHeaderName,
31377
- onConnect: () => {
31378
- },
31379
- onDisconnect: () => {
31380
- },
31381
- stdErrNotifications: [],
31382
- clearStdErrNotifications: () => {
31383
- },
31384
- logLevel: "debug",
31385
- sendLogLevelRequest: async () => {
31386
- },
31387
- loggingSupported: false,
31388
- hideActionButtons: true
31890
+ onClick: handleSingleSave,
31891
+ disabled: !clientFormName.trim(),
31892
+ className: "min-w-[180px] h-12 text-base font-semibold bg-primary hover:bg-primary/90 shadow-lg hover:shadow-xl transition-all duration-200 border-2 border-primary/20",
31893
+ children: [
31894
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CircleCheck, { className: "h-5 w-5 mr-2" }),
31895
+ isCreating ? "Create Client" : "Update Client"
31896
+ ]
31389
31897
  }
31390
- ) }),
31391
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-3 pt-4", children: [
31392
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31393
- "button",
31394
- {
31395
- onClick: onSave,
31396
- disabled: !clientFormName.trim(),
31397
- className: "px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed",
31398
- children: isCreating ? "Create Client" : "Update Client"
31399
- }
31400
- ),
31401
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31402
- "button",
31403
- {
31404
- onClick: onCancel,
31405
- className: "px-4 py-2 border border-border rounded-md hover:bg-muted",
31406
- children: "Cancel"
31407
- }
31408
- )
31409
- ] })
31898
+ ),
31899
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31900
+ "button",
31901
+ {
31902
+ onClick: onCancel,
31903
+ className: "text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline",
31904
+ children: "Cancel"
31905
+ }
31906
+ )
31410
31907
  ] }),
31411
31908
  /* @__PURE__ */ jsxRuntimeExports.jsx(
31412
31909
  ConfigImportDialog,
@@ -31476,33 +31973,39 @@ const StarGitHubModal = ({
31476
31973
  const SERVER_CONFIGS_STORAGE_KEY = "mcpServerConfigs_v1";
31477
31974
  const SELECTED_SERVER_STORAGE_KEY = "selectedServerName_v1";
31478
31975
  const serializeServerConfigs = (configs) => {
31479
- const serializable = Object.entries(configs).reduce((acc, [name, config]) => {
31480
- if ("url" in config && config.url) {
31481
- acc[name] = {
31482
- ...config,
31483
- url: config.url.toString()
31484
- };
31485
- } else {
31486
- acc[name] = config;
31487
- }
31488
- return acc;
31489
- }, {});
31490
- return JSON.stringify(serializable);
31491
- };
31492
- const deserializeServerConfigs = (serialized) => {
31493
- try {
31494
- const parsed = JSON.parse(serialized);
31495
- return Object.entries(parsed).reduce((acc, [name, config]) => {
31496
- if ("url" in config && config.url && typeof config.url === "string") {
31976
+ const serializable = Object.entries(configs).reduce(
31977
+ (acc, [name, config]) => {
31978
+ if ("url" in config && config.url) {
31497
31979
  acc[name] = {
31498
31980
  ...config,
31499
- url: new URL(config.url)
31981
+ url: config.url.toString()
31500
31982
  };
31501
31983
  } else {
31502
31984
  acc[name] = config;
31503
31985
  }
31504
31986
  return acc;
31505
- }, {});
31987
+ },
31988
+ {}
31989
+ );
31990
+ return JSON.stringify(serializable);
31991
+ };
31992
+ const deserializeServerConfigs = (serialized) => {
31993
+ try {
31994
+ const parsed = JSON.parse(serialized);
31995
+ return Object.entries(parsed).reduce(
31996
+ (acc, [name, config]) => {
31997
+ if ("url" in config && config.url && typeof config.url === "string") {
31998
+ acc[name] = {
31999
+ ...config,
32000
+ url: new URL(config.url)
32001
+ };
32002
+ } else {
32003
+ acc[name] = config;
32004
+ }
32005
+ return acc;
32006
+ },
32007
+ {}
32008
+ );
31506
32009
  } catch (error) {
31507
32010
  console.warn("Failed to deserialize server configs:", error);
31508
32011
  return {};
@@ -41933,7 +42436,7 @@ Anthropic.Models = Models2;
41933
42436
  Anthropic.Beta = Beta;
41934
42437
  const { HUMAN_PROMPT, AI_PROMPT } = Anthropic;
41935
42438
  const readline = {};
41936
- const version = "0.2.4";
42439
+ const version = "0.3.1";
41937
42440
  const packageJson = {
41938
42441
  version
41939
42442
  };
@@ -42932,7 +43435,7 @@ const mappedTools = (tools) => {
42932
43435
  });
42933
43436
  };
42934
43437
  class MCPJamClient extends Client {
42935
- constructor(serverConfig, config, addRequestHistory, bearerToken, headerName, onStdErrNotification, claudeApiKey, onPendingRequest, getRoots) {
43438
+ constructor(serverConfig, config, addRequestHistory, addClientLog, bearerToken, headerName, onStdErrNotification, claudeApiKey, onPendingRequest, getRoots) {
42936
43439
  super(
42937
43440
  { name: "mcpjam-inspector", version: packageJson.version },
42938
43441
  {
@@ -42960,11 +43463,16 @@ class MCPJamClient extends Client {
42960
43463
  __publicField(this, "onPendingRequest");
42961
43464
  __publicField(this, "getRoots");
42962
43465
  __publicField(this, "addRequestHistory");
43466
+ __publicField(this, "addClientLog");
42963
43467
  __publicField(this, "is401Error", (error) => {
42964
43468
  return error instanceof SseError && error.code === 401 || error instanceof Error && error.message.includes("401") || error instanceof Error && error.message.includes("Unauthorized");
42965
43469
  });
42966
43470
  __publicField(this, "handleAuthError", async (error) => {
42967
43471
  if (this.is401Error(error)) {
43472
+ this.addClientLog(
43473
+ "Authentication error detected, attempting OAuth flow",
43474
+ "warn"
43475
+ );
42968
43476
  if (this.serverConfig.transportType !== "stdio" && "url" in this.serverConfig && this.serverConfig.url) {
42969
43477
  const serverAuthProvider = new InspectorOAuthClientProvider(
42970
43478
  this.serverConfig.url.toString()
@@ -42972,6 +43480,11 @@ class MCPJamClient extends Client {
42972
43480
  const result = await auth(serverAuthProvider, {
42973
43481
  serverUrl: this.serverConfig.url.toString()
42974
43482
  });
43483
+ if (result === "AUTHORIZED") {
43484
+ this.addClientLog("OAuth authentication successful", "info");
43485
+ } else {
43486
+ this.addClientLog("OAuth authentication failed", "error");
43487
+ }
42975
43488
  return result === "AUTHORIZED";
42976
43489
  }
42977
43490
  }
@@ -42983,10 +43496,13 @@ class MCPJamClient extends Client {
42983
43496
  apiKey: newApiKey,
42984
43497
  dangerouslyAllowBrowser: true
42985
43498
  });
43499
+ this.addClientLog("Anthropic API key updated", "info");
42986
43500
  }
42987
43501
  });
42988
43502
  __publicField(this, "handleCompletion", async (ref2, argName, value, signal) => {
43503
+ var _a2;
42989
43504
  if (!this.completionsSupported) {
43505
+ this.addClientLog("Completions not supported by server", "debug");
42990
43506
  return [];
42991
43507
  }
42992
43508
  const request = {
@@ -43000,19 +43516,31 @@ class MCPJamClient extends Client {
43000
43516
  }
43001
43517
  };
43002
43518
  try {
43519
+ this.addClientLog(`Requesting completion for ${argName}`, "debug");
43003
43520
  const response = await this.makeRequest(request, CompleteResultSchema, {
43004
43521
  signal,
43005
43522
  suppressToast: true
43006
43523
  });
43524
+ const completionCount = ((_a2 = response == null ? void 0 : response.completion.values) == null ? void 0 : _a2.length) || 0;
43525
+ this.addClientLog(
43526
+ `Received ${completionCount} completion suggestions`,
43527
+ "debug"
43528
+ );
43007
43529
  return (response == null ? void 0 : response.completion.values) || [];
43008
43530
  } catch (e) {
43009
43531
  if (e instanceof McpError && e.code === ErrorCode.MethodNotFound) {
43010
43532
  this.completionsSupported = false;
43533
+ this.addClientLog(
43534
+ "Completions disabled - server does not support them",
43535
+ "warn"
43536
+ );
43011
43537
  return [];
43012
43538
  }
43539
+ const errorMessage = e instanceof Error ? e.message : String(e);
43540
+ this.addClientLog(`Completion request failed: ${errorMessage}`, "error");
43013
43541
  toast({
43014
43542
  title: "Error",
43015
- description: e instanceof Error ? e.message : String(e),
43543
+ description: errorMessage,
43016
43544
  variant: "destructive"
43017
43545
  });
43018
43546
  throw e;
@@ -43038,6 +43566,7 @@ class MCPJamClient extends Client {
43038
43566
  this.onPendingRequest = onPendingRequest;
43039
43567
  this.getRoots = getRoots;
43040
43568
  this.addRequestHistory = addRequestHistory;
43569
+ this.addClientLog = addClientLog;
43041
43570
  }
43042
43571
  async connectStdio() {
43043
43572
  var _a2;
@@ -43064,13 +43593,27 @@ class MCPJamClient extends Client {
43064
43593
  };
43065
43594
  this.mcpProxyServerUrl = serverUrl;
43066
43595
  try {
43596
+ const command = "command" in this.serverConfig ? this.serverConfig.command : "unknown";
43597
+ this.addClientLog(
43598
+ `Connecting to MCP server via stdio: ${command}`,
43599
+ "info"
43600
+ );
43067
43601
  this.clientTransport = new SSEClientTransport(
43068
43602
  serverUrl,
43069
43603
  transportOptions
43070
43604
  );
43071
43605
  await this.connect(this.clientTransport);
43072
43606
  this.connectionStatus = "connected";
43607
+ this.addClientLog(
43608
+ "Successfully connected to MCP server via stdio",
43609
+ "info"
43610
+ );
43073
43611
  } catch (error) {
43612
+ const errorMessage = error instanceof Error ? error.message : String(error);
43613
+ this.addClientLog(
43614
+ `Failed to connect to MCP server via stdio: ${errorMessage}`,
43615
+ "error"
43616
+ );
43074
43617
  console.error("Error connecting to MCP server:", error);
43075
43618
  this.connectionStatus = "error";
43076
43619
  throw error;
@@ -43097,9 +43640,19 @@ class MCPJamClient extends Client {
43097
43640
  transportOptions
43098
43641
  );
43099
43642
  this.mcpProxyServerUrl = serverUrl;
43643
+ this.addClientLog(
43644
+ `Connecting to MCP server via SSE: ${this.serverConfig.url}`,
43645
+ "info"
43646
+ );
43100
43647
  await this.connect(this.clientTransport);
43101
43648
  this.connectionStatus = "connected";
43649
+ this.addClientLog("Successfully connected to MCP server via SSE", "info");
43102
43650
  } catch (error) {
43651
+ const errorMessage = error instanceof Error ? error.message : String(error);
43652
+ this.addClientLog(
43653
+ `Failed to connect to MCP server via SSE: ${errorMessage}`,
43654
+ "error"
43655
+ );
43103
43656
  console.error("Error connecting to MCP server:", error);
43104
43657
  this.connectionStatus = "error";
43105
43658
  throw error;
@@ -43129,9 +43682,22 @@ class MCPJamClient extends Client {
43129
43682
  transportOptions
43130
43683
  );
43131
43684
  this.mcpProxyServerUrl = serverUrl;
43685
+ this.addClientLog(
43686
+ `Connecting to MCP server via Streamable HTTP: ${this.serverConfig.url}`,
43687
+ "info"
43688
+ );
43132
43689
  await this.connect(this.clientTransport);
43133
43690
  this.connectionStatus = "connected";
43691
+ this.addClientLog(
43692
+ "Successfully connected to MCP server via Streamable HTTP",
43693
+ "info"
43694
+ );
43134
43695
  } catch (error) {
43696
+ const errorMessage = error instanceof Error ? error.message : String(error);
43697
+ this.addClientLog(
43698
+ `Failed to connect to MCP server via Streamable HTTP: ${errorMessage}`,
43699
+ "error"
43700
+ );
43135
43701
  console.error("Error connecting to MCP server:", error);
43136
43702
  this.connectionStatus = "error";
43137
43703
  throw error;
@@ -43142,12 +43708,20 @@ class MCPJamClient extends Client {
43142
43708
  const proxyHealthUrl = new URL(
43143
43709
  `${getMCPProxyAddress(this.inspectorConfig)}/health`
43144
43710
  );
43711
+ this.addClientLog("Checking MCP proxy server health", "debug");
43145
43712
  const proxyHealthResponse = await fetch(proxyHealthUrl);
43146
43713
  const proxyHealth = await proxyHealthResponse.json();
43147
43714
  if ((proxyHealth == null ? void 0 : proxyHealth.status) !== "ok") {
43715
+ this.addClientLog("MCP Proxy Server is not healthy", "error");
43148
43716
  throw new Error("MCP Proxy Server is not healthy");
43149
43717
  }
43718
+ this.addClientLog("MCP proxy server health check passed", "debug");
43150
43719
  } catch (e) {
43720
+ const errorMessage = e instanceof Error ? e.message : String(e);
43721
+ this.addClientLog(
43722
+ `Failed to connect to MCP Proxy Server: ${errorMessage}`,
43723
+ "error"
43724
+ );
43151
43725
  console.error("Couldn't connect to MCP Proxy Server", e);
43152
43726
  throw e;
43153
43727
  }
@@ -43159,11 +43733,20 @@ class MCPJamClient extends Client {
43159
43733
  await this.checkProxyHealth();
43160
43734
  } catch {
43161
43735
  this.connectionStatus = "error-connecting-to-proxy";
43736
+ this.addClientLog("Failed to connect to proxy server", "error");
43162
43737
  return;
43163
43738
  }
43164
43739
  try {
43740
+ this.addClientLog(
43741
+ `Attempting to connect to MCP server (attempt ${retryCount + 1}/${MAX_RETRIES + 1})`,
43742
+ "info"
43743
+ );
43165
43744
  const headers = {};
43166
43745
  if (this.serverConfig.transportType !== "stdio" && "url" in this.serverConfig && this.serverConfig.url) {
43746
+ this.addClientLog(
43747
+ "Setting up OAuth authentication for HTTP transport",
43748
+ "debug"
43749
+ );
43167
43750
  const serverAuthProvider = new InspectorOAuthClientProvider(
43168
43751
  this.serverConfig.url.toString()
43169
43752
  );
@@ -43171,10 +43754,23 @@ class MCPJamClient extends Client {
43171
43754
  if (token) {
43172
43755
  const authHeaderName = this.headerName || "Authorization";
43173
43756
  headers[authHeaderName] = `Bearer ${token}`;
43757
+ this.addClientLog(
43758
+ "Bearer token configured for authentication",
43759
+ "debug"
43760
+ );
43761
+ } else {
43762
+ this.addClientLog(
43763
+ "No bearer token available for authentication",
43764
+ "warn"
43765
+ );
43174
43766
  }
43175
43767
  } else if (this.bearerToken) {
43176
43768
  const authHeaderName = this.headerName || "Authorization";
43177
43769
  headers[authHeaderName] = `Bearer ${this.bearerToken}`;
43770
+ this.addClientLog(
43771
+ "Bearer token configured for stdio transport",
43772
+ "debug"
43773
+ );
43178
43774
  }
43179
43775
  this.headers = { ...this.headers, ...headers };
43180
43776
  if (this.onStdErrNotification) {
@@ -43182,6 +43778,7 @@ class MCPJamClient extends Client {
43182
43778
  StdErrNotificationSchema,
43183
43779
  this.onStdErrNotification
43184
43780
  );
43781
+ this.addClientLog("StdErr notification handler configured", "debug");
43185
43782
  }
43186
43783
  try {
43187
43784
  switch (this.serverConfig.transportType) {
@@ -43196,7 +43793,10 @@ class MCPJamClient extends Client {
43196
43793
  break;
43197
43794
  }
43198
43795
  this.serverCapabilities = this.getServerCapabilities() ?? null;
43199
- console.log("capabilities", this.serverCapabilities);
43796
+ this.addClientLog(
43797
+ `Server capabilities retrieved: ${JSON.stringify(this.serverCapabilities)}`,
43798
+ "debug"
43799
+ );
43200
43800
  const initializeRequest = {
43201
43801
  method: "initialize"
43202
43802
  };
@@ -43205,7 +43805,13 @@ class MCPJamClient extends Client {
43205
43805
  serverInfo: this.getServerVersion(),
43206
43806
  instructions: this.getInstructions()
43207
43807
  });
43808
+ this.addClientLog("MCP client initialization completed", "info");
43208
43809
  } catch (error) {
43810
+ const errorMessage = error instanceof Error ? error.message : String(error);
43811
+ this.addClientLog(
43812
+ `Failed to connect to MCP Server via the MCP Inspector Proxy: ${errorMessage}`,
43813
+ "error"
43814
+ );
43209
43815
  console.error(
43210
43816
  `Failed to connect to MCP Server via the MCP Inspector Proxy: ${this.getMCPProxyServerUrl()}:`,
43211
43817
  error
@@ -43213,14 +43819,19 @@ class MCPJamClient extends Client {
43213
43819
  if (retryCount < MAX_RETRIES) {
43214
43820
  const shouldRetry = await this.handleAuthError(error);
43215
43821
  if (shouldRetry) {
43216
- console.log(
43217
- `Retrying connection (attempt ${retryCount + 1}/${MAX_RETRIES})`
43822
+ this.addClientLog(
43823
+ `Retrying connection (attempt ${retryCount + 1}/${MAX_RETRIES})`,
43824
+ "info"
43218
43825
  );
43219
43826
  return this.connectToServer(void 0, retryCount + 1);
43220
43827
  }
43221
43828
  }
43222
43829
  if (this.is401Error(error)) {
43223
43830
  this.connectionStatus = "error";
43831
+ this.addClientLog(
43832
+ "Authentication failed, connection terminated",
43833
+ "error"
43834
+ );
43224
43835
  return;
43225
43836
  }
43226
43837
  throw error;
@@ -43239,9 +43850,16 @@ class MCPJamClient extends Client {
43239
43850
  var _a3;
43240
43851
  return { roots: ((_a3 = this.getRoots) == null ? void 0 : _a3.call(this)) ?? [] };
43241
43852
  });
43853
+ this.addClientLog("Roots request handler configured", "debug");
43242
43854
  }
43243
43855
  this.connectionStatus = "connected";
43856
+ this.addClientLog(
43857
+ "MCP client connection established successfully",
43858
+ "info"
43859
+ );
43244
43860
  } catch (e) {
43861
+ const errorMessage = e instanceof Error ? e.message : String(e);
43862
+ this.addClientLog(`Connection failed: ${errorMessage}`, "error");
43245
43863
  console.error(e);
43246
43864
  this.connectionStatus = "error";
43247
43865
  }
@@ -43254,6 +43872,7 @@ class MCPJamClient extends Client {
43254
43872
  }
43255
43873
  async makeRequest(request, schema, options) {
43256
43874
  console.log("makeRequestTriggered");
43875
+ this.addClientLog(`Making MCP request: ${request.method}`, "debug");
43257
43876
  try {
43258
43877
  const abortController = new AbortController();
43259
43878
  const mcpRequestOptions = {
@@ -43264,14 +43883,20 @@ class MCPJamClient extends Client {
43264
43883
  };
43265
43884
  if (mcpRequestOptions.resetTimeoutOnProgress) {
43266
43885
  mcpRequestOptions.onprogress = (_params) => {
43886
+ this.addClientLog("Progress notification received", "debug");
43267
43887
  };
43268
43888
  }
43269
43889
  let response;
43270
43890
  try {
43271
43891
  response = await this.request(request, schema, mcpRequestOptions);
43892
+ this.addClientLog(`MCP request successful: ${request.method}`, "info");
43272
43893
  this.addRequestHistory(request, response);
43273
43894
  } catch (error) {
43274
43895
  const errorMessage = error instanceof Error ? error.message : String(error);
43896
+ this.addClientLog(
43897
+ `MCP request failed: ${request.method} - ${errorMessage}`,
43898
+ "error"
43899
+ );
43275
43900
  this.addRequestHistory(request, { error: errorMessage });
43276
43901
  throw error;
43277
43902
  }
@@ -43279,6 +43904,10 @@ class MCPJamClient extends Client {
43279
43904
  } catch (e) {
43280
43905
  if (!(options == null ? void 0 : options.suppressToast)) {
43281
43906
  const errorString = e.message ?? String(e);
43907
+ this.addClientLog(
43908
+ `Request error (toast shown): ${errorString}`,
43909
+ "error"
43910
+ );
43282
43911
  toast({
43283
43912
  title: "Error",
43284
43913
  description: errorString,
@@ -43289,10 +43918,13 @@ class MCPJamClient extends Client {
43289
43918
  }
43290
43919
  }
43291
43920
  async tools() {
43921
+ this.addClientLog("Listing available tools", "debug");
43292
43922
  const tools = await this.listTools();
43923
+ this.addClientLog(`Found ${tools.tools.length} tools`, "info");
43293
43924
  return tools;
43294
43925
  }
43295
43926
  async disconnect() {
43927
+ this.addClientLog("Disconnecting from MCP server", "info");
43296
43928
  await this.close();
43297
43929
  this.connectionStatus = "disconnected";
43298
43930
  if (this.serverConfig.transportType !== "stdio") {
@@ -43300,21 +43932,34 @@ class MCPJamClient extends Client {
43300
43932
  this.serverConfig.url.toString()
43301
43933
  );
43302
43934
  authProvider.clear();
43935
+ this.addClientLog("OAuth tokens cleared", "debug");
43303
43936
  }
43304
43937
  this.serverCapabilities = null;
43938
+ this.addClientLog("MCP client disconnected successfully", "info");
43305
43939
  }
43306
43940
  async setServerCapabilities(capabilities) {
43307
43941
  this.serverCapabilities = capabilities;
43942
+ this.addClientLog("Server capabilities updated", "debug");
43308
43943
  }
43309
43944
  async processQuery(query, tools, onUpdate, model = "claude-3-5-sonnet-latest") {
43310
43945
  if (!this.anthropic) {
43311
- throw new Error("Anthropic client not initialized");
43946
+ const errorMessage = "Anthropic client not initialized";
43947
+ this.addClientLog(errorMessage, "error");
43948
+ throw new Error(errorMessage);
43312
43949
  }
43950
+ this.addClientLog(
43951
+ `Processing query with ${tools.length} tools using model ${model}`,
43952
+ "info"
43953
+ );
43313
43954
  const context = this.initializeQueryContext(query, tools, model);
43314
43955
  const response = await this.makeInitialApiCall(context);
43315
43956
  return this.processIterations(response, context, onUpdate);
43316
43957
  }
43317
43958
  initializeQueryContext(query, tools, model) {
43959
+ this.addClientLog(
43960
+ `Initializing query context with ${tools.length} tools`,
43961
+ "debug"
43962
+ );
43318
43963
  return {
43319
43964
  messages: [{ role: "user", content: query }],
43320
43965
  finalText: [],
@@ -43324,6 +43969,7 @@ class MCPJamClient extends Client {
43324
43969
  };
43325
43970
  }
43326
43971
  async makeInitialApiCall(context) {
43972
+ this.addClientLog("Making initial API call to Anthropic", "debug");
43327
43973
  return this.anthropic.messages.create({
43328
43974
  model: context.model,
43329
43975
  max_tokens: 1e3,
@@ -43336,21 +43982,34 @@ class MCPJamClient extends Client {
43336
43982
  let iteration = 0;
43337
43983
  while (iteration < context.MAX_ITERATIONS) {
43338
43984
  iteration++;
43985
+ this.addClientLog(
43986
+ `Processing iteration ${iteration}/${context.MAX_ITERATIONS}`,
43987
+ "debug"
43988
+ );
43339
43989
  const iterationResult = await this.processIteration(response, context);
43340
43990
  this.sendIterationUpdate(iterationResult.content, onUpdate);
43341
43991
  if (!iterationResult.hasToolUse) {
43992
+ this.addClientLog("No tool use detected, ending iterations", "debug");
43342
43993
  break;
43343
43994
  }
43344
43995
  try {
43345
43996
  response = await this.makeFollowUpApiCall(context);
43346
43997
  } catch (error) {
43347
43998
  const errorMessage = `[API Error: ${error}]`;
43999
+ this.addClientLog(
44000
+ `API error in iteration ${iteration}: ${error}`,
44001
+ "error"
44002
+ );
43348
44003
  context.finalText.push(errorMessage);
43349
44004
  this.sendIterationUpdate(errorMessage, onUpdate);
43350
44005
  break;
43351
44006
  }
43352
44007
  }
43353
44008
  this.handleMaxIterationsWarning(iteration, context, onUpdate);
44009
+ this.addClientLog(
44010
+ `Query processing completed in ${iteration} iterations`,
44011
+ "info"
44012
+ );
43354
44013
  return context.finalText.join("\n");
43355
44014
  }
43356
44015
  async processIteration(response, context) {
@@ -43367,6 +44026,7 @@ class MCPJamClient extends Client {
43367
44026
  );
43368
44027
  } else if (content.type === "tool_use") {
43369
44028
  hasToolUse = true;
44029
+ this.addClientLog(`Tool use detected: ${content.name}`, "debug");
43370
44030
  await this.handleToolUse(
43371
44031
  content,
43372
44032
  iterationContent,
@@ -43391,12 +44051,18 @@ class MCPJamClient extends Client {
43391
44051
  iterationContent.push(toolMessage);
43392
44052
  context.finalText.push(toolMessage);
43393
44053
  try {
44054
+ this.addClientLog(`Executing tool: ${content.name}`, "debug");
43394
44055
  await this.executeToolAndUpdateMessages(
43395
44056
  content,
43396
44057
  context,
43397
44058
  assistantContent
43398
44059
  );
44060
+ this.addClientLog(`Tool execution successful: ${content.name}`, "debug");
43399
44061
  } catch (error) {
44062
+ this.addClientLog(
44063
+ `Tool execution failed: ${content.name} - ${error}`,
44064
+ "error"
44065
+ );
43400
44066
  this.handleToolError(
43401
44067
  error,
43402
44068
  content,
@@ -43454,6 +44120,7 @@ class MCPJamClient extends Client {
43454
44120
  });
43455
44121
  }
43456
44122
  async makeFollowUpApiCall(context) {
44123
+ this.addClientLog("Making follow-up API call to Anthropic", "debug");
43457
44124
  return this.anthropic.messages.create({
43458
44125
  model: context.model,
43459
44126
  max_tokens: 1e3,
@@ -43471,11 +44138,16 @@ class MCPJamClient extends Client {
43471
44138
  handleMaxIterationsWarning(iteration, context, onUpdate) {
43472
44139
  if (iteration >= context.MAX_ITERATIONS) {
43473
44140
  const warningMessage = `[Warning: Reached maximum iterations (${context.MAX_ITERATIONS}). Stopping to prevent excessive API usage.]`;
44141
+ this.addClientLog(
44142
+ `Maximum iterations reached (${context.MAX_ITERATIONS})`,
44143
+ "warn"
44144
+ );
43474
44145
  context.finalText.push(warningMessage);
43475
44146
  this.sendIterationUpdate(warningMessage, onUpdate);
43476
44147
  }
43477
44148
  }
43478
44149
  async chatLoop(tools) {
44150
+ this.addClientLog("Starting interactive chat loop", "info");
43479
44151
  const rl = readline.createInterface({
43480
44152
  input: process.stdin,
43481
44153
  output: process.stdout
@@ -43486,16 +44158,23 @@ class MCPJamClient extends Client {
43486
44158
  while (true) {
43487
44159
  const message = await rl.question("\nQuery: ");
43488
44160
  if (message.toLowerCase() === "quit") {
44161
+ this.addClientLog("Chat loop terminated by user", "info");
43489
44162
  break;
43490
44163
  }
44164
+ this.addClientLog(
44165
+ `Processing user query: ${message.substring(0, 50)}${message.length > 50 ? "..." : ""}`,
44166
+ "debug"
44167
+ );
43491
44168
  const response = await this.processQuery(message, tools);
43492
44169
  console.log("\n" + response);
43493
44170
  }
43494
44171
  } finally {
43495
44172
  rl.close();
44173
+ this.addClientLog("Chat loop interface closed", "debug");
43496
44174
  }
43497
44175
  }
43498
44176
  async cleanup() {
44177
+ this.addClientLog("Cleaning up MCP client", "info");
43499
44178
  await this.close();
43500
44179
  }
43501
44180
  }
@@ -43511,6 +44190,7 @@ class MCPJamAgent {
43511
44190
  __publicField(this, "onPendingRequest");
43512
44191
  __publicField(this, "getRoots");
43513
44192
  __publicField(this, "addRequestHistory");
44193
+ __publicField(this, "addClientLog");
43514
44194
  this.serverConfigs = options.servers;
43515
44195
  this.config = options.config || createDefaultConfig();
43516
44196
  this.bearerToken = options.bearerToken;
@@ -43520,6 +44200,7 @@ class MCPJamAgent {
43520
44200
  this.onPendingRequest = options.onPendingRequest;
43521
44201
  this.getRoots = options.getRoots;
43522
44202
  this.addRequestHistory = options.addRequestHistory;
44203
+ this.addClientLog = options.addClientLog;
43523
44204
  }
43524
44205
  // Add or update a server configuration
43525
44206
  addServer(name, config) {
@@ -43604,26 +44285,6 @@ class MCPJamAgent {
43604
44285
  if (existingClient && existingClient.connectionStatus === "connected") {
43605
44286
  return existingClient;
43606
44287
  }
43607
- if (this.isRemoteServer(config)) {
43608
- const connectedRemoteServerName = this.getConnectedRemoteServerName();
43609
- if (connectedRemoteServerName && connectedRemoteServerName !== name) {
43610
- console.log(
43611
- `Automatically disconnecting existing remote server: ${connectedRemoteServerName}`
43612
- );
43613
- await this.disconnectFromServer(connectedRemoteServerName);
43614
- const connectedConfig = this.serverConfigs[connectedRemoteServerName];
43615
- if (connectedConfig && "url" in connectedConfig && connectedConfig.url) {
43616
- const { InspectorOAuthClientProvider: InspectorOAuthClientProvider2 } = await __vitePreload(async () => {
43617
- const { InspectorOAuthClientProvider: InspectorOAuthClientProvider3 } = await Promise.resolve().then(() => auth$1);
43618
- return { InspectorOAuthClientProvider: InspectorOAuthClientProvider3 };
43619
- }, true ? void 0 : void 0);
43620
- const oldAuthProvider = new InspectorOAuthClientProvider2(
43621
- connectedConfig.url.toString()
43622
- );
43623
- oldAuthProvider.clear();
43624
- }
43625
- }
43626
- }
43627
44288
  if (existingClient && existingClient.connectionStatus === "disconnected") {
43628
44289
  try {
43629
44290
  await existingClient.connectToServer();
@@ -43639,6 +44300,8 @@ class MCPJamAgent {
43639
44300
  // config (second parameter)
43640
44301
  this.addRequestHistory,
43641
44302
  // addRequestHistory
44303
+ this.addClientLog,
44304
+ // addClientLog
43642
44305
  this.bearerToken,
43643
44306
  // bearerToken
43644
44307
  this.headerName,
@@ -43776,7 +44439,6 @@ class MCPJamAgent {
43776
44439
  ).length;
43777
44440
  if (errorCount > 0) return "error";
43778
44441
  if (connectedCount === connections.length) return "connected";
43779
- if (connectedCount > 0) return "partial";
43780
44442
  return "disconnected";
43781
44443
  }
43782
44444
  // Check if there are any connected remote servers (HTTP/SSE)
@@ -43799,12 +44461,8 @@ class MCPJamAgent {
43799
44461
  }
43800
44462
  return null;
43801
44463
  }
43802
- // Check if a server config is for a remote connection
43803
- isRemoteServer(config) {
43804
- return config.transportType !== "stdio";
43805
- }
43806
44464
  }
43807
- const useConnectionState = (addRequestHistory) => {
44465
+ const useConnectionState = (addRequestHistory, addClientLog) => {
43808
44466
  const [mcpAgent, setMcpAgent] = reactExports.useState(null);
43809
44467
  const [sidebarUpdateTrigger, setSidebarUpdateTrigger] = reactExports.useState(0);
43810
44468
  const forceUpdateSidebar = reactExports.useCallback(() => {
@@ -43825,7 +44483,8 @@ const useConnectionState = (addRequestHistory) => {
43825
44483
  onStdErrNotification,
43826
44484
  onPendingRequest,
43827
44485
  getRoots,
43828
- addRequestHistory
44486
+ addRequestHistory,
44487
+ addClientLog
43829
44488
  };
43830
44489
  const agent = new MCPJamAgent(options);
43831
44490
  try {
@@ -43838,7 +44497,7 @@ const useConnectionState = (addRequestHistory) => {
43838
44497
  throw error;
43839
44498
  }
43840
44499
  },
43841
- [addRequestHistory]
44500
+ [addRequestHistory, addClientLog]
43842
44501
  );
43843
44502
  const createAgentWithoutConnecting = reactExports.useCallback(
43844
44503
  async (serverConfigs, config, bearerToken, headerName, claudeApiKey, onStdErrNotification, onPendingRequest, getRoots) => {
@@ -43851,13 +44510,14 @@ const useConnectionState = (addRequestHistory) => {
43851
44510
  onStdErrNotification,
43852
44511
  onPendingRequest,
43853
44512
  getRoots,
43854
- addRequestHistory
44513
+ addRequestHistory,
44514
+ addClientLog
43855
44515
  };
43856
44516
  const agent = new MCPJamAgent(options);
43857
44517
  setMcpAgent(agent);
43858
44518
  return agent;
43859
44519
  },
43860
- [addRequestHistory]
44520
+ [addRequestHistory, addClientLog]
43861
44521
  );
43862
44522
  const addServer = reactExports.useCallback(
43863
44523
  async (name, serverConfig, config, bearerToken, headerName, claudeApiKey, onStdErrNotification, onPendingRequest, getRoots) => {
@@ -43873,7 +44533,8 @@ const useConnectionState = (addRequestHistory) => {
43873
44533
  onStdErrNotification,
43874
44534
  onPendingRequest,
43875
44535
  getRoots,
43876
- addRequestHistory
44536
+ addRequestHistory,
44537
+ addClientLog
43877
44538
  };
43878
44539
  const agent = new MCPJamAgent(options);
43879
44540
  try {
@@ -43907,7 +44568,7 @@ const useConnectionState = (addRequestHistory) => {
43907
44568
  }
43908
44569
  }
43909
44570
  },
43910
- [mcpAgent, forceUpdateSidebar, addRequestHistory]
44571
+ [mcpAgent, forceUpdateSidebar, addRequestHistory, addClientLog]
43911
44572
  );
43912
44573
  const removeServer = reactExports.useCallback(
43913
44574
  async (serverName) => {
@@ -44029,7 +44690,10 @@ const useMCPOperations = () => {
44029
44690
  const [stdErrNotifications, setStdErrNotifications] = reactExports.useState([]);
44030
44691
  const [roots, setRoots] = reactExports.useState([]);
44031
44692
  const [pendingSampleRequests, setPendingSampleRequests] = reactExports.useState([]);
44032
- const [requestHistory, setRequestHistory] = reactExports.useState([]);
44693
+ const [requestHistory, setRequestHistory] = reactExports.useState(
44694
+ []
44695
+ );
44696
+ const [clientLogs, setClientLogs] = reactExports.useState([]);
44033
44697
  const progressTokenRef = reactExports.useRef(0);
44034
44698
  const clearError = reactExports.useCallback((tabKey) => {
44035
44699
  setErrors((prev) => ({ ...prev, [tabKey]: null }));
@@ -44046,6 +44710,27 @@ const useMCPOperations = () => {
44046
44710
  },
44047
44711
  []
44048
44712
  );
44713
+ const getRequestHistory = reactExports.useCallback(() => {
44714
+ return requestHistory;
44715
+ }, [requestHistory]);
44716
+ const clearRequestHistory = reactExports.useCallback(() => {
44717
+ setRequestHistory([]);
44718
+ }, []);
44719
+ const addClientLog = reactExports.useCallback(
44720
+ (message, level) => {
44721
+ setClientLogs((prev) => [
44722
+ ...prev,
44723
+ { message, level, timestamp: (/* @__PURE__ */ new Date()).toISOString() }
44724
+ ]);
44725
+ },
44726
+ []
44727
+ );
44728
+ const clearClientLogs = reactExports.useCallback(() => {
44729
+ setClientLogs([]);
44730
+ }, []);
44731
+ const getClientLogs = reactExports.useCallback(() => {
44732
+ return clientLogs;
44733
+ }, [clientLogs]);
44049
44734
  const listResources = reactExports.useCallback(
44050
44735
  async (mcpAgent, selectedServerName) => {
44051
44736
  if (!mcpAgent) return;
@@ -44058,6 +44743,10 @@ const useMCPOperations = () => {
44058
44743
  );
44059
44744
  const endTime = performance.now();
44060
44745
  const latency = Math.round(endTime - startTime);
44746
+ addClientLog(
44747
+ `Listed ${flatResources.length} resources from all servers`,
44748
+ "info"
44749
+ );
44061
44750
  addRequestHistory(
44062
44751
  { method: "resources/list/all" },
44063
44752
  { resources: flatResources },
@@ -44071,6 +44760,10 @@ const useMCPOperations = () => {
44071
44760
  const resourcesResponse = await client2.listResources();
44072
44761
  const endTime = performance.now();
44073
44762
  const latency = Math.round(endTime - startTime);
44763
+ addClientLog(
44764
+ `Listed ${resourcesResponse.resources.length} resources from ${selectedServerName}`,
44765
+ "info"
44766
+ );
44074
44767
  addRequestHistory(
44075
44768
  { method: "resources/list", server: selectedServerName },
44076
44769
  { resources: resourcesResponse.resources },
@@ -44096,6 +44789,10 @@ const useMCPOperations = () => {
44096
44789
  const templatesResponse = await client2.listResourceTemplates();
44097
44790
  const endTime = performance.now();
44098
44791
  const latency = Math.round(endTime - startTime);
44792
+ addClientLog(
44793
+ `Listed ${templatesResponse.resourceTemplates.length} resource templates from all servers`,
44794
+ "info"
44795
+ );
44099
44796
  addRequestHistory(
44100
44797
  { method: "resourceTemplates/list/all" },
44101
44798
  { resourceTemplates: templatesResponse.resourceTemplates },
@@ -44111,6 +44808,10 @@ const useMCPOperations = () => {
44111
44808
  const templatesResponse = await client2.listResourceTemplates();
44112
44809
  const endTime = performance.now();
44113
44810
  const latency = Math.round(endTime - startTime);
44811
+ addClientLog(
44812
+ `Listed ${templatesResponse.resourceTemplates.length} resource templates from ${selectedServerName}`,
44813
+ "info"
44814
+ );
44114
44815
  addRequestHistory(
44115
44816
  { method: "resourceTemplates/list", server: selectedServerName },
44116
44817
  { resourceTemplates: templatesResponse.resourceTemplates },
@@ -44135,6 +44836,7 @@ const useMCPOperations = () => {
44135
44836
  );
44136
44837
  const endTime = performance.now();
44137
44838
  const latency = Math.round(endTime - startTime);
44839
+ addClientLog(`Read resource ${uri} from ${selectedServerName}`, "info");
44138
44840
  addRequestHistory(
44139
44841
  { method: "resources/read", server: selectedServerName, uri },
44140
44842
  result,
@@ -44152,6 +44854,7 @@ const useMCPOperations = () => {
44152
44854
  );
44153
44855
  const endTime = performance.now();
44154
44856
  const latency = Math.round(endTime - startTime);
44857
+ addClientLog(`Read resource ${uri} from ${serverName}`, "info");
44155
44858
  addRequestHistory(
44156
44859
  { method: "resources/read", server: serverName, uri },
44157
44860
  result,
@@ -44176,6 +44879,10 @@ const useMCPOperations = () => {
44176
44879
  const result = await client2.subscribeResource({ uri });
44177
44880
  const endTime = performance.now();
44178
44881
  const latency = Math.round(endTime - startTime);
44882
+ addClientLog(
44883
+ `Subscribed to resource ${uri} from ${selectedServerName}`,
44884
+ "info"
44885
+ );
44179
44886
  addRequestHistory(
44180
44887
  { method: "resources/subscribe", server: selectedServerName, uri },
44181
44888
  result,
@@ -44197,6 +44904,10 @@ const useMCPOperations = () => {
44197
44904
  const result = await client2.unsubscribeResource({ uri });
44198
44905
  const endTime = performance.now();
44199
44906
  const latency = Math.round(endTime - startTime);
44907
+ addClientLog(
44908
+ `Unsubscribed from resource ${uri} from ${selectedServerName}`,
44909
+ "info"
44910
+ );
44200
44911
  addRequestHistory(
44201
44912
  { method: "resources/unsubscribe", server: selectedServerName, uri },
44202
44913
  result,
@@ -44218,6 +44929,10 @@ const useMCPOperations = () => {
44218
44929
  const flatPrompts = allServerPrompts.flatMap(({ prompts: prompts2 }) => prompts2);
44219
44930
  const endTime = performance.now();
44220
44931
  const latency = Math.round(endTime - startTime);
44932
+ addClientLog(
44933
+ `Listed ${flatPrompts.length} prompts from all servers`,
44934
+ "info"
44935
+ );
44221
44936
  addRequestHistory(
44222
44937
  { method: "prompts/list/all" },
44223
44938
  { prompts: flatPrompts },
@@ -44231,6 +44946,10 @@ const useMCPOperations = () => {
44231
44946
  const promptsResponse = await client2.listPrompts();
44232
44947
  const endTime = performance.now();
44233
44948
  const latency = Math.round(endTime - startTime);
44949
+ addClientLog(
44950
+ `Listed ${promptsResponse.prompts.length} prompts from ${selectedServerName}`,
44951
+ "info"
44952
+ );
44234
44953
  addRequestHistory(
44235
44954
  { method: "prompts/list", server: selectedServerName },
44236
44955
  { prompts: promptsResponse.prompts },
@@ -44256,6 +44975,7 @@ const useMCPOperations = () => {
44256
44975
  );
44257
44976
  const endTime = performance.now();
44258
44977
  const latency = Math.round(endTime - startTime);
44978
+ addClientLog(`Got prompt ${name} from ${selectedServerName}`, "info");
44259
44979
  addRequestHistory(
44260
44980
  { method: "prompts/get", server: selectedServerName, name, args },
44261
44981
  result,
@@ -44274,6 +44994,7 @@ const useMCPOperations = () => {
44274
44994
  );
44275
44995
  const endTime = performance.now();
44276
44996
  const latency = Math.round(endTime - startTime);
44997
+ addClientLog(`Got prompt ${name} from ${serverName}`, "info");
44277
44998
  addRequestHistory(
44278
44999
  { method: "prompts/get", server: serverName, name, args },
44279
45000
  result,
@@ -44298,6 +45019,10 @@ const useMCPOperations = () => {
44298
45019
  const flatTools = allServerTools.flatMap(({ tools: tools2 }) => tools2);
44299
45020
  const endTime = performance.now();
44300
45021
  const latency = Math.round(endTime - startTime);
45022
+ addClientLog(
45023
+ `Listed ${flatTools.length} tools from all servers`,
45024
+ "info"
45025
+ );
44301
45026
  addRequestHistory(
44302
45027
  { method: "tools/list/all" },
44303
45028
  { tools: flatTools },
@@ -44311,6 +45036,10 @@ const useMCPOperations = () => {
44311
45036
  const toolsResponse = await client2.tools();
44312
45037
  const endTime = performance.now();
44313
45038
  const latency = Math.round(endTime - startTime);
45039
+ addClientLog(
45040
+ `Listed ${toolsResponse.tools.length} tools from ${selectedServerName}`,
45041
+ "info"
45042
+ );
44314
45043
  addRequestHistory(
44315
45044
  { method: "tools/list", server: selectedServerName },
44316
45045
  { tools: toolsResponse.tools },
@@ -44337,6 +45066,7 @@ const useMCPOperations = () => {
44337
45066
  );
44338
45067
  const endTime = performance.now();
44339
45068
  const latency = Math.round(endTime - startTime);
45069
+ addClientLog(`Called tool ${name} on ${selectedServerName}`, "info");
44340
45070
  addRequestHistory(
44341
45071
  { method: "tools/call", server: selectedServerName, name, params },
44342
45072
  result,
@@ -44355,6 +45085,7 @@ const useMCPOperations = () => {
44355
45085
  );
44356
45086
  const endTime = performance.now();
44357
45087
  const latency = Math.round(endTime - startTime);
45088
+ addClientLog(`Called tool ${name} on ${serverName}`, "info");
44358
45089
  addRequestHistory(
44359
45090
  { method: "tools/call", server: serverName, name, params },
44360
45091
  result,
@@ -44370,6 +45101,10 @@ const useMCPOperations = () => {
44370
45101
  } catch (e) {
44371
45102
  const endTime = performance.now();
44372
45103
  const latency = Math.round(endTime - startTime);
45104
+ addClientLog(
45105
+ `Error calling tool ${name} on ${selectedServerName}`,
45106
+ "error"
45107
+ );
44373
45108
  const toolResult2 = {
44374
45109
  content: [
44375
45110
  {
@@ -44423,6 +45158,10 @@ const useMCPOperations = () => {
44423
45158
  const result = await client2.handleCompletion(ref2, argName, value, signal);
44424
45159
  const endTime = performance.now();
44425
45160
  const latency = Math.round(endTime - startTime);
45161
+ addClientLog(
45162
+ `Completed completion for ${ref2.type} ${ref2.name} on ${selectedServerName}`,
45163
+ "info"
45164
+ );
44426
45165
  addRequestHistory(
44427
45166
  {
44428
45167
  method: "completion",
@@ -44437,7 +45176,7 @@ const useMCPOperations = () => {
44437
45176
  );
44438
45177
  return result;
44439
45178
  },
44440
- [addRequestHistory]
45179
+ [addRequestHistory, addClientLog]
44441
45180
  );
44442
45181
  const handleApproveSampling = reactExports.useCallback(
44443
45182
  (id, result) => {
@@ -44466,12 +45205,6 @@ const useMCPOperations = () => {
44466
45205
  return updatedRequests;
44467
45206
  });
44468
45207
  }, []);
44469
- const getRequestHistory = reactExports.useCallback(() => {
44470
- return requestHistory;
44471
- }, [requestHistory]);
44472
- const clearRequestHistory = reactExports.useCallback(() => {
44473
- setRequestHistory([]);
44474
- }, []);
44475
45208
  return {
44476
45209
  // State
44477
45210
  resources,
@@ -44532,7 +45265,10 @@ const useMCPOperations = () => {
44532
45265
  handleRejectSampling,
44533
45266
  addRequestHistory,
44534
45267
  getRequestHistory,
44535
- clearRequestHistory
45268
+ clearRequestHistory,
45269
+ addClientLog,
45270
+ clearClientLogs,
45271
+ getClientLogs
44536
45272
  };
44537
45273
  };
44538
45274
  const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
@@ -44662,7 +45398,10 @@ const App = () => {
44662
45398
  var _a2, _b;
44663
45399
  const serverState = useServerState();
44664
45400
  const mcpOperations = useMCPOperations();
44665
- const connectionState = useConnectionState(mcpOperations.addRequestHistory);
45401
+ const connectionState = useConnectionState(
45402
+ mcpOperations.addRequestHistory,
45403
+ mcpOperations.addClientLog
45404
+ );
44666
45405
  const configState = useConfigState();
44667
45406
  const rootsRef = reactExports.useRef(mcpOperations.roots);
44668
45407
  const nextRequestId = reactExports.useRef(0);
@@ -44672,6 +45411,7 @@ const App = () => {
44672
45411
  });
44673
45412
  const [isSidebarExpanded, setIsSidebarExpanded] = reactExports.useState(true);
44674
45413
  const [showStarModal, setShowStarModal] = reactExports.useState(false);
45414
+ const { addClientLog } = mcpOperations;
44675
45415
  reactExports.useEffect(() => {
44676
45416
  const handleHashChange = () => {
44677
45417
  const hash = window.location.hash.slice(1);
@@ -44700,7 +45440,7 @@ const App = () => {
44700
45440
  (notification) => {
44701
45441
  mcpOperations.setStdErrNotifications((prev) => [...prev, notification]);
44702
45442
  },
44703
- [mcpOperations.setStdErrNotifications]
45443
+ [mcpOperations]
44704
45444
  );
44705
45445
  const onPendingRequest = reactExports.useCallback(
44706
45446
  (request, resolve, reject) => {
@@ -44709,7 +45449,7 @@ const App = () => {
44709
45449
  { id: nextRequestId.current++, request, resolve, reject }
44710
45450
  ]);
44711
45451
  },
44712
- [mcpOperations.setPendingSampleRequests]
45452
+ [mcpOperations]
44713
45453
  );
44714
45454
  const getRootsCallback = reactExports.useCallback(() => rootsRef.current, []);
44715
45455
  const connectionStatus = connectionState.getConnectionStatus();
@@ -44721,10 +45461,11 @@ const App = () => {
44721
45461
  serverState.selectedServerName
44722
45462
  );
44723
45463
  const handleAddServer = reactExports.useCallback(
44724
- async (name, serverConfig) => {
44725
- console.log("🔧 Adding server without auto-connect:", {
45464
+ async (name, serverConfig, options = {}) => {
45465
+ console.log("🔧 Adding server with options:", {
44726
45466
  name,
44727
- serverConfig
45467
+ serverConfig,
45468
+ options
44728
45469
  });
44729
45470
  const shouldSelectNewServer = Object.keys(serverState.serverConfigs).length === 0;
44730
45471
  serverState.updateServerConfig(name, serverConfig);
@@ -44732,15 +45473,17 @@ const App = () => {
44732
45473
  serverState.setSelectedServerName(name);
44733
45474
  }
44734
45475
  if (!connectionState.mcpAgent) {
44735
- console.log(
44736
- "🆕 Creating agent with server config (no auto-connect)..."
45476
+ console.log("🆕 Creating agent with server config...");
45477
+ addClientLog(
45478
+ `🆕 Creating agent with server config (no auto-connect) ${name} ${JSON.stringify(serverConfig)}`,
45479
+ "info"
44737
45480
  );
44738
45481
  try {
44739
45482
  const allServerConfigs = {
44740
45483
  ...serverState.serverConfigs,
44741
45484
  [name]: serverConfig
44742
45485
  };
44743
- await connectionState.createAgentWithoutConnecting(
45486
+ const agent = await connectionState.createAgentWithoutConnecting(
44744
45487
  allServerConfigs,
44745
45488
  configState.config,
44746
45489
  configState.bearerToken,
@@ -44750,26 +45493,41 @@ const App = () => {
44750
45493
  onPendingRequest,
44751
45494
  getRootsCallback
44752
45495
  );
45496
+ if (options.autoConnect) {
45497
+ console.log("🔌 Auto-connecting to all servers...");
45498
+ await agent.connectToAllServers();
45499
+ console.log("✅ Successfully connected to all servers");
45500
+ serverState.setSelectedServerName(name);
45501
+ connectionState.forceUpdateSidebar();
45502
+ }
44753
45503
  } catch (error) {
44754
- console.error("❌ Failed to create agent:", error);
45504
+ console.error("❌ Failed to create agent and connect:", error);
44755
45505
  throw error;
44756
45506
  }
44757
45507
  } else {
44758
45508
  connectionState.mcpAgent.addServer(name, serverConfig);
44759
45509
  connectionState.forceUpdateSidebar();
45510
+ if (options.autoConnect) {
45511
+ console.log(`🔌 Auto-connecting to server: "${name}"`);
45512
+ try {
45513
+ serverState.setSelectedServerName(name);
45514
+ await connectionState.connectServer(name);
45515
+ console.log(`✅ Successfully auto-connected to "${name}"`);
45516
+ } catch (error) {
45517
+ console.error(`❌ Failed to auto-connect to "${name}":`, error);
45518
+ }
45519
+ }
44760
45520
  }
44761
45521
  return name;
44762
45522
  },
44763
45523
  [
44764
45524
  serverState,
44765
45525
  connectionState,
44766
- configState.config,
44767
- configState.bearerToken,
44768
- configState.headerName,
44769
- configState.claudeApiKey,
45526
+ configState,
44770
45527
  onStdErrNotification,
44771
45528
  onPendingRequest,
44772
- getRootsCallback
45529
+ getRootsCallback,
45530
+ addClientLog
44773
45531
  ]
44774
45532
  );
44775
45533
  const handleRemoveServer = reactExports.useCallback(
@@ -44789,43 +45547,55 @@ const App = () => {
44789
45547
  );
44790
45548
  const handleUpdateServer = reactExports.useCallback(
44791
45549
  async (serverName, config) => {
44792
- await connectionState.updateServerWithoutConnecting(serverName, config);
45550
+ await connectionState.updateServer(serverName, config);
44793
45551
  serverState.updateServerConfig(serverName, config);
45552
+ addClientLog(
45553
+ `🔧 Updated server: ${serverName} ${JSON.stringify(config)}`,
45554
+ "info"
45555
+ );
44794
45556
  },
44795
- [connectionState, serverState]
45557
+ [connectionState, serverState, addClientLog]
44796
45558
  );
44797
- const handleSaveClient = reactExports.useCallback(async () => {
44798
- if (!serverState.clientFormName.trim()) return;
44799
- try {
44800
- if (serverState.isCreatingClient) {
44801
- await handleAddServer(
44802
- serverState.clientFormName,
44803
- serverState.clientFormConfig
44804
- );
44805
- } else if (serverState.editingClientName) {
44806
- const oldServerName = serverState.editingClientName;
44807
- const newServerName = serverState.clientFormName.trim();
44808
- if (oldServerName !== newServerName) {
44809
- console.log(
44810
- `🔄 Server name changed from "${oldServerName}" to "${newServerName}"`
44811
- );
44812
- await handleRemoveServer(oldServerName);
44813
- await handleAddServer(newServerName, serverState.clientFormConfig);
44814
- if (serverState.selectedServerName === oldServerName) {
44815
- serverState.setSelectedServerName(newServerName);
45559
+ const handleSaveClient = reactExports.useCallback(
45560
+ async (config) => {
45561
+ if (!serverState.clientFormName.trim()) return;
45562
+ try {
45563
+ if (serverState.isCreatingClient) {
45564
+ await handleAddServer(serverState.clientFormName, config, {
45565
+ autoConnect: true
45566
+ });
45567
+ } else if (serverState.editingClientName) {
45568
+ const oldServerName = serverState.editingClientName;
45569
+ const newServerName = serverState.clientFormName.trim();
45570
+ if (oldServerName !== newServerName) {
45571
+ addClientLog(
45572
+ `🔄 Server name changed from "${oldServerName}" to "${newServerName}"`,
45573
+ "info"
45574
+ );
45575
+ await handleRemoveServer(oldServerName);
45576
+ await handleAddServer(newServerName, config, {
45577
+ autoConnect: true
45578
+ });
45579
+ if (serverState.selectedServerName === oldServerName) {
45580
+ serverState.setSelectedServerName(newServerName);
45581
+ }
45582
+ } else {
45583
+ await handleUpdateServer(serverState.editingClientName, config);
44816
45584
  }
44817
- } else {
44818
- await handleUpdateServer(
44819
- serverState.editingClientName,
44820
- serverState.clientFormConfig
44821
- );
44822
45585
  }
45586
+ serverState.handleCancelClientForm();
45587
+ } catch (error) {
45588
+ console.error("Failed to save client:", error);
44823
45589
  }
44824
- serverState.handleCancelClientForm();
44825
- } catch (error) {
44826
- console.error("Failed to save client:", error);
44827
- }
44828
- }, [serverState, handleAddServer, handleUpdateServer, handleRemoveServer]);
45590
+ },
45591
+ [
45592
+ serverState,
45593
+ handleAddServer,
45594
+ handleUpdateServer,
45595
+ handleRemoveServer,
45596
+ addClientLog
45597
+ ]
45598
+ );
44829
45599
  const handleSaveMultiple = reactExports.useCallback(
44830
45600
  async (clients) => {
44831
45601
  const results = {
@@ -44836,28 +45606,39 @@ const App = () => {
44836
45606
  for (const client2 of clients) {
44837
45607
  try {
44838
45608
  console.log(`🔧 Creating client: "${client2.name}"`);
44839
- await handleAddServer(client2.name, client2.config);
45609
+ await handleAddServer(client2.name, client2.config, {
45610
+ autoConnect: false
45611
+ });
44840
45612
  results.success.push(client2.name);
44841
- console.log(`✅ Successfully created client: "${client2.name}"`);
45613
+ addClientLog(
45614
+ `✅ Successfully created client: "${client2.name}"`,
45615
+ "info"
45616
+ );
44842
45617
  } catch (error) {
44843
45618
  const errorMessage = error instanceof Error ? error.message : String(error);
44844
- console.error(`❌ Failed to create client "${client2.name}":`, errorMessage);
45619
+ addClientLog(
45620
+ `❌ Failed to create client "${client2.name}": ${errorMessage}`,
45621
+ "error"
45622
+ );
44845
45623
  results.failed.push({ name: client2.name, error: errorMessage });
44846
45624
  }
44847
45625
  }
44848
45626
  serverState.handleCancelClientForm();
44849
45627
  if (results.success.length > 0) {
44850
- console.log(`✅ Successfully created ${results.success.length} client(s): ${results.success.join(", ")}`);
45628
+ addClientLog(
45629
+ `✅ Successfully created ${results.success.length} client(s): ${results.success.join(", ")}`,
45630
+ "info"
45631
+ );
44851
45632
  }
44852
45633
  if (results.failed.length > 0) {
44853
- console.error(`❌ Failed to create ${results.failed.length} client(s):`, results.failed);
44854
- results.failed.forEach(({ name, error }) => {
44855
- console.error(` - ${name}: ${error}`);
44856
- });
45634
+ addClientLog(
45635
+ `❌ Failed to create ${results.failed.length} client(s): ${results.failed.map(({ name, error }) => `${name}: ${error}`).join(", ")}`,
45636
+ "error"
45637
+ );
44857
45638
  }
44858
45639
  return results;
44859
45640
  },
44860
- [handleAddServer, serverState]
45641
+ [handleAddServer, serverState, addClientLog]
44861
45642
  );
44862
45643
  const handleEditClient = reactExports.useCallback(
44863
45644
  (serverName) => {
@@ -44886,6 +45667,13 @@ const App = () => {
44886
45667
  configState.updateClaudeApiKey(newApiKey);
44887
45668
  updateApiKey(newApiKey);
44888
45669
  };
45670
+ const handleConnectServer = reactExports.useCallback(
45671
+ async (serverName) => {
45672
+ await connectionState.connectServer(serverName);
45673
+ mcpOperations.listTools(connectionState.mcpAgent, serverName);
45674
+ },
45675
+ [connectionState, mcpOperations]
45676
+ );
44889
45677
  const makeRequest = reactExports.useCallback(
44890
45678
  async (request) => {
44891
45679
  return await mcpOperations.makeRequest(
@@ -44935,10 +45723,10 @@ const App = () => {
44935
45723
  }, [mcpOperations.roots]);
44936
45724
  reactExports.useEffect(() => {
44937
45725
  const restoreAgentWithoutConnecting = async () => {
45726
+ if (window.location.pathname.startsWith("/oauth/callback")) {
45727
+ return;
45728
+ }
44938
45729
  if (Object.keys(serverState.serverConfigs).length > 0 && !connectionState.mcpAgent) {
44939
- console.log(
44940
- "🔄 Restoring agent with saved server configs (no auto-connect)..."
44941
- );
44942
45730
  try {
44943
45731
  await connectionState.createAgentWithoutConnecting(
44944
45732
  serverState.serverConfigs,
@@ -44950,24 +45738,26 @@ const App = () => {
44950
45738
  onPendingRequest,
44951
45739
  getRootsCallback
44952
45740
  );
44953
- console.log("✅ Successfully restored agent with server configs");
44954
45741
  } catch (error) {
44955
- console.error("❌ Failed to restore agent:", error);
45742
+ addClientLog(
45743
+ `❌ Failed to restore agent: ${error instanceof Error ? error.message : String(error)}`,
45744
+ "error"
45745
+ );
44956
45746
  }
44957
45747
  }
44958
45748
  };
44959
45749
  restoreAgentWithoutConnecting();
44960
45750
  }, [
44961
45751
  serverState.serverConfigs,
44962
- connectionState.mcpAgent,
44963
- connectionState.createAgentWithoutConnecting,
45752
+ connectionState,
44964
45753
  configState.config,
44965
45754
  configState.bearerToken,
44966
45755
  configState.headerName,
44967
45756
  configState.claudeApiKey,
44968
45757
  onStdErrNotification,
44969
45758
  onPendingRequest,
44970
- getRootsCallback
45759
+ getRootsCallback,
45760
+ addClientLog
44971
45761
  ]);
44972
45762
  reactExports.useEffect(() => {
44973
45763
  const currentConfig = serverState.serverConfigs[serverState.selectedServerName];
@@ -45018,24 +45808,19 @@ const App = () => {
45018
45808
  }
45019
45809
  }
45020
45810
  const finalServerName = existingServerName || serverName;
45021
- console.log(
45022
- `🔐 OAuth connecting to: ${serverUrl} as server "${finalServerName}"`
45023
- );
45024
45811
  const serverConfig = {
45025
45812
  transportType: "sse",
45026
45813
  url: new URL(serverUrl)
45027
45814
  };
45028
45815
  try {
45029
- await handleAddServer(finalServerName, serverConfig);
45030
- serverState.setSelectedServerName(finalServerName);
45031
- console.log("🔌 Auto-connecting after OAuth success...");
45032
- await connectionState.connectServer(finalServerName);
45033
- console.log("✅ Auto-connected successfully after OAuth");
45816
+ await handleAddServer(finalServerName, serverConfig, {
45817
+ autoConnect: true
45818
+ });
45034
45819
  } catch (error) {
45035
45820
  console.error("Failed to connect OAuth server:", error);
45036
45821
  }
45037
45822
  },
45038
- [serverState, handleAddServer, connectionState.connectServer]
45823
+ [serverState, handleAddServer]
45039
45824
  );
45040
45825
  const onOAuthDebugConnect = reactExports.useCallback(
45041
45826
  ({
@@ -45083,7 +45868,7 @@ const App = () => {
45083
45868
  }, []);
45084
45869
  if (window.location.pathname === "/oauth/callback") {
45085
45870
  const OAuthCallback = React.lazy(
45086
- () => __vitePreload(() => import("./OAuthCallback-DkLMDxkx.js"), true ? __vite__mapDeps([0,1]) : void 0)
45871
+ () => __vitePreload(() => import("./OAuthCallback-mxRvi54D.js"), true ? __vite__mapDeps([0,1]) : void 0)
45087
45872
  );
45088
45873
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45089
45874
  reactExports.Suspense,
@@ -45098,7 +45883,7 @@ const App = () => {
45098
45883
  }
45099
45884
  if (window.location.pathname === "/oauth/callback/debug") {
45100
45885
  const OAuthDebugCallback = React.lazy(
45101
- () => __vitePreload(() => import("./OAuthDebugCallback-DaNmVTKt.js"), true ? __vite__mapDeps([2,1]) : void 0)
45886
+ () => __vitePreload(() => import("./OAuthDebugCallback-CjHmkokp.js"), true ? __vite__mapDeps([2,1]) : void 0)
45102
45887
  );
45103
45888
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45104
45889
  reactExports.Suspense,
@@ -45381,7 +46166,7 @@ const App = () => {
45381
46166
  selectedServerName: serverState.selectedServerName,
45382
46167
  onServerSelect: serverState.setSelectedServerName,
45383
46168
  onRemoveServer: handleRemoveServer,
45384
- onConnectServer: connectionState.connectServer,
46169
+ onConnectServer: handleConnectServer,
45385
46170
  onDisconnectServer: connectionState.disconnectServer,
45386
46171
  onCreateClient: serverState.handleCreateClient,
45387
46172
  onEditClient: handleEditClient,
@@ -45407,7 +46192,9 @@ const App = () => {
45407
46192
  {
45408
46193
  requestHistory,
45409
46194
  toolResult: mcpOperations.toolResult,
45410
- onClearHistory: mcpOperations.clearRequestHistory
46195
+ clientLogs: mcpOperations.getClientLogs(),
46196
+ onClearHistory: mcpOperations.clearRequestHistory,
46197
+ onClearLogs: mcpOperations.clearClientLogs
45411
46198
  }
45412
46199
  )
45413
46200
  ] })