@mcpjam/inspector 0.2.4 → 0.3.0

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-CdxuZKBm.js","assets/oauthUtils-DTcoXpSP.js","assets/OAuthDebugCallback-BJaIMNT8.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,
@@ -18288,77 +18372,99 @@ const RequestSection = ({ title: title2, data: data2 }) => /* @__PURE__ */ jsxRu
18288
18372
  )
18289
18373
  ] });
18290
18374
  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 }) });
18375
+ const formatRequestCount = (count2) => {
18376
+ return `${count2} request${count2 !== 1 ? "s" : ""}`;
18377
+ };
18378
+ const ClearHistoryButton = ({ onClick }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
18379
+ "button",
18380
+ {
18381
+ onClick,
18382
+ className: "p-2 rounded-lg hover:bg-destructive/10 hover:text-destructive transition-all duration-200 group",
18383
+ title: "Clear all activity",
18384
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-4 h-4 text-muted-foreground group-hover:text-destructive" })
18385
+ }
18386
+ );
18387
+ 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) });
18388
+ const CollapseToggleButton = ({ onClick }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
18389
+ "button",
18390
+ {
18391
+ onClick,
18392
+ className: "p-2 rounded-lg hover:bg-accent/50 transition-all duration-200",
18393
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-muted-foreground hover:text-foreground" })
18394
+ }
18395
+ );
18396
+ const ActivityHeader = ({
18397
+ requestHistory,
18398
+ onClearHistory,
18399
+ onToggleCollapse
18400
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18401
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-bold text-foreground flex items-center space-x-2", children: [
18402
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-5 h-5 text-primary" }),
18403
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "All Activity" })
18404
+ ] }),
18405
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
18406
+ requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
18407
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RequestCountBadge, { count: requestHistory.length }),
18408
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ClearHistoryButton, { onClick: onClearHistory })
18409
+ ] }),
18410
+ onToggleCollapse && /* @__PURE__ */ jsxRuntimeExports.jsx(CollapseToggleButton, { onClick: onToggleCollapse })
18411
+ ] })
18412
+ ] });
18413
+ const CompactHeader = ({
18414
+ requestHistory,
18415
+ onClearHistory
18416
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18417
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RequestCountBadge, { count: requestHistory.length }),
18418
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ClearHistoryButton, { onClick: onClearHistory })
18419
+ ] });
18420
+ const EmptyState$1 = () => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
18421
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-12 h-12 text-muted-foreground/40 mb-4" }),
18422
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground text-lg font-medium mb-2", children: "No activity yet" }),
18423
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground/60 text-sm", children: "MCP requests and responses will appear here" })
18424
+ ] });
18425
+ const RequestHistoryList = ({
18426
+ requestHistory
18427
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-4", children: requestHistory.slice().reverse().map((request, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
18428
+ RequestHistoryItem,
18429
+ {
18430
+ request,
18431
+ index: index2,
18432
+ totalRequests: requestHistory.length
18433
+ },
18434
+ index2
18435
+ )) });
18291
18436
  const ActivityTab = ({
18292
18437
  requestHistory,
18293
18438
  onClearHistory,
18294
18439
  onToggleCollapse,
18295
18440
  showHeader = true
18296
18441
  }) => {
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",
18442
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18443
+ "div",
18444
+ {
18445
+ className: `flex-1 overflow-y-auto ${showHeader ? "p-6 border-r border-border/20" : ""}`,
18446
+ children: [
18447
+ showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx(
18448
+ ActivityHeader,
18343
18449
  {
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" })
18450
+ requestHistory,
18451
+ onClearHistory,
18452
+ onToggleCollapse
18348
18453
  }
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
- ] });
18454
+ ),
18455
+ requestHistory.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyState$1, {}) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
18456
+ !showHeader && requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
18457
+ CompactHeader,
18458
+ {
18459
+ requestHistory,
18460
+ onClearHistory
18461
+ }
18462
+ ),
18463
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RequestHistoryList, { requestHistory })
18464
+ ] })
18465
+ ]
18466
+ }
18467
+ );
18362
18468
  };
18363
18469
  const ToolResult = ({ toolResult }) => {
18364
18470
  if (!toolResult) return null;
@@ -18435,21 +18541,139 @@ const ResultsTab = ({ toolResult, onToggleCollapse, showHeader = true }) => {
18435
18541
  ] }) : /* @__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
18542
  ] });
18437
18543
  };
18544
+ const ClientLogsTab = ({
18545
+ clientLogs,
18546
+ onClearLogs,
18547
+ showHeader = true
18548
+ }) => {
18549
+ const reversedClientLogs = [...clientLogs].reverse();
18550
+ const formatTimestamp = (timestamp) => {
18551
+ const date = new Date(timestamp);
18552
+ return date.toLocaleTimeString("en-US", {
18553
+ hour12: true,
18554
+ hour: "2-digit",
18555
+ minute: "2-digit",
18556
+ second: "2-digit"
18557
+ });
18558
+ };
18559
+ const getLogLevelConfig = (level) => {
18560
+ switch (level) {
18561
+ case "error":
18562
+ return {
18563
+ icon: CircleAlert,
18564
+ bgColor: "bg-red-50 dark:bg-red-950/20",
18565
+ borderColor: "border-red-200 dark:border-red-800/50",
18566
+ textColor: "text-red-800 dark:text-red-300",
18567
+ iconColor: "text-red-500",
18568
+ label: "ERROR"
18569
+ };
18570
+ case "warn":
18571
+ return {
18572
+ icon: TriangleAlert,
18573
+ bgColor: "bg-yellow-50 dark:bg-yellow-950/20",
18574
+ borderColor: "border-yellow-200 dark:border-yellow-800/50",
18575
+ textColor: "text-yellow-800 dark:text-yellow-300",
18576
+ iconColor: "text-yellow-500",
18577
+ label: "WARN"
18578
+ };
18579
+ case "debug":
18580
+ return {
18581
+ icon: Bug,
18582
+ bgColor: "bg-gray-50 dark:bg-gray-950/20",
18583
+ borderColor: "border-gray-200 dark:border-gray-800/50",
18584
+ textColor: "text-gray-800 dark:text-gray-300",
18585
+ iconColor: "text-gray-500",
18586
+ label: "DEBUG"
18587
+ };
18588
+ case "info":
18589
+ default:
18590
+ return {
18591
+ icon: Info,
18592
+ bgColor: "bg-blue-50 dark:bg-blue-950/20",
18593
+ borderColor: "border-blue-200 dark:border-blue-800/50",
18594
+ textColor: "text-blue-800 dark:text-blue-300",
18595
+ iconColor: "text-blue-500",
18596
+ label: "INFO"
18597
+ };
18598
+ }
18599
+ };
18600
+ const LogEntry = ({ log }) => {
18601
+ const config = getLogLevelConfig(log.level);
18602
+ const IconComponent = config.icon;
18603
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18604
+ "div",
18605
+ {
18606
+ className: `flex items-start space-x-3 p-3 rounded-lg border ${config.bgColor} ${config.borderColor} hover:shadow-sm transition-all duration-200`,
18607
+ children: [
18608
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-shrink-0 mt-0.5 ${config.iconColor}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconComponent, { className: "w-4 h-4" }) }),
18609
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
18610
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mb-1", children: [
18611
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
18612
+ "span",
18613
+ {
18614
+ className: `text-xs font-mono font-semibold px-2 py-0.5 rounded ${config.textColor} ${config.bgColor}`,
18615
+ children: config.label
18616
+ }
18617
+ ),
18618
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-muted-foreground font-mono", children: formatTimestamp(log.timestamp) })
18619
+ ] }),
18620
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-sm ${config.textColor} font-mono break-words`, children: log.message })
18621
+ ] })
18622
+ ]
18623
+ }
18624
+ );
18625
+ };
18626
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col", children: [
18627
+ !showHeader && clientLogs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
18628
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-muted-foreground bg-muted/50 px-3 py-1 rounded-full", children: [
18629
+ clientLogs.length,
18630
+ " log",
18631
+ clientLogs.length !== 1 ? "s" : ""
18632
+ ] }),
18633
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
18634
+ "button",
18635
+ {
18636
+ onClick: onClearLogs,
18637
+ className: "p-2 rounded-lg hover:bg-destructive/10 hover:text-destructive transition-all duration-200 group",
18638
+ title: "Clear all activity",
18639
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-4 h-4 text-muted-foreground group-hover:text-destructive" })
18640
+ }
18641
+ )
18642
+ ] }),
18643
+ /* @__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: [
18644
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Bug, { className: "w-12 h-12 text-muted-foreground/50 mb-4" }),
18645
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium text-muted-foreground mb-2", children: "No logs yet" }),
18646
+ /* @__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." })
18647
+ ] }) : /* @__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}`)) }) })
18648
+ ] });
18649
+ };
18438
18650
  const TabbedHistoryPanel = ({
18439
18651
  requestHistory,
18440
18652
  toolResult,
18653
+ clientLogs,
18441
18654
  onClearHistory,
18655
+ onClearLogs,
18442
18656
  onToggleCollapse
18443
18657
  }) => {
18444
18658
  const [activeTab, setActiveTab] = reactExports.useState("activity");
18445
18659
  const [isToolResultError, setIsToolResultError] = reactExports.useState(false);
18446
18660
  reactExports.useEffect(() => {
18447
18661
  if (toolResult) {
18448
- console.log("toolResult", toolResult);
18449
18662
  setIsToolResultError(toolResult.isError === true);
18450
18663
  setActiveTab("results");
18451
18664
  }
18452
18665
  }, [toolResult]);
18666
+ reactExports.useEffect(() => {
18667
+ if (clientLogs.length > 0) {
18668
+ const isLastLogError = clientLogs[clientLogs.length - 1].level === "error";
18669
+ const isLastLogToolCall = clientLogs[clientLogs.length - 1].message.includes(
18670
+ "Error calling tool"
18671
+ );
18672
+ if (isLastLogError && !isLastLogToolCall) {
18673
+ setActiveTab("logs");
18674
+ }
18675
+ }
18676
+ }, [clientLogs]);
18453
18677
  const renderActivityTabButton = () => {
18454
18678
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18455
18679
  "button",
@@ -18466,7 +18690,6 @@ const TabbedHistoryPanel = ({
18466
18690
  );
18467
18691
  };
18468
18692
  const renderResultsTabButton = () => {
18469
- console.log("isToolResultError", isToolResultError);
18470
18693
  const renderCircleIndicator = () => {
18471
18694
  if (toolResult && !isToolResultError) {
18472
18695
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" });
@@ -18490,6 +18713,21 @@ const TabbedHistoryPanel = ({
18490
18713
  "results"
18491
18714
  );
18492
18715
  };
18716
+ const renderLogsTabButton = () => {
18717
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18718
+ "button",
18719
+ {
18720
+ onClick: () => setActiveTab("logs"),
18721
+ 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"}`,
18722
+ children: [
18723
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Bug, { className: "w-4 h-4" }),
18724
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: "Logs" }),
18725
+ clientLogs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 py-1 text-xs bg-primary/10 text-primary rounded-full", children: clientLogs.length })
18726
+ ]
18727
+ },
18728
+ "logs"
18729
+ );
18730
+ };
18493
18731
  const renderTabContent = () => {
18494
18732
  switch (activeTab) {
18495
18733
  case "activity":
@@ -18503,6 +18741,15 @@ const TabbedHistoryPanel = ({
18503
18741
  ) });
18504
18742
  case "results":
18505
18743
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full overflow-y-auto p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResultsTab, { toolResult, showHeader: false }) });
18744
+ case "logs":
18745
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full overflow-y-auto p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
18746
+ ClientLogsTab,
18747
+ {
18748
+ clientLogs,
18749
+ onClearLogs,
18750
+ showHeader: false
18751
+ }
18752
+ ) });
18506
18753
  default:
18507
18754
  return null;
18508
18755
  }
@@ -18511,7 +18758,8 @@ const TabbedHistoryPanel = ({
18511
18758
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between border-b border-border/20 px-6 py-3", children: [
18512
18759
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-1", children: [
18513
18760
  renderActivityTabButton(),
18514
- renderResultsTabButton()
18761
+ renderResultsTabButton(),
18762
+ renderLogsTabButton()
18515
18763
  ] }),
18516
18764
  /* @__PURE__ */ jsxRuntimeExports.jsx(
18517
18765
  "button",
@@ -18528,7 +18776,9 @@ const TabbedHistoryPanel = ({
18528
18776
  const HistoryAndNotifications = ({
18529
18777
  requestHistory,
18530
18778
  toolResult,
18531
- onClearHistory
18779
+ clientLogs,
18780
+ onClearHistory,
18781
+ onClearLogs
18532
18782
  }) => {
18533
18783
  const [isHistoryCollapsed, setIsHistoryCollapsed] = reactExports.useState(true);
18534
18784
  const {
@@ -18545,6 +18795,15 @@ const HistoryAndNotifications = ({
18545
18795
  setIsHistoryCollapsed(false);
18546
18796
  }
18547
18797
  }, [toolResult, resetHeight]);
18798
+ reactExports.useEffect(() => {
18799
+ if (clientLogs.length > 0) {
18800
+ const isLastError = clientLogs[clientLogs.length - 1].level === "error";
18801
+ if (isLastError) {
18802
+ resetHeight();
18803
+ setIsHistoryCollapsed(false);
18804
+ }
18805
+ }
18806
+ }, [clientLogs, resetHeight]);
18548
18807
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
18549
18808
  "div",
18550
18809
  {
@@ -18565,7 +18824,9 @@ const HistoryAndNotifications = ({
18565
18824
  {
18566
18825
  requestHistory,
18567
18826
  toolResult,
18827
+ clientLogs,
18568
18828
  onClearHistory,
18829
+ onClearLogs,
18569
18830
  onToggleCollapse: toggleCollapse
18570
18831
  }
18571
18832
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -18577,6 +18838,7 @@ const HistoryAndNotifications = ({
18577
18838
  /* @__PURE__ */ jsxRuntimeExports.jsx(History, { className: "w-5 h-5" }),
18578
18839
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: "History & Results" }),
18579
18840
  requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 py-1 text-xs bg-primary/10 text-primary rounded-full", children: requestHistory.length }),
18841
+ 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
18842
  /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 rotate-180" })
18581
18843
  ] })
18582
18844
  }
@@ -26690,10 +26952,14 @@ const ToolRunCard = ({
26690
26952
  setParams(loadedRequest.parameters);
26691
26953
  setParamsInitialized(true);
26692
26954
  setCurrentRequestId(loadedRequest.id);
26693
- } else if (selectedTool && !paramsInitialized) {
26694
- setParams(initializeParams(selectedTool));
26695
- setParamsInitialized(true);
26696
- setCurrentRequestId(null);
26955
+ } else if (selectedTool) {
26956
+ if (!paramsInitialized) {
26957
+ setParams(initializeParams(selectedTool));
26958
+ setParamsInitialized(true);
26959
+ setCurrentRequestId(null);
26960
+ } else if (!loadedRequest) {
26961
+ setCurrentRequestId(null);
26962
+ }
26697
26963
  }
26698
26964
  }, [selectedTool, loadedRequest, paramsInitialized]);
26699
26965
  const handleParamChange = (key, value) => {
@@ -26971,7 +27237,7 @@ const ToolsTab = ({
26971
27237
  variant: "ghost",
26972
27238
  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
27239
  title: "Duplicate request",
26974
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "w-3 h-3" })
27240
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyPlus, { className: "w-3 h-3" })
26975
27241
  }
26976
27242
  ),
26977
27243
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -28707,7 +28973,7 @@ var ItemText = SelectItemText;
28707
28973
  var ItemIndicator = SelectItemIndicator;
28708
28974
  var ScrollUpButton = SelectScrollUpButton$1;
28709
28975
  var ScrollDownButton = SelectScrollDownButton$1;
28710
- var Separator = SelectSeparator$1;
28976
+ var Separator$1 = SelectSeparator$1;
28711
28977
  const Select = Root2;
28712
28978
  const SelectValue = Value;
28713
28979
  const SelectTrigger = reactExports.forwardRef(({ className, children, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -28806,14 +29072,14 @@ const SelectItem = reactExports.forwardRef(({ className, children, ...props }, r
28806
29072
  ));
28807
29073
  SelectItem.displayName = Item.displayName;
28808
29074
  const SelectSeparator = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
28809
- Separator,
29075
+ Separator$1,
28810
29076
  {
28811
29077
  ref: ref2,
28812
29078
  className: cn("-mx-1 my-1 h-px bg-muted", className),
28813
29079
  ...props
28814
29080
  }
28815
29081
  ));
28816
- SelectSeparator.displayName = Separator.displayName;
29082
+ SelectSeparator.displayName = Separator$1.displayName;
28817
29083
  const useTheme = () => {
28818
29084
  const [theme, setTheme] = reactExports.useState(() => {
28819
29085
  const savedTheme = localStorage.getItem("theme");
@@ -28853,7 +29119,7 @@ const useTheme = () => {
28853
29119
  [theme, setThemeWithSideEffect]
28854
29120
  );
28855
29121
  };
28856
- const version$1 = "0.2.4";
29122
+ const version$1 = "0.3.0";
28857
29123
  var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
28858
29124
  createPopperScope
28859
29125
  ]);
@@ -29389,22 +29655,10 @@ const Sidebar = ({
29389
29655
  return "text-gray-500 dark:text-gray-400";
29390
29656
  }
29391
29657
  };
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
- }
29658
+ const shouldDisableConnection = () => {
29401
29659
  return false;
29402
29660
  };
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
- }
29661
+ const getConnectTooltipMessage = () => {
29408
29662
  return "Connect to this server";
29409
29663
  };
29410
29664
  const getConnectionDisplayText = (connection) => {
@@ -29520,11 +29774,11 @@ const Sidebar = ({
29520
29774
  },
29521
29775
  size: "sm",
29522
29776
  className: "h-6 text-xs px-2",
29523
- disabled: shouldDisableConnection(connection),
29777
+ disabled: shouldDisableConnection(),
29524
29778
  children: "Connect"
29525
29779
  }
29526
29780
  ) }) }),
29527
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: getConnectTooltipMessage(connection) })
29781
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: getConnectTooltipMessage() })
29528
29782
  ] });
29529
29783
  };
29530
29784
  const renderConnectionItem = (connection) => /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -30943,6 +31197,95 @@ const ConnectionSection = ({
30943
31197
  )
30944
31198
  ] });
30945
31199
  };
31200
+ const Card = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31201
+ "div",
31202
+ {
31203
+ ref: ref2,
31204
+ className: cn(
31205
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
31206
+ className
31207
+ ),
31208
+ ...props
31209
+ }
31210
+ ));
31211
+ Card.displayName = "Card";
31212
+ const CardHeader = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31213
+ "div",
31214
+ {
31215
+ ref: ref2,
31216
+ className: cn("flex flex-col space-y-1.5 p-6", className),
31217
+ ...props
31218
+ }
31219
+ ));
31220
+ CardHeader.displayName = "CardHeader";
31221
+ const CardTitle = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31222
+ "h3",
31223
+ {
31224
+ ref: ref2,
31225
+ className: cn(
31226
+ "text-2xl font-semibold leading-none tracking-tight",
31227
+ className
31228
+ ),
31229
+ ...props
31230
+ }
31231
+ ));
31232
+ CardTitle.displayName = "CardTitle";
31233
+ const CardDescription = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31234
+ "p",
31235
+ {
31236
+ ref: ref2,
31237
+ className: cn("text-sm text-muted-foreground", className),
31238
+ ...props
31239
+ }
31240
+ ));
31241
+ CardDescription.displayName = "CardDescription";
31242
+ const CardContent = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: ref2, className: cn("p-6 pt-0", className), ...props }));
31243
+ CardContent.displayName = "CardContent";
31244
+ const CardFooter = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31245
+ "div",
31246
+ {
31247
+ ref: ref2,
31248
+ className: cn("flex items-center p-6 pt-0", className),
31249
+ ...props
31250
+ }
31251
+ ));
31252
+ CardFooter.displayName = "CardFooter";
31253
+ const Separator = reactExports.forwardRef(
31254
+ ({ className, orientation = "horizontal", decorative = true, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31255
+ "div",
31256
+ {
31257
+ ref: ref2,
31258
+ role: decorative ? "none" : "separator",
31259
+ "aria-orientation": orientation,
31260
+ className: cn(
31261
+ "shrink-0 bg-border",
31262
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
31263
+ className
31264
+ ),
31265
+ ...props
31266
+ }
31267
+ )
31268
+ );
31269
+ Separator.displayName = "Separator";
31270
+ const badgeVariants = cva(
31271
+ "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",
31272
+ {
31273
+ variants: {
31274
+ variant: {
31275
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
31276
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
31277
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
31278
+ outline: "text-foreground"
31279
+ }
31280
+ },
31281
+ defaultVariants: {
31282
+ variant: "default"
31283
+ }
31284
+ }
31285
+ );
31286
+ function Badge({ className, variant, ...props }) {
31287
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
31288
+ }
30946
31289
  const ClientFormSection = ({
30947
31290
  isCreating,
30948
31291
  editingClientName,
@@ -30962,16 +31305,30 @@ const ClientFormSection = ({
30962
31305
  onSaveMultiple
30963
31306
  }) => {
30964
31307
  const [argsString, setArgsString] = reactExports.useState("");
31308
+ const [sseUrlString, setSseUrlString] = reactExports.useState("");
30965
31309
  const [multipleClients, setMultipleClients] = reactExports.useState([]);
30966
31310
  const [isMultipleMode, setIsMultipleMode] = reactExports.useState(false);
31311
+ const [isManualConfigExpanded, setIsManualConfigExpanded] = reactExports.useState(false);
30967
31312
  const { toast: toast2 } = useToast();
30968
31313
  const [showImportDialog, setShowImportDialog] = reactExports.useState(false);
31314
+ const [nameError, setNameError] = reactExports.useState("");
30969
31315
  reactExports.useEffect(() => {
30970
- var _a2;
31316
+ var _a2, _b;
30971
31317
  if (clientFormConfig.transportType === "stdio" && "args" in clientFormConfig) {
30972
31318
  setArgsString(((_a2 = clientFormConfig.args) == null ? void 0 : _a2.join(" ")) || "");
31319
+ setSseUrlString("");
31320
+ } else if (clientFormConfig.transportType !== "stdio" && "url" in clientFormConfig) {
31321
+ setArgsString("");
31322
+ setSseUrlString(((_b = clientFormConfig.url) == null ? void 0 : _b.toString()) || "");
30973
31323
  }
30974
31324
  }, [clientFormConfig]);
31325
+ reactExports.useEffect(() => {
31326
+ if (clientFormName.trim()) {
31327
+ setNameError("");
31328
+ } else {
31329
+ setNameError("Client name is required");
31330
+ }
31331
+ }, [clientFormName]);
30975
31332
  const handleArgsChange = (newArgsString) => {
30976
31333
  setArgsString(newArgsString);
30977
31334
  if (clientFormConfig.transportType === "stdio") {
@@ -30981,16 +31338,20 @@ const ClientFormSection = ({
30981
31338
  });
30982
31339
  }
30983
31340
  };
31341
+ const handleSseUrlChange = (newSseUrlString) => {
31342
+ setSseUrlString(newSseUrlString);
31343
+ };
30984
31344
  const handleImportServers = (servers) => {
30985
- var _a2;
31345
+ var _a2, _b;
30986
31346
  if (servers.length > 1) {
30987
31347
  const clients = servers.map((server, index2) => {
30988
- var _a3;
31348
+ var _a3, _b2;
30989
31349
  return {
30990
31350
  id: `client-${Date.now()}-${index2}`,
30991
31351
  name: server.name,
30992
31352
  config: server.config,
30993
- argsString: server.config.transportType === "stdio" && "args" in server.config ? ((_a3 = server.config.args) == null ? void 0 : _a3.join(" ")) || "" : ""
31353
+ argsString: server.config.transportType === "stdio" && "args" in server.config ? ((_a3 = server.config.args) == null ? void 0 : _a3.join(" ")) || "" : "",
31354
+ sseUrlString: server.config.transportType !== "stdio" && "url" in server.config ? ((_b2 = server.config.url) == null ? void 0 : _b2.toString()) || "" : ""
30994
31355
  };
30995
31356
  });
30996
31357
  setMultipleClients(clients);
@@ -31007,6 +31368,10 @@ const ClientFormSection = ({
31007
31368
  }
31008
31369
  if (firstServer.config.transportType === "stdio" && "args" in firstServer.config) {
31009
31370
  setArgsString(((_a2 = firstServer.config.args) == null ? void 0 : _a2.join(" ")) || "");
31371
+ setSseUrlString("");
31372
+ } else if (firstServer.config.transportType !== "stdio" && "url" in firstServer.config) {
31373
+ setArgsString("");
31374
+ setSseUrlString(((_b = firstServer.config.url) == null ? void 0 : _b.toString()) || "");
31010
31375
  }
31011
31376
  toast2({
31012
31377
  title: "Configuration imported",
@@ -31025,7 +31390,9 @@ const ClientFormSection = ({
31025
31390
  );
31026
31391
  };
31027
31392
  const handleRemoveClient = (clientId) => {
31028
- setMultipleClients((prev) => prev.filter((client2) => client2.id !== clientId));
31393
+ setMultipleClients(
31394
+ (prev) => prev.filter((client2) => client2.id !== clientId)
31395
+ );
31029
31396
  };
31030
31397
  const handleAddClient = () => {
31031
31398
  const newClient = {
@@ -31037,12 +31404,34 @@ const ClientFormSection = ({
31037
31404
  args: ["@modelcontextprotocol/server-everything"],
31038
31405
  env: {}
31039
31406
  },
31040
- argsString: "@modelcontextprotocol/server-everything"
31407
+ argsString: "@modelcontextprotocol/server-everything",
31408
+ sseUrlString: ""
31041
31409
  };
31042
31410
  setMultipleClients((prev) => [...prev, newClient]);
31043
31411
  };
31412
+ const handleSingleSave = () => {
31413
+ let configToSave = { ...clientFormConfig };
31414
+ if (configToSave.transportType !== "stdio") {
31415
+ try {
31416
+ const url = new URL(sseUrlString);
31417
+ configToSave = {
31418
+ ...configToSave,
31419
+ url
31420
+ };
31421
+ } catch {
31422
+ toast2({
31423
+ title: "Invalid URL",
31424
+ description: "Please enter a valid URL for the client.",
31425
+ variant: "destructive"
31426
+ });
31427
+ return;
31428
+ }
31429
+ }
31430
+ onSave(configToSave);
31431
+ };
31044
31432
  const handleSaveAll = async () => {
31045
- const validClients = multipleClients.filter((client2) => client2.name.trim());
31433
+ if (!onSaveMultiple) return;
31434
+ const validClients = multipleClients.filter((c) => c.name.trim());
31046
31435
  if (validClients.length === 0) {
31047
31436
  toast2({
31048
31437
  title: "No valid clients",
@@ -31051,43 +31440,45 @@ const ClientFormSection = ({
31051
31440
  });
31052
31441
  return;
31053
31442
  }
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
- });
31443
+ const clientsToSave = validClients.map((client2) => {
31444
+ let configToSave = { ...client2.config };
31445
+ if (configToSave.transportType !== "stdio") {
31446
+ try {
31447
+ const url = new URL(client2.sseUrlString);
31448
+ configToSave = {
31449
+ ...configToSave,
31450
+ url
31451
+ };
31452
+ } catch {
31453
+ throw new Error(`Invalid URL for client "${client2.name}"`);
31082
31454
  }
31083
- } catch (error) {
31084
- console.error("Failed to create clients:", error);
31455
+ }
31456
+ return {
31457
+ name: client2.name,
31458
+ config: configToSave
31459
+ };
31460
+ });
31461
+ try {
31462
+ const result = await onSaveMultiple(clientsToSave);
31463
+ if (result.success.length > 0) {
31085
31464
  toast2({
31086
- title: "Creation failed",
31087
- description: `Failed to create clients: ${error instanceof Error ? error.message : String(error)}`,
31465
+ title: "Clients created successfully",
31466
+ description: `Successfully created ${result.success.length} client(s).`
31467
+ });
31468
+ }
31469
+ if (result.failed.length > 0) {
31470
+ toast2({
31471
+ title: "Some clients failed to create",
31472
+ description: `${result.failed.length} client(s) failed to create. Check the console for details.`,
31088
31473
  variant: "destructive"
31089
31474
  });
31090
31475
  }
31476
+ } catch (error) {
31477
+ toast2({
31478
+ title: "Error creating clients",
31479
+ description: error instanceof Error ? error.message : "An unexpected error occurred.",
31480
+ variant: "destructive"
31481
+ });
31091
31482
  }
31092
31483
  };
31093
31484
  const handleBackToSingle = () => {
@@ -31095,110 +31486,335 @@ const ClientFormSection = ({
31095
31486
  setMultipleClients([]);
31096
31487
  };
31097
31488
  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." })
31489
+ 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: [
31490
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31491
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31492
+ Button,
31493
+ {
31494
+ variant: "ghost",
31495
+ size: "sm",
31496
+ onClick: handleBackToSingle,
31497
+ className: "h-8 w-8 p-0",
31498
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, { className: "h-4 w-4" })
31499
+ }
31500
+ ),
31501
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
31502
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "Create Multiple Clients" }),
31503
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground mt-1", children: "Configure each imported server as a separate client" })
31504
+ ] }),
31505
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, { variant: "secondary", className: "ml-auto", children: [
31506
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Users, { className: "h-3 w-3 mr-1" }),
31507
+ multipleClients.length,
31508
+ " clients"
31509
+ ] })
31510
+ ] }),
31511
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {}),
31512
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-6", children: [
31513
+ multipleClients.map((client2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
31514
+ Card,
31515
+ {
31516
+ className: "border-2 border-border/50 hover:border-border transition-colors",
31517
+ children: [
31518
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "pb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
31519
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31520
+ /* @__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 }),
31521
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
31522
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardTitle, { className: "text-lg", children: [
31523
+ "Client ",
31524
+ index2 + 1
31525
+ ] }),
31526
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardDescription, { children: client2.name || "Unnamed client" })
31527
+ ] })
31528
+ ] }),
31529
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31530
+ Button,
31531
+ {
31532
+ variant: "ghost",
31533
+ size: "sm",
31534
+ onClick: () => handleRemoveClient(client2.id),
31535
+ className: "h-8 w-8 p-0 text-muted-foreground hover:text-destructive",
31536
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "h-4 w-4" })
31537
+ }
31538
+ )
31539
+ ] }) }),
31540
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "space-y-6", children: [
31541
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
31542
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31543
+ Label$1,
31544
+ {
31545
+ htmlFor: `client-name-${client2.id}`,
31546
+ className: "text-sm font-medium",
31547
+ children: "Client Name"
31548
+ }
31549
+ ),
31550
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31551
+ Input,
31552
+ {
31553
+ id: `client-name-${client2.id}`,
31554
+ value: client2.name,
31555
+ onChange: (e) => handleUpdateClient(client2.id, { name: e.target.value }),
31556
+ placeholder: "Enter a descriptive name for this client",
31557
+ className: "max-w-md"
31558
+ }
31559
+ )
31560
+ ] }),
31561
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
31562
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
31563
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "h-4 w-4 text-muted-foreground" }),
31564
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Connection Settings" })
31565
+ ] }),
31566
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-border/50 rounded-lg p-4 bg-muted/30", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31567
+ ConnectionSection,
31568
+ {
31569
+ connectionStatus: "disconnected",
31570
+ transportType: client2.config.transportType,
31571
+ setTransportType: (type2) => {
31572
+ let newConfig;
31573
+ let newArgsString = "";
31574
+ if (type2 === "stdio") {
31575
+ newConfig = {
31576
+ transportType: type2,
31577
+ command: "npx",
31578
+ args: ["@modelcontextprotocol/server-everything"],
31579
+ env: {}
31580
+ };
31581
+ newArgsString = "@modelcontextprotocol/server-everything";
31582
+ } else {
31583
+ newConfig = {
31584
+ transportType: type2,
31585
+ url: new URL("https://example.com")
31586
+ };
31587
+ }
31588
+ handleUpdateClient(client2.id, {
31589
+ config: newConfig,
31590
+ argsString: newArgsString,
31591
+ sseUrlString: newConfig.transportType !== "stdio" && "url" in newConfig && newConfig.url ? newConfig.url.toString() : ""
31592
+ });
31593
+ },
31594
+ command: client2.config.transportType === "stdio" && "command" in client2.config ? client2.config.command || "" : "",
31595
+ setCommand: (command) => {
31596
+ if (client2.config.transportType === "stdio") {
31597
+ handleUpdateClient(client2.id, {
31598
+ config: {
31599
+ ...client2.config,
31600
+ command
31601
+ }
31602
+ });
31603
+ }
31604
+ },
31605
+ args: client2.argsString,
31606
+ setArgs: (newArgsString) => {
31607
+ if (client2.config.transportType === "stdio") {
31608
+ handleUpdateClient(client2.id, {
31609
+ argsString: newArgsString,
31610
+ config: {
31611
+ ...client2.config,
31612
+ args: newArgsString.trim() ? newArgsString.split(/\s+/) : []
31613
+ }
31614
+ });
31615
+ }
31616
+ },
31617
+ sseUrl: client2.sseUrlString,
31618
+ setSseUrl: (url) => {
31619
+ handleUpdateClient(client2.id, { sseUrlString: url });
31620
+ },
31621
+ env: client2.config.transportType === "stdio" && "env" in client2.config ? client2.config.env || {} : {},
31622
+ setEnv: (env) => {
31623
+ if (client2.config.transportType === "stdio") {
31624
+ handleUpdateClient(client2.id, {
31625
+ config: {
31626
+ ...client2.config,
31627
+ env
31628
+ }
31629
+ });
31630
+ }
31631
+ },
31632
+ config,
31633
+ setConfig,
31634
+ bearerToken,
31635
+ setBearerToken,
31636
+ headerName,
31637
+ setHeaderName,
31638
+ onConnect: () => {
31639
+ },
31640
+ onDisconnect: () => {
31641
+ },
31642
+ stdErrNotifications: [],
31643
+ clearStdErrNotifications: () => {
31644
+ },
31645
+ logLevel: "debug",
31646
+ sendLogLevelRequest: async () => {
31647
+ },
31648
+ loggingSupported: false,
31649
+ hideActionButtons: true
31650
+ }
31651
+ ) })
31652
+ ] })
31653
+ ] })
31654
+ ]
31655
+ },
31656
+ client2.id
31657
+ )),
31658
+ /* @__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(
31659
+ Button,
31660
+ {
31661
+ variant: "ghost",
31662
+ onClick: handleAddClient,
31663
+ className: "w-full h-16 text-muted-foreground hover:text-foreground",
31664
+ children: [
31665
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "h-5 w-5 mr-2" }),
31666
+ "Add Another Client"
31667
+ ]
31668
+ }
31669
+ ) }) })
31102
31670
  ] }),
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
31671
+ /* @__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: [
31672
+ /* @__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: [
31673
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
31674
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Some clients need names" })
31675
+ ] }) }),
31676
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31677
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", onClick: onCancel, children: "Cancel" }),
31678
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
31679
+ Button,
31680
+ {
31681
+ onClick: handleSaveAll,
31682
+ disabled: multipleClients.filter((c) => c.name.trim()).length === 0,
31683
+ className: "min-w-[200px]",
31684
+ children: [
31685
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Save, { className: "h-4 w-4 mr-2" }),
31686
+ "Create ",
31687
+ multipleClients.filter((c) => c.name.trim()).length,
31688
+ " ",
31689
+ "Client(s)"
31690
+ ]
31691
+ }
31692
+ )
31693
+ ] })
31694
+ ] }) })
31695
+ ] }) });
31696
+ }
31697
+ 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: [
31698
+ isCreating && /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "border-2 border-primary/20 bg-gradient-to-r from-primary/5 to-primary/10", children: [
31699
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31700
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-2 bg-primary/10 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Upload, { className: "h-5 w-5 text-primary" }) }),
31701
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { className: "text-lg", children: "Quick Import" }) }),
31702
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, { variant: "secondary", className: "ml-auto", children: [
31703
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Sparkles, { className: "h-3 w-3 mr-1" }),
31704
+ "Recommended"
31705
+ ] })
31706
+ ] }) }),
31707
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { children: [
31708
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "Supports the same format used by Claude Desktop and Cursor." }),
31709
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
31710
+ Button,
31711
+ {
31712
+ onClick: () => setShowImportDialog(true),
31713
+ className: "w-full sm:w-auto",
31714
+ children: [
31715
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Upload, { className: "w-4 h-4 mr-2" }),
31716
+ "Import from Configuration File"
31717
+ ]
31718
+ }
31719
+ )
31720
+ ] })
31721
+ ] }),
31722
+ isCreating && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4", children: [
31723
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { className: "w-16" }),
31724
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium text-muted-foreground", children: "or" }),
31725
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { className: "w-16" })
31726
+ ] }) }),
31727
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "border-2 border-border/50", children: [
31728
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31729
+ CardHeader,
31730
+ {
31731
+ className: "cursor-pointer",
31732
+ onClick: () => setIsManualConfigExpanded(!isManualConfigExpanded),
31733
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
31734
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
31735
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-2 bg-muted rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "h-5 w-5 text-muted-foreground" }) }),
31736
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { className: "text-lg", children: isCreating ? "Manual Setup" : `Edit: ${editingClientName}` }) })
31109
31737
  ] }),
31110
31738
  /* @__PURE__ */ jsxRuntimeExports.jsx(
31111
31739
  Button,
31112
31740
  {
31113
- variant: "outline",
31741
+ variant: "ghost",
31114
31742
  size: "sm",
31115
- onClick: () => handleRemoveClient(client2.id),
31116
31743
  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"
31744
+ onClick: (e) => {
31745
+ e.stopPropagation();
31746
+ setIsManualConfigExpanded(!isManualConfigExpanded);
31747
+ },
31748
+ children: isManualConfigExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "h-4 w-4" })
31130
31749
  }
31131
31750
  )
31132
- ] }),
31133
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-border rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31751
+ ] })
31752
+ }
31753
+ ),
31754
+ isManualConfigExpanded && /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "space-y-6", children: [
31755
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
31756
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { htmlFor: "client-name", className: "text-sm font-medium", children: "Name" }),
31757
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31758
+ Input,
31759
+ {
31760
+ id: "client-name",
31761
+ value: clientFormName,
31762
+ onChange: (e) => setClientFormName(e.target.value),
31763
+ placeholder: "Enter client name",
31764
+ className: `max-w-md ${nameError ? "border-red-500 focus:border-red-500 focus:ring-red-500" : ""}`
31765
+ }
31766
+ ),
31767
+ nameError && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-red-500 flex items-center gap-1", children: [
31768
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-3 w-3" }),
31769
+ nameError
31770
+ ] })
31771
+ ] }),
31772
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
31773
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Connection" }),
31774
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-border/50 rounded-lg p-4 bg-muted/30", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31134
31775
  ConnectionSection,
31135
31776
  {
31136
31777
  connectionStatus: "disconnected",
31137
- transportType: client2.config.transportType,
31778
+ transportType: clientFormConfig.transportType,
31138
31779
  setTransportType: (type2) => {
31139
- let newConfig;
31140
- let newArgsString = "";
31141
31780
  if (type2 === "stdio") {
31142
- newConfig = {
31781
+ const newConfig = {
31143
31782
  transportType: type2,
31144
31783
  command: "npx",
31145
31784
  args: ["@modelcontextprotocol/server-everything"],
31146
31785
  env: {}
31147
31786
  };
31148
- newArgsString = "@modelcontextprotocol/server-everything";
31787
+ setClientFormConfig(newConfig);
31788
+ setArgsString(
31789
+ "@modelcontextprotocol/server-everything"
31790
+ );
31149
31791
  } else {
31150
- newConfig = {
31792
+ setClientFormConfig({
31151
31793
  transportType: type2,
31152
31794
  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
31795
  });
31796
+ setArgsString("");
31181
31797
  }
31182
31798
  },
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
- }
31799
+ command: clientFormConfig.transportType === "stdio" && "command" in clientFormConfig ? clientFormConfig.command || "" : "",
31800
+ setCommand: (command) => {
31801
+ if (clientFormConfig.transportType === "stdio") {
31802
+ setClientFormConfig({
31803
+ ...clientFormConfig,
31804
+ command
31191
31805
  });
31192
31806
  }
31193
31807
  },
31194
- env: client2.config.transportType === "stdio" && "env" in client2.config ? client2.config.env || {} : {},
31808
+ args: argsString,
31809
+ setArgs: handleArgsChange,
31810
+ sseUrl: sseUrlString,
31811
+ setSseUrl: handleSseUrlChange,
31812
+ env: clientFormConfig.transportType === "stdio" && "env" in clientFormConfig ? clientFormConfig.env || {} : {},
31195
31813
  setEnv: (env) => {
31196
- if (client2.config.transportType === "stdio") {
31197
- handleUpdateClient(client2.id, {
31198
- config: {
31199
- ...client2.config,
31200
- env
31201
- }
31814
+ if (clientFormConfig.transportType === "stdio") {
31815
+ setClientFormConfig({
31816
+ ...clientFormConfig,
31817
+ env
31202
31818
  });
31203
31819
  }
31204
31820
  },
@@ -31222,191 +31838,30 @@ const ClientFormSection = ({
31222
31838
  hideActionButtons: true
31223
31839
  }
31224
31840
  ) })
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
31841
  ] })
31275
31842
  ] })
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
31843
  ] }),
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,
31844
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-3 pt-4", children: [
31845
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
31846
+ Button,
31321
31847
  {
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
31848
+ onClick: handleSingleSave,
31849
+ disabled: !clientFormName.trim(),
31850
+ 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",
31851
+ children: [
31852
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CircleCheck, { className: "h-5 w-5 mr-2" }),
31853
+ isCreating ? "Create Client" : "Update Client"
31854
+ ]
31389
31855
  }
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
- ] })
31856
+ ),
31857
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31858
+ "button",
31859
+ {
31860
+ onClick: onCancel,
31861
+ className: "text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline",
31862
+ children: "Cancel"
31863
+ }
31864
+ )
31410
31865
  ] }),
31411
31866
  /* @__PURE__ */ jsxRuntimeExports.jsx(
31412
31867
  ConfigImportDialog,
@@ -31476,33 +31931,39 @@ const StarGitHubModal = ({
31476
31931
  const SERVER_CONFIGS_STORAGE_KEY = "mcpServerConfigs_v1";
31477
31932
  const SELECTED_SERVER_STORAGE_KEY = "selectedServerName_v1";
31478
31933
  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") {
31934
+ const serializable = Object.entries(configs).reduce(
31935
+ (acc, [name, config]) => {
31936
+ if ("url" in config && config.url) {
31497
31937
  acc[name] = {
31498
31938
  ...config,
31499
- url: new URL(config.url)
31939
+ url: config.url.toString()
31500
31940
  };
31501
31941
  } else {
31502
31942
  acc[name] = config;
31503
31943
  }
31504
31944
  return acc;
31505
- }, {});
31945
+ },
31946
+ {}
31947
+ );
31948
+ return JSON.stringify(serializable);
31949
+ };
31950
+ const deserializeServerConfigs = (serialized) => {
31951
+ try {
31952
+ const parsed = JSON.parse(serialized);
31953
+ return Object.entries(parsed).reduce(
31954
+ (acc, [name, config]) => {
31955
+ if ("url" in config && config.url && typeof config.url === "string") {
31956
+ acc[name] = {
31957
+ ...config,
31958
+ url: new URL(config.url)
31959
+ };
31960
+ } else {
31961
+ acc[name] = config;
31962
+ }
31963
+ return acc;
31964
+ },
31965
+ {}
31966
+ );
31506
31967
  } catch (error) {
31507
31968
  console.warn("Failed to deserialize server configs:", error);
31508
31969
  return {};
@@ -41933,7 +42394,7 @@ Anthropic.Models = Models2;
41933
42394
  Anthropic.Beta = Beta;
41934
42395
  const { HUMAN_PROMPT, AI_PROMPT } = Anthropic;
41935
42396
  const readline = {};
41936
- const version = "0.2.4";
42397
+ const version = "0.3.0";
41937
42398
  const packageJson = {
41938
42399
  version
41939
42400
  };
@@ -42932,7 +43393,7 @@ const mappedTools = (tools) => {
42932
43393
  });
42933
43394
  };
42934
43395
  class MCPJamClient extends Client {
42935
- constructor(serverConfig, config, addRequestHistory, bearerToken, headerName, onStdErrNotification, claudeApiKey, onPendingRequest, getRoots) {
43396
+ constructor(serverConfig, config, addRequestHistory, addClientLog, bearerToken, headerName, onStdErrNotification, claudeApiKey, onPendingRequest, getRoots) {
42936
43397
  super(
42937
43398
  { name: "mcpjam-inspector", version: packageJson.version },
42938
43399
  {
@@ -42960,11 +43421,16 @@ class MCPJamClient extends Client {
42960
43421
  __publicField(this, "onPendingRequest");
42961
43422
  __publicField(this, "getRoots");
42962
43423
  __publicField(this, "addRequestHistory");
43424
+ __publicField(this, "addClientLog");
42963
43425
  __publicField(this, "is401Error", (error) => {
42964
43426
  return error instanceof SseError && error.code === 401 || error instanceof Error && error.message.includes("401") || error instanceof Error && error.message.includes("Unauthorized");
42965
43427
  });
42966
43428
  __publicField(this, "handleAuthError", async (error) => {
42967
43429
  if (this.is401Error(error)) {
43430
+ this.addClientLog(
43431
+ "Authentication error detected, attempting OAuth flow",
43432
+ "warn"
43433
+ );
42968
43434
  if (this.serverConfig.transportType !== "stdio" && "url" in this.serverConfig && this.serverConfig.url) {
42969
43435
  const serverAuthProvider = new InspectorOAuthClientProvider(
42970
43436
  this.serverConfig.url.toString()
@@ -42972,6 +43438,11 @@ class MCPJamClient extends Client {
42972
43438
  const result = await auth(serverAuthProvider, {
42973
43439
  serverUrl: this.serverConfig.url.toString()
42974
43440
  });
43441
+ if (result === "AUTHORIZED") {
43442
+ this.addClientLog("OAuth authentication successful", "info");
43443
+ } else {
43444
+ this.addClientLog("OAuth authentication failed", "error");
43445
+ }
42975
43446
  return result === "AUTHORIZED";
42976
43447
  }
42977
43448
  }
@@ -42983,10 +43454,13 @@ class MCPJamClient extends Client {
42983
43454
  apiKey: newApiKey,
42984
43455
  dangerouslyAllowBrowser: true
42985
43456
  });
43457
+ this.addClientLog("Anthropic API key updated", "info");
42986
43458
  }
42987
43459
  });
42988
43460
  __publicField(this, "handleCompletion", async (ref2, argName, value, signal) => {
43461
+ var _a2;
42989
43462
  if (!this.completionsSupported) {
43463
+ this.addClientLog("Completions not supported by server", "debug");
42990
43464
  return [];
42991
43465
  }
42992
43466
  const request = {
@@ -43000,19 +43474,31 @@ class MCPJamClient extends Client {
43000
43474
  }
43001
43475
  };
43002
43476
  try {
43477
+ this.addClientLog(`Requesting completion for ${argName}`, "debug");
43003
43478
  const response = await this.makeRequest(request, CompleteResultSchema, {
43004
43479
  signal,
43005
43480
  suppressToast: true
43006
43481
  });
43482
+ const completionCount = ((_a2 = response == null ? void 0 : response.completion.values) == null ? void 0 : _a2.length) || 0;
43483
+ this.addClientLog(
43484
+ `Received ${completionCount} completion suggestions`,
43485
+ "debug"
43486
+ );
43007
43487
  return (response == null ? void 0 : response.completion.values) || [];
43008
43488
  } catch (e) {
43009
43489
  if (e instanceof McpError && e.code === ErrorCode.MethodNotFound) {
43010
43490
  this.completionsSupported = false;
43491
+ this.addClientLog(
43492
+ "Completions disabled - server does not support them",
43493
+ "warn"
43494
+ );
43011
43495
  return [];
43012
43496
  }
43497
+ const errorMessage = e instanceof Error ? e.message : String(e);
43498
+ this.addClientLog(`Completion request failed: ${errorMessage}`, "error");
43013
43499
  toast({
43014
43500
  title: "Error",
43015
- description: e instanceof Error ? e.message : String(e),
43501
+ description: errorMessage,
43016
43502
  variant: "destructive"
43017
43503
  });
43018
43504
  throw e;
@@ -43038,6 +43524,7 @@ class MCPJamClient extends Client {
43038
43524
  this.onPendingRequest = onPendingRequest;
43039
43525
  this.getRoots = getRoots;
43040
43526
  this.addRequestHistory = addRequestHistory;
43527
+ this.addClientLog = addClientLog;
43041
43528
  }
43042
43529
  async connectStdio() {
43043
43530
  var _a2;
@@ -43064,13 +43551,27 @@ class MCPJamClient extends Client {
43064
43551
  };
43065
43552
  this.mcpProxyServerUrl = serverUrl;
43066
43553
  try {
43554
+ const command = "command" in this.serverConfig ? this.serverConfig.command : "unknown";
43555
+ this.addClientLog(
43556
+ `Connecting to MCP server via stdio: ${command}`,
43557
+ "info"
43558
+ );
43067
43559
  this.clientTransport = new SSEClientTransport(
43068
43560
  serverUrl,
43069
43561
  transportOptions
43070
43562
  );
43071
43563
  await this.connect(this.clientTransport);
43072
43564
  this.connectionStatus = "connected";
43565
+ this.addClientLog(
43566
+ "Successfully connected to MCP server via stdio",
43567
+ "info"
43568
+ );
43073
43569
  } catch (error) {
43570
+ const errorMessage = error instanceof Error ? error.message : String(error);
43571
+ this.addClientLog(
43572
+ `Failed to connect to MCP server via stdio: ${errorMessage}`,
43573
+ "error"
43574
+ );
43074
43575
  console.error("Error connecting to MCP server:", error);
43075
43576
  this.connectionStatus = "error";
43076
43577
  throw error;
@@ -43097,9 +43598,19 @@ class MCPJamClient extends Client {
43097
43598
  transportOptions
43098
43599
  );
43099
43600
  this.mcpProxyServerUrl = serverUrl;
43601
+ this.addClientLog(
43602
+ `Connecting to MCP server via SSE: ${this.serverConfig.url}`,
43603
+ "info"
43604
+ );
43100
43605
  await this.connect(this.clientTransport);
43101
43606
  this.connectionStatus = "connected";
43607
+ this.addClientLog("Successfully connected to MCP server via SSE", "info");
43102
43608
  } catch (error) {
43609
+ const errorMessage = error instanceof Error ? error.message : String(error);
43610
+ this.addClientLog(
43611
+ `Failed to connect to MCP server via SSE: ${errorMessage}`,
43612
+ "error"
43613
+ );
43103
43614
  console.error("Error connecting to MCP server:", error);
43104
43615
  this.connectionStatus = "error";
43105
43616
  throw error;
@@ -43129,9 +43640,22 @@ class MCPJamClient extends Client {
43129
43640
  transportOptions
43130
43641
  );
43131
43642
  this.mcpProxyServerUrl = serverUrl;
43643
+ this.addClientLog(
43644
+ `Connecting to MCP server via Streamable HTTP: ${this.serverConfig.url}`,
43645
+ "info"
43646
+ );
43132
43647
  await this.connect(this.clientTransport);
43133
43648
  this.connectionStatus = "connected";
43649
+ this.addClientLog(
43650
+ "Successfully connected to MCP server via Streamable HTTP",
43651
+ "info"
43652
+ );
43134
43653
  } catch (error) {
43654
+ const errorMessage = error instanceof Error ? error.message : String(error);
43655
+ this.addClientLog(
43656
+ `Failed to connect to MCP server via Streamable HTTP: ${errorMessage}`,
43657
+ "error"
43658
+ );
43135
43659
  console.error("Error connecting to MCP server:", error);
43136
43660
  this.connectionStatus = "error";
43137
43661
  throw error;
@@ -43142,12 +43666,20 @@ class MCPJamClient extends Client {
43142
43666
  const proxyHealthUrl = new URL(
43143
43667
  `${getMCPProxyAddress(this.inspectorConfig)}/health`
43144
43668
  );
43669
+ this.addClientLog("Checking MCP proxy server health", "debug");
43145
43670
  const proxyHealthResponse = await fetch(proxyHealthUrl);
43146
43671
  const proxyHealth = await proxyHealthResponse.json();
43147
43672
  if ((proxyHealth == null ? void 0 : proxyHealth.status) !== "ok") {
43673
+ this.addClientLog("MCP Proxy Server is not healthy", "error");
43148
43674
  throw new Error("MCP Proxy Server is not healthy");
43149
43675
  }
43676
+ this.addClientLog("MCP proxy server health check passed", "debug");
43150
43677
  } catch (e) {
43678
+ const errorMessage = e instanceof Error ? e.message : String(e);
43679
+ this.addClientLog(
43680
+ `Failed to connect to MCP Proxy Server: ${errorMessage}`,
43681
+ "error"
43682
+ );
43151
43683
  console.error("Couldn't connect to MCP Proxy Server", e);
43152
43684
  throw e;
43153
43685
  }
@@ -43159,11 +43691,20 @@ class MCPJamClient extends Client {
43159
43691
  await this.checkProxyHealth();
43160
43692
  } catch {
43161
43693
  this.connectionStatus = "error-connecting-to-proxy";
43694
+ this.addClientLog("Failed to connect to proxy server", "error");
43162
43695
  return;
43163
43696
  }
43164
43697
  try {
43698
+ this.addClientLog(
43699
+ `Attempting to connect to MCP server (attempt ${retryCount + 1}/${MAX_RETRIES + 1})`,
43700
+ "info"
43701
+ );
43165
43702
  const headers = {};
43166
43703
  if (this.serverConfig.transportType !== "stdio" && "url" in this.serverConfig && this.serverConfig.url) {
43704
+ this.addClientLog(
43705
+ "Setting up OAuth authentication for HTTP transport",
43706
+ "debug"
43707
+ );
43167
43708
  const serverAuthProvider = new InspectorOAuthClientProvider(
43168
43709
  this.serverConfig.url.toString()
43169
43710
  );
@@ -43171,10 +43712,23 @@ class MCPJamClient extends Client {
43171
43712
  if (token) {
43172
43713
  const authHeaderName = this.headerName || "Authorization";
43173
43714
  headers[authHeaderName] = `Bearer ${token}`;
43715
+ this.addClientLog(
43716
+ "Bearer token configured for authentication",
43717
+ "debug"
43718
+ );
43719
+ } else {
43720
+ this.addClientLog(
43721
+ "No bearer token available for authentication",
43722
+ "warn"
43723
+ );
43174
43724
  }
43175
43725
  } else if (this.bearerToken) {
43176
43726
  const authHeaderName = this.headerName || "Authorization";
43177
43727
  headers[authHeaderName] = `Bearer ${this.bearerToken}`;
43728
+ this.addClientLog(
43729
+ "Bearer token configured for stdio transport",
43730
+ "debug"
43731
+ );
43178
43732
  }
43179
43733
  this.headers = { ...this.headers, ...headers };
43180
43734
  if (this.onStdErrNotification) {
@@ -43182,6 +43736,7 @@ class MCPJamClient extends Client {
43182
43736
  StdErrNotificationSchema,
43183
43737
  this.onStdErrNotification
43184
43738
  );
43739
+ this.addClientLog("StdErr notification handler configured", "debug");
43185
43740
  }
43186
43741
  try {
43187
43742
  switch (this.serverConfig.transportType) {
@@ -43196,7 +43751,10 @@ class MCPJamClient extends Client {
43196
43751
  break;
43197
43752
  }
43198
43753
  this.serverCapabilities = this.getServerCapabilities() ?? null;
43199
- console.log("capabilities", this.serverCapabilities);
43754
+ this.addClientLog(
43755
+ `Server capabilities retrieved: ${JSON.stringify(this.serverCapabilities)}`,
43756
+ "debug"
43757
+ );
43200
43758
  const initializeRequest = {
43201
43759
  method: "initialize"
43202
43760
  };
@@ -43205,7 +43763,13 @@ class MCPJamClient extends Client {
43205
43763
  serverInfo: this.getServerVersion(),
43206
43764
  instructions: this.getInstructions()
43207
43765
  });
43766
+ this.addClientLog("MCP client initialization completed", "info");
43208
43767
  } catch (error) {
43768
+ const errorMessage = error instanceof Error ? error.message : String(error);
43769
+ this.addClientLog(
43770
+ `Failed to connect to MCP Server via the MCP Inspector Proxy: ${errorMessage}`,
43771
+ "error"
43772
+ );
43209
43773
  console.error(
43210
43774
  `Failed to connect to MCP Server via the MCP Inspector Proxy: ${this.getMCPProxyServerUrl()}:`,
43211
43775
  error
@@ -43213,14 +43777,19 @@ class MCPJamClient extends Client {
43213
43777
  if (retryCount < MAX_RETRIES) {
43214
43778
  const shouldRetry = await this.handleAuthError(error);
43215
43779
  if (shouldRetry) {
43216
- console.log(
43217
- `Retrying connection (attempt ${retryCount + 1}/${MAX_RETRIES})`
43780
+ this.addClientLog(
43781
+ `Retrying connection (attempt ${retryCount + 1}/${MAX_RETRIES})`,
43782
+ "info"
43218
43783
  );
43219
43784
  return this.connectToServer(void 0, retryCount + 1);
43220
43785
  }
43221
43786
  }
43222
43787
  if (this.is401Error(error)) {
43223
43788
  this.connectionStatus = "error";
43789
+ this.addClientLog(
43790
+ "Authentication failed, connection terminated",
43791
+ "error"
43792
+ );
43224
43793
  return;
43225
43794
  }
43226
43795
  throw error;
@@ -43239,9 +43808,16 @@ class MCPJamClient extends Client {
43239
43808
  var _a3;
43240
43809
  return { roots: ((_a3 = this.getRoots) == null ? void 0 : _a3.call(this)) ?? [] };
43241
43810
  });
43811
+ this.addClientLog("Roots request handler configured", "debug");
43242
43812
  }
43243
43813
  this.connectionStatus = "connected";
43814
+ this.addClientLog(
43815
+ "MCP client connection established successfully",
43816
+ "info"
43817
+ );
43244
43818
  } catch (e) {
43819
+ const errorMessage = e instanceof Error ? e.message : String(e);
43820
+ this.addClientLog(`Connection failed: ${errorMessage}`, "error");
43245
43821
  console.error(e);
43246
43822
  this.connectionStatus = "error";
43247
43823
  }
@@ -43254,6 +43830,7 @@ class MCPJamClient extends Client {
43254
43830
  }
43255
43831
  async makeRequest(request, schema, options) {
43256
43832
  console.log("makeRequestTriggered");
43833
+ this.addClientLog(`Making MCP request: ${request.method}`, "debug");
43257
43834
  try {
43258
43835
  const abortController = new AbortController();
43259
43836
  const mcpRequestOptions = {
@@ -43264,14 +43841,20 @@ class MCPJamClient extends Client {
43264
43841
  };
43265
43842
  if (mcpRequestOptions.resetTimeoutOnProgress) {
43266
43843
  mcpRequestOptions.onprogress = (_params) => {
43844
+ this.addClientLog("Progress notification received", "debug");
43267
43845
  };
43268
43846
  }
43269
43847
  let response;
43270
43848
  try {
43271
43849
  response = await this.request(request, schema, mcpRequestOptions);
43850
+ this.addClientLog(`MCP request successful: ${request.method}`, "info");
43272
43851
  this.addRequestHistory(request, response);
43273
43852
  } catch (error) {
43274
43853
  const errorMessage = error instanceof Error ? error.message : String(error);
43854
+ this.addClientLog(
43855
+ `MCP request failed: ${request.method} - ${errorMessage}`,
43856
+ "error"
43857
+ );
43275
43858
  this.addRequestHistory(request, { error: errorMessage });
43276
43859
  throw error;
43277
43860
  }
@@ -43279,6 +43862,10 @@ class MCPJamClient extends Client {
43279
43862
  } catch (e) {
43280
43863
  if (!(options == null ? void 0 : options.suppressToast)) {
43281
43864
  const errorString = e.message ?? String(e);
43865
+ this.addClientLog(
43866
+ `Request error (toast shown): ${errorString}`,
43867
+ "error"
43868
+ );
43282
43869
  toast({
43283
43870
  title: "Error",
43284
43871
  description: errorString,
@@ -43289,10 +43876,13 @@ class MCPJamClient extends Client {
43289
43876
  }
43290
43877
  }
43291
43878
  async tools() {
43879
+ this.addClientLog("Listing available tools", "debug");
43292
43880
  const tools = await this.listTools();
43881
+ this.addClientLog(`Found ${tools.tools.length} tools`, "info");
43293
43882
  return tools;
43294
43883
  }
43295
43884
  async disconnect() {
43885
+ this.addClientLog("Disconnecting from MCP server", "info");
43296
43886
  await this.close();
43297
43887
  this.connectionStatus = "disconnected";
43298
43888
  if (this.serverConfig.transportType !== "stdio") {
@@ -43300,21 +43890,34 @@ class MCPJamClient extends Client {
43300
43890
  this.serverConfig.url.toString()
43301
43891
  );
43302
43892
  authProvider.clear();
43893
+ this.addClientLog("OAuth tokens cleared", "debug");
43303
43894
  }
43304
43895
  this.serverCapabilities = null;
43896
+ this.addClientLog("MCP client disconnected successfully", "info");
43305
43897
  }
43306
43898
  async setServerCapabilities(capabilities) {
43307
43899
  this.serverCapabilities = capabilities;
43900
+ this.addClientLog("Server capabilities updated", "debug");
43308
43901
  }
43309
43902
  async processQuery(query, tools, onUpdate, model = "claude-3-5-sonnet-latest") {
43310
43903
  if (!this.anthropic) {
43311
- throw new Error("Anthropic client not initialized");
43904
+ const errorMessage = "Anthropic client not initialized";
43905
+ this.addClientLog(errorMessage, "error");
43906
+ throw new Error(errorMessage);
43312
43907
  }
43908
+ this.addClientLog(
43909
+ `Processing query with ${tools.length} tools using model ${model}`,
43910
+ "info"
43911
+ );
43313
43912
  const context = this.initializeQueryContext(query, tools, model);
43314
43913
  const response = await this.makeInitialApiCall(context);
43315
43914
  return this.processIterations(response, context, onUpdate);
43316
43915
  }
43317
43916
  initializeQueryContext(query, tools, model) {
43917
+ this.addClientLog(
43918
+ `Initializing query context with ${tools.length} tools`,
43919
+ "debug"
43920
+ );
43318
43921
  return {
43319
43922
  messages: [{ role: "user", content: query }],
43320
43923
  finalText: [],
@@ -43324,6 +43927,7 @@ class MCPJamClient extends Client {
43324
43927
  };
43325
43928
  }
43326
43929
  async makeInitialApiCall(context) {
43930
+ this.addClientLog("Making initial API call to Anthropic", "debug");
43327
43931
  return this.anthropic.messages.create({
43328
43932
  model: context.model,
43329
43933
  max_tokens: 1e3,
@@ -43336,21 +43940,34 @@ class MCPJamClient extends Client {
43336
43940
  let iteration = 0;
43337
43941
  while (iteration < context.MAX_ITERATIONS) {
43338
43942
  iteration++;
43943
+ this.addClientLog(
43944
+ `Processing iteration ${iteration}/${context.MAX_ITERATIONS}`,
43945
+ "debug"
43946
+ );
43339
43947
  const iterationResult = await this.processIteration(response, context);
43340
43948
  this.sendIterationUpdate(iterationResult.content, onUpdate);
43341
43949
  if (!iterationResult.hasToolUse) {
43950
+ this.addClientLog("No tool use detected, ending iterations", "debug");
43342
43951
  break;
43343
43952
  }
43344
43953
  try {
43345
43954
  response = await this.makeFollowUpApiCall(context);
43346
43955
  } catch (error) {
43347
43956
  const errorMessage = `[API Error: ${error}]`;
43957
+ this.addClientLog(
43958
+ `API error in iteration ${iteration}: ${error}`,
43959
+ "error"
43960
+ );
43348
43961
  context.finalText.push(errorMessage);
43349
43962
  this.sendIterationUpdate(errorMessage, onUpdate);
43350
43963
  break;
43351
43964
  }
43352
43965
  }
43353
43966
  this.handleMaxIterationsWarning(iteration, context, onUpdate);
43967
+ this.addClientLog(
43968
+ `Query processing completed in ${iteration} iterations`,
43969
+ "info"
43970
+ );
43354
43971
  return context.finalText.join("\n");
43355
43972
  }
43356
43973
  async processIteration(response, context) {
@@ -43367,6 +43984,7 @@ class MCPJamClient extends Client {
43367
43984
  );
43368
43985
  } else if (content.type === "tool_use") {
43369
43986
  hasToolUse = true;
43987
+ this.addClientLog(`Tool use detected: ${content.name}`, "debug");
43370
43988
  await this.handleToolUse(
43371
43989
  content,
43372
43990
  iterationContent,
@@ -43391,12 +44009,18 @@ class MCPJamClient extends Client {
43391
44009
  iterationContent.push(toolMessage);
43392
44010
  context.finalText.push(toolMessage);
43393
44011
  try {
44012
+ this.addClientLog(`Executing tool: ${content.name}`, "debug");
43394
44013
  await this.executeToolAndUpdateMessages(
43395
44014
  content,
43396
44015
  context,
43397
44016
  assistantContent
43398
44017
  );
44018
+ this.addClientLog(`Tool execution successful: ${content.name}`, "debug");
43399
44019
  } catch (error) {
44020
+ this.addClientLog(
44021
+ `Tool execution failed: ${content.name} - ${error}`,
44022
+ "error"
44023
+ );
43400
44024
  this.handleToolError(
43401
44025
  error,
43402
44026
  content,
@@ -43454,6 +44078,7 @@ class MCPJamClient extends Client {
43454
44078
  });
43455
44079
  }
43456
44080
  async makeFollowUpApiCall(context) {
44081
+ this.addClientLog("Making follow-up API call to Anthropic", "debug");
43457
44082
  return this.anthropic.messages.create({
43458
44083
  model: context.model,
43459
44084
  max_tokens: 1e3,
@@ -43471,11 +44096,16 @@ class MCPJamClient extends Client {
43471
44096
  handleMaxIterationsWarning(iteration, context, onUpdate) {
43472
44097
  if (iteration >= context.MAX_ITERATIONS) {
43473
44098
  const warningMessage = `[Warning: Reached maximum iterations (${context.MAX_ITERATIONS}). Stopping to prevent excessive API usage.]`;
44099
+ this.addClientLog(
44100
+ `Maximum iterations reached (${context.MAX_ITERATIONS})`,
44101
+ "warn"
44102
+ );
43474
44103
  context.finalText.push(warningMessage);
43475
44104
  this.sendIterationUpdate(warningMessage, onUpdate);
43476
44105
  }
43477
44106
  }
43478
44107
  async chatLoop(tools) {
44108
+ this.addClientLog("Starting interactive chat loop", "info");
43479
44109
  const rl = readline.createInterface({
43480
44110
  input: process.stdin,
43481
44111
  output: process.stdout
@@ -43486,16 +44116,23 @@ class MCPJamClient extends Client {
43486
44116
  while (true) {
43487
44117
  const message = await rl.question("\nQuery: ");
43488
44118
  if (message.toLowerCase() === "quit") {
44119
+ this.addClientLog("Chat loop terminated by user", "info");
43489
44120
  break;
43490
44121
  }
44122
+ this.addClientLog(
44123
+ `Processing user query: ${message.substring(0, 50)}${message.length > 50 ? "..." : ""}`,
44124
+ "debug"
44125
+ );
43491
44126
  const response = await this.processQuery(message, tools);
43492
44127
  console.log("\n" + response);
43493
44128
  }
43494
44129
  } finally {
43495
44130
  rl.close();
44131
+ this.addClientLog("Chat loop interface closed", "debug");
43496
44132
  }
43497
44133
  }
43498
44134
  async cleanup() {
44135
+ this.addClientLog("Cleaning up MCP client", "info");
43499
44136
  await this.close();
43500
44137
  }
43501
44138
  }
@@ -43511,6 +44148,7 @@ class MCPJamAgent {
43511
44148
  __publicField(this, "onPendingRequest");
43512
44149
  __publicField(this, "getRoots");
43513
44150
  __publicField(this, "addRequestHistory");
44151
+ __publicField(this, "addClientLog");
43514
44152
  this.serverConfigs = options.servers;
43515
44153
  this.config = options.config || createDefaultConfig();
43516
44154
  this.bearerToken = options.bearerToken;
@@ -43520,6 +44158,7 @@ class MCPJamAgent {
43520
44158
  this.onPendingRequest = options.onPendingRequest;
43521
44159
  this.getRoots = options.getRoots;
43522
44160
  this.addRequestHistory = options.addRequestHistory;
44161
+ this.addClientLog = options.addClientLog;
43523
44162
  }
43524
44163
  // Add or update a server configuration
43525
44164
  addServer(name, config) {
@@ -43604,26 +44243,6 @@ class MCPJamAgent {
43604
44243
  if (existingClient && existingClient.connectionStatus === "connected") {
43605
44244
  return existingClient;
43606
44245
  }
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
44246
  if (existingClient && existingClient.connectionStatus === "disconnected") {
43628
44247
  try {
43629
44248
  await existingClient.connectToServer();
@@ -43639,6 +44258,8 @@ class MCPJamAgent {
43639
44258
  // config (second parameter)
43640
44259
  this.addRequestHistory,
43641
44260
  // addRequestHistory
44261
+ this.addClientLog,
44262
+ // addClientLog
43642
44263
  this.bearerToken,
43643
44264
  // bearerToken
43644
44265
  this.headerName,
@@ -43776,7 +44397,6 @@ class MCPJamAgent {
43776
44397
  ).length;
43777
44398
  if (errorCount > 0) return "error";
43778
44399
  if (connectedCount === connections.length) return "connected";
43779
- if (connectedCount > 0) return "partial";
43780
44400
  return "disconnected";
43781
44401
  }
43782
44402
  // Check if there are any connected remote servers (HTTP/SSE)
@@ -43799,12 +44419,8 @@ class MCPJamAgent {
43799
44419
  }
43800
44420
  return null;
43801
44421
  }
43802
- // Check if a server config is for a remote connection
43803
- isRemoteServer(config) {
43804
- return config.transportType !== "stdio";
43805
- }
43806
44422
  }
43807
- const useConnectionState = (addRequestHistory) => {
44423
+ const useConnectionState = (addRequestHistory, addClientLog) => {
43808
44424
  const [mcpAgent, setMcpAgent] = reactExports.useState(null);
43809
44425
  const [sidebarUpdateTrigger, setSidebarUpdateTrigger] = reactExports.useState(0);
43810
44426
  const forceUpdateSidebar = reactExports.useCallback(() => {
@@ -43825,7 +44441,8 @@ const useConnectionState = (addRequestHistory) => {
43825
44441
  onStdErrNotification,
43826
44442
  onPendingRequest,
43827
44443
  getRoots,
43828
- addRequestHistory
44444
+ addRequestHistory,
44445
+ addClientLog
43829
44446
  };
43830
44447
  const agent = new MCPJamAgent(options);
43831
44448
  try {
@@ -43838,7 +44455,7 @@ const useConnectionState = (addRequestHistory) => {
43838
44455
  throw error;
43839
44456
  }
43840
44457
  },
43841
- [addRequestHistory]
44458
+ [addRequestHistory, addClientLog]
43842
44459
  );
43843
44460
  const createAgentWithoutConnecting = reactExports.useCallback(
43844
44461
  async (serverConfigs, config, bearerToken, headerName, claudeApiKey, onStdErrNotification, onPendingRequest, getRoots) => {
@@ -43851,13 +44468,14 @@ const useConnectionState = (addRequestHistory) => {
43851
44468
  onStdErrNotification,
43852
44469
  onPendingRequest,
43853
44470
  getRoots,
43854
- addRequestHistory
44471
+ addRequestHistory,
44472
+ addClientLog
43855
44473
  };
43856
44474
  const agent = new MCPJamAgent(options);
43857
44475
  setMcpAgent(agent);
43858
44476
  return agent;
43859
44477
  },
43860
- [addRequestHistory]
44478
+ [addRequestHistory, addClientLog]
43861
44479
  );
43862
44480
  const addServer = reactExports.useCallback(
43863
44481
  async (name, serverConfig, config, bearerToken, headerName, claudeApiKey, onStdErrNotification, onPendingRequest, getRoots) => {
@@ -43873,7 +44491,8 @@ const useConnectionState = (addRequestHistory) => {
43873
44491
  onStdErrNotification,
43874
44492
  onPendingRequest,
43875
44493
  getRoots,
43876
- addRequestHistory
44494
+ addRequestHistory,
44495
+ addClientLog
43877
44496
  };
43878
44497
  const agent = new MCPJamAgent(options);
43879
44498
  try {
@@ -43907,7 +44526,7 @@ const useConnectionState = (addRequestHistory) => {
43907
44526
  }
43908
44527
  }
43909
44528
  },
43910
- [mcpAgent, forceUpdateSidebar, addRequestHistory]
44529
+ [mcpAgent, forceUpdateSidebar, addRequestHistory, addClientLog]
43911
44530
  );
43912
44531
  const removeServer = reactExports.useCallback(
43913
44532
  async (serverName) => {
@@ -44029,7 +44648,10 @@ const useMCPOperations = () => {
44029
44648
  const [stdErrNotifications, setStdErrNotifications] = reactExports.useState([]);
44030
44649
  const [roots, setRoots] = reactExports.useState([]);
44031
44650
  const [pendingSampleRequests, setPendingSampleRequests] = reactExports.useState([]);
44032
- const [requestHistory, setRequestHistory] = reactExports.useState([]);
44651
+ const [requestHistory, setRequestHistory] = reactExports.useState(
44652
+ []
44653
+ );
44654
+ const [clientLogs, setClientLogs] = reactExports.useState([]);
44033
44655
  const progressTokenRef = reactExports.useRef(0);
44034
44656
  const clearError = reactExports.useCallback((tabKey) => {
44035
44657
  setErrors((prev) => ({ ...prev, [tabKey]: null }));
@@ -44046,6 +44668,27 @@ const useMCPOperations = () => {
44046
44668
  },
44047
44669
  []
44048
44670
  );
44671
+ const getRequestHistory = reactExports.useCallback(() => {
44672
+ return requestHistory;
44673
+ }, [requestHistory]);
44674
+ const clearRequestHistory = reactExports.useCallback(() => {
44675
+ setRequestHistory([]);
44676
+ }, []);
44677
+ const addClientLog = reactExports.useCallback(
44678
+ (message, level) => {
44679
+ setClientLogs((prev) => [
44680
+ ...prev,
44681
+ { message, level, timestamp: (/* @__PURE__ */ new Date()).toISOString() }
44682
+ ]);
44683
+ },
44684
+ []
44685
+ );
44686
+ const clearClientLogs = reactExports.useCallback(() => {
44687
+ setClientLogs([]);
44688
+ }, []);
44689
+ const getClientLogs = reactExports.useCallback(() => {
44690
+ return clientLogs;
44691
+ }, [clientLogs]);
44049
44692
  const listResources = reactExports.useCallback(
44050
44693
  async (mcpAgent, selectedServerName) => {
44051
44694
  if (!mcpAgent) return;
@@ -44058,6 +44701,10 @@ const useMCPOperations = () => {
44058
44701
  );
44059
44702
  const endTime = performance.now();
44060
44703
  const latency = Math.round(endTime - startTime);
44704
+ addClientLog(
44705
+ `Listed ${flatResources.length} resources from all servers`,
44706
+ "info"
44707
+ );
44061
44708
  addRequestHistory(
44062
44709
  { method: "resources/list/all" },
44063
44710
  { resources: flatResources },
@@ -44071,6 +44718,10 @@ const useMCPOperations = () => {
44071
44718
  const resourcesResponse = await client2.listResources();
44072
44719
  const endTime = performance.now();
44073
44720
  const latency = Math.round(endTime - startTime);
44721
+ addClientLog(
44722
+ `Listed ${resourcesResponse.resources.length} resources from ${selectedServerName}`,
44723
+ "info"
44724
+ );
44074
44725
  addRequestHistory(
44075
44726
  { method: "resources/list", server: selectedServerName },
44076
44727
  { resources: resourcesResponse.resources },
@@ -44096,6 +44747,10 @@ const useMCPOperations = () => {
44096
44747
  const templatesResponse = await client2.listResourceTemplates();
44097
44748
  const endTime = performance.now();
44098
44749
  const latency = Math.round(endTime - startTime);
44750
+ addClientLog(
44751
+ `Listed ${templatesResponse.resourceTemplates.length} resource templates from all servers`,
44752
+ "info"
44753
+ );
44099
44754
  addRequestHistory(
44100
44755
  { method: "resourceTemplates/list/all" },
44101
44756
  { resourceTemplates: templatesResponse.resourceTemplates },
@@ -44111,6 +44766,10 @@ const useMCPOperations = () => {
44111
44766
  const templatesResponse = await client2.listResourceTemplates();
44112
44767
  const endTime = performance.now();
44113
44768
  const latency = Math.round(endTime - startTime);
44769
+ addClientLog(
44770
+ `Listed ${templatesResponse.resourceTemplates.length} resource templates from ${selectedServerName}`,
44771
+ "info"
44772
+ );
44114
44773
  addRequestHistory(
44115
44774
  { method: "resourceTemplates/list", server: selectedServerName },
44116
44775
  { resourceTemplates: templatesResponse.resourceTemplates },
@@ -44135,6 +44794,7 @@ const useMCPOperations = () => {
44135
44794
  );
44136
44795
  const endTime = performance.now();
44137
44796
  const latency = Math.round(endTime - startTime);
44797
+ addClientLog(`Read resource ${uri} from ${selectedServerName}`, "info");
44138
44798
  addRequestHistory(
44139
44799
  { method: "resources/read", server: selectedServerName, uri },
44140
44800
  result,
@@ -44152,6 +44812,7 @@ const useMCPOperations = () => {
44152
44812
  );
44153
44813
  const endTime = performance.now();
44154
44814
  const latency = Math.round(endTime - startTime);
44815
+ addClientLog(`Read resource ${uri} from ${serverName}`, "info");
44155
44816
  addRequestHistory(
44156
44817
  { method: "resources/read", server: serverName, uri },
44157
44818
  result,
@@ -44176,6 +44837,10 @@ const useMCPOperations = () => {
44176
44837
  const result = await client2.subscribeResource({ uri });
44177
44838
  const endTime = performance.now();
44178
44839
  const latency = Math.round(endTime - startTime);
44840
+ addClientLog(
44841
+ `Subscribed to resource ${uri} from ${selectedServerName}`,
44842
+ "info"
44843
+ );
44179
44844
  addRequestHistory(
44180
44845
  { method: "resources/subscribe", server: selectedServerName, uri },
44181
44846
  result,
@@ -44197,6 +44862,10 @@ const useMCPOperations = () => {
44197
44862
  const result = await client2.unsubscribeResource({ uri });
44198
44863
  const endTime = performance.now();
44199
44864
  const latency = Math.round(endTime - startTime);
44865
+ addClientLog(
44866
+ `Unsubscribed from resource ${uri} from ${selectedServerName}`,
44867
+ "info"
44868
+ );
44200
44869
  addRequestHistory(
44201
44870
  { method: "resources/unsubscribe", server: selectedServerName, uri },
44202
44871
  result,
@@ -44218,6 +44887,10 @@ const useMCPOperations = () => {
44218
44887
  const flatPrompts = allServerPrompts.flatMap(({ prompts: prompts2 }) => prompts2);
44219
44888
  const endTime = performance.now();
44220
44889
  const latency = Math.round(endTime - startTime);
44890
+ addClientLog(
44891
+ `Listed ${flatPrompts.length} prompts from all servers`,
44892
+ "info"
44893
+ );
44221
44894
  addRequestHistory(
44222
44895
  { method: "prompts/list/all" },
44223
44896
  { prompts: flatPrompts },
@@ -44231,6 +44904,10 @@ const useMCPOperations = () => {
44231
44904
  const promptsResponse = await client2.listPrompts();
44232
44905
  const endTime = performance.now();
44233
44906
  const latency = Math.round(endTime - startTime);
44907
+ addClientLog(
44908
+ `Listed ${promptsResponse.prompts.length} prompts from ${selectedServerName}`,
44909
+ "info"
44910
+ );
44234
44911
  addRequestHistory(
44235
44912
  { method: "prompts/list", server: selectedServerName },
44236
44913
  { prompts: promptsResponse.prompts },
@@ -44256,6 +44933,7 @@ const useMCPOperations = () => {
44256
44933
  );
44257
44934
  const endTime = performance.now();
44258
44935
  const latency = Math.round(endTime - startTime);
44936
+ addClientLog(`Got prompt ${name} from ${selectedServerName}`, "info");
44259
44937
  addRequestHistory(
44260
44938
  { method: "prompts/get", server: selectedServerName, name, args },
44261
44939
  result,
@@ -44274,6 +44952,7 @@ const useMCPOperations = () => {
44274
44952
  );
44275
44953
  const endTime = performance.now();
44276
44954
  const latency = Math.round(endTime - startTime);
44955
+ addClientLog(`Got prompt ${name} from ${serverName}`, "info");
44277
44956
  addRequestHistory(
44278
44957
  { method: "prompts/get", server: serverName, name, args },
44279
44958
  result,
@@ -44298,6 +44977,10 @@ const useMCPOperations = () => {
44298
44977
  const flatTools = allServerTools.flatMap(({ tools: tools2 }) => tools2);
44299
44978
  const endTime = performance.now();
44300
44979
  const latency = Math.round(endTime - startTime);
44980
+ addClientLog(
44981
+ `Listed ${flatTools.length} tools from all servers`,
44982
+ "info"
44983
+ );
44301
44984
  addRequestHistory(
44302
44985
  { method: "tools/list/all" },
44303
44986
  { tools: flatTools },
@@ -44311,6 +44994,10 @@ const useMCPOperations = () => {
44311
44994
  const toolsResponse = await client2.tools();
44312
44995
  const endTime = performance.now();
44313
44996
  const latency = Math.round(endTime - startTime);
44997
+ addClientLog(
44998
+ `Listed ${toolsResponse.tools.length} tools from ${selectedServerName}`,
44999
+ "info"
45000
+ );
44314
45001
  addRequestHistory(
44315
45002
  { method: "tools/list", server: selectedServerName },
44316
45003
  { tools: toolsResponse.tools },
@@ -44337,6 +45024,7 @@ const useMCPOperations = () => {
44337
45024
  );
44338
45025
  const endTime = performance.now();
44339
45026
  const latency = Math.round(endTime - startTime);
45027
+ addClientLog(`Called tool ${name} on ${selectedServerName}`, "info");
44340
45028
  addRequestHistory(
44341
45029
  { method: "tools/call", server: selectedServerName, name, params },
44342
45030
  result,
@@ -44355,6 +45043,7 @@ const useMCPOperations = () => {
44355
45043
  );
44356
45044
  const endTime = performance.now();
44357
45045
  const latency = Math.round(endTime - startTime);
45046
+ addClientLog(`Called tool ${name} on ${serverName}`, "info");
44358
45047
  addRequestHistory(
44359
45048
  { method: "tools/call", server: serverName, name, params },
44360
45049
  result,
@@ -44370,6 +45059,10 @@ const useMCPOperations = () => {
44370
45059
  } catch (e) {
44371
45060
  const endTime = performance.now();
44372
45061
  const latency = Math.round(endTime - startTime);
45062
+ addClientLog(
45063
+ `Error calling tool ${name} on ${selectedServerName}`,
45064
+ "error"
45065
+ );
44373
45066
  const toolResult2 = {
44374
45067
  content: [
44375
45068
  {
@@ -44423,6 +45116,10 @@ const useMCPOperations = () => {
44423
45116
  const result = await client2.handleCompletion(ref2, argName, value, signal);
44424
45117
  const endTime = performance.now();
44425
45118
  const latency = Math.round(endTime - startTime);
45119
+ addClientLog(
45120
+ `Completed completion for ${ref2.type} ${ref2.name} on ${selectedServerName}`,
45121
+ "info"
45122
+ );
44426
45123
  addRequestHistory(
44427
45124
  {
44428
45125
  method: "completion",
@@ -44437,7 +45134,7 @@ const useMCPOperations = () => {
44437
45134
  );
44438
45135
  return result;
44439
45136
  },
44440
- [addRequestHistory]
45137
+ [addRequestHistory, addClientLog]
44441
45138
  );
44442
45139
  const handleApproveSampling = reactExports.useCallback(
44443
45140
  (id, result) => {
@@ -44466,12 +45163,6 @@ const useMCPOperations = () => {
44466
45163
  return updatedRequests;
44467
45164
  });
44468
45165
  }, []);
44469
- const getRequestHistory = reactExports.useCallback(() => {
44470
- return requestHistory;
44471
- }, [requestHistory]);
44472
- const clearRequestHistory = reactExports.useCallback(() => {
44473
- setRequestHistory([]);
44474
- }, []);
44475
45166
  return {
44476
45167
  // State
44477
45168
  resources,
@@ -44532,7 +45223,10 @@ const useMCPOperations = () => {
44532
45223
  handleRejectSampling,
44533
45224
  addRequestHistory,
44534
45225
  getRequestHistory,
44535
- clearRequestHistory
45226
+ clearRequestHistory,
45227
+ addClientLog,
45228
+ clearClientLogs,
45229
+ getClientLogs
44536
45230
  };
44537
45231
  };
44538
45232
  const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
@@ -44662,7 +45356,10 @@ const App = () => {
44662
45356
  var _a2, _b;
44663
45357
  const serverState = useServerState();
44664
45358
  const mcpOperations = useMCPOperations();
44665
- const connectionState = useConnectionState(mcpOperations.addRequestHistory);
45359
+ const connectionState = useConnectionState(
45360
+ mcpOperations.addRequestHistory,
45361
+ mcpOperations.addClientLog
45362
+ );
44666
45363
  const configState = useConfigState();
44667
45364
  const rootsRef = reactExports.useRef(mcpOperations.roots);
44668
45365
  const nextRequestId = reactExports.useRef(0);
@@ -44672,6 +45369,7 @@ const App = () => {
44672
45369
  });
44673
45370
  const [isSidebarExpanded, setIsSidebarExpanded] = reactExports.useState(true);
44674
45371
  const [showStarModal, setShowStarModal] = reactExports.useState(false);
45372
+ const { addClientLog } = mcpOperations;
44675
45373
  reactExports.useEffect(() => {
44676
45374
  const handleHashChange = () => {
44677
45375
  const hash = window.location.hash.slice(1);
@@ -44700,7 +45398,7 @@ const App = () => {
44700
45398
  (notification) => {
44701
45399
  mcpOperations.setStdErrNotifications((prev) => [...prev, notification]);
44702
45400
  },
44703
- [mcpOperations.setStdErrNotifications]
45401
+ [mcpOperations]
44704
45402
  );
44705
45403
  const onPendingRequest = reactExports.useCallback(
44706
45404
  (request, resolve, reject) => {
@@ -44709,7 +45407,7 @@ const App = () => {
44709
45407
  { id: nextRequestId.current++, request, resolve, reject }
44710
45408
  ]);
44711
45409
  },
44712
- [mcpOperations.setPendingSampleRequests]
45410
+ [mcpOperations]
44713
45411
  );
44714
45412
  const getRootsCallback = reactExports.useCallback(() => rootsRef.current, []);
44715
45413
  const connectionStatus = connectionState.getConnectionStatus();
@@ -44721,10 +45419,11 @@ const App = () => {
44721
45419
  serverState.selectedServerName
44722
45420
  );
44723
45421
  const handleAddServer = reactExports.useCallback(
44724
- async (name, serverConfig) => {
44725
- console.log("🔧 Adding server without auto-connect:", {
45422
+ async (name, serverConfig, options = {}) => {
45423
+ console.log("🔧 Adding server with options:", {
44726
45424
  name,
44727
- serverConfig
45425
+ serverConfig,
45426
+ options
44728
45427
  });
44729
45428
  const shouldSelectNewServer = Object.keys(serverState.serverConfigs).length === 0;
44730
45429
  serverState.updateServerConfig(name, serverConfig);
@@ -44732,15 +45431,17 @@ const App = () => {
44732
45431
  serverState.setSelectedServerName(name);
44733
45432
  }
44734
45433
  if (!connectionState.mcpAgent) {
44735
- console.log(
44736
- "🆕 Creating agent with server config (no auto-connect)..."
45434
+ console.log("🆕 Creating agent with server config...");
45435
+ addClientLog(
45436
+ `🆕 Creating agent with server config (no auto-connect) ${name} ${JSON.stringify(serverConfig)}`,
45437
+ "info"
44737
45438
  );
44738
45439
  try {
44739
45440
  const allServerConfigs = {
44740
45441
  ...serverState.serverConfigs,
44741
45442
  [name]: serverConfig
44742
45443
  };
44743
- await connectionState.createAgentWithoutConnecting(
45444
+ const agent = await connectionState.createAgentWithoutConnecting(
44744
45445
  allServerConfigs,
44745
45446
  configState.config,
44746
45447
  configState.bearerToken,
@@ -44750,26 +45451,41 @@ const App = () => {
44750
45451
  onPendingRequest,
44751
45452
  getRootsCallback
44752
45453
  );
45454
+ if (options.autoConnect) {
45455
+ console.log("🔌 Auto-connecting to all servers...");
45456
+ await agent.connectToAllServers();
45457
+ console.log("✅ Successfully connected to all servers");
45458
+ serverState.setSelectedServerName(name);
45459
+ connectionState.forceUpdateSidebar();
45460
+ }
44753
45461
  } catch (error) {
44754
- console.error("❌ Failed to create agent:", error);
45462
+ console.error("❌ Failed to create agent and connect:", error);
44755
45463
  throw error;
44756
45464
  }
44757
45465
  } else {
44758
45466
  connectionState.mcpAgent.addServer(name, serverConfig);
44759
45467
  connectionState.forceUpdateSidebar();
45468
+ if (options.autoConnect) {
45469
+ console.log(`🔌 Auto-connecting to server: "${name}"`);
45470
+ try {
45471
+ serverState.setSelectedServerName(name);
45472
+ await connectionState.connectServer(name);
45473
+ console.log(`✅ Successfully auto-connected to "${name}"`);
45474
+ } catch (error) {
45475
+ console.error(`❌ Failed to auto-connect to "${name}":`, error);
45476
+ }
45477
+ }
44760
45478
  }
44761
45479
  return name;
44762
45480
  },
44763
45481
  [
44764
45482
  serverState,
44765
45483
  connectionState,
44766
- configState.config,
44767
- configState.bearerToken,
44768
- configState.headerName,
44769
- configState.claudeApiKey,
45484
+ configState,
44770
45485
  onStdErrNotification,
44771
45486
  onPendingRequest,
44772
- getRootsCallback
45487
+ getRootsCallback,
45488
+ addClientLog
44773
45489
  ]
44774
45490
  );
44775
45491
  const handleRemoveServer = reactExports.useCallback(
@@ -44789,43 +45505,55 @@ const App = () => {
44789
45505
  );
44790
45506
  const handleUpdateServer = reactExports.useCallback(
44791
45507
  async (serverName, config) => {
44792
- await connectionState.updateServerWithoutConnecting(serverName, config);
45508
+ await connectionState.updateServer(serverName, config);
44793
45509
  serverState.updateServerConfig(serverName, config);
45510
+ addClientLog(
45511
+ `🔧 Updated server: ${serverName} ${JSON.stringify(config)}`,
45512
+ "info"
45513
+ );
44794
45514
  },
44795
- [connectionState, serverState]
45515
+ [connectionState, serverState, addClientLog]
44796
45516
  );
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);
45517
+ const handleSaveClient = reactExports.useCallback(
45518
+ async (config) => {
45519
+ if (!serverState.clientFormName.trim()) return;
45520
+ try {
45521
+ if (serverState.isCreatingClient) {
45522
+ await handleAddServer(serverState.clientFormName, config, {
45523
+ autoConnect: true
45524
+ });
45525
+ } else if (serverState.editingClientName) {
45526
+ const oldServerName = serverState.editingClientName;
45527
+ const newServerName = serverState.clientFormName.trim();
45528
+ if (oldServerName !== newServerName) {
45529
+ addClientLog(
45530
+ `🔄 Server name changed from "${oldServerName}" to "${newServerName}"`,
45531
+ "info"
45532
+ );
45533
+ await handleRemoveServer(oldServerName);
45534
+ await handleAddServer(newServerName, config, {
45535
+ autoConnect: true
45536
+ });
45537
+ if (serverState.selectedServerName === oldServerName) {
45538
+ serverState.setSelectedServerName(newServerName);
45539
+ }
45540
+ } else {
45541
+ await handleUpdateServer(serverState.editingClientName, config);
44816
45542
  }
44817
- } else {
44818
- await handleUpdateServer(
44819
- serverState.editingClientName,
44820
- serverState.clientFormConfig
44821
- );
44822
45543
  }
45544
+ serverState.handleCancelClientForm();
45545
+ } catch (error) {
45546
+ console.error("Failed to save client:", error);
44823
45547
  }
44824
- serverState.handleCancelClientForm();
44825
- } catch (error) {
44826
- console.error("Failed to save client:", error);
44827
- }
44828
- }, [serverState, handleAddServer, handleUpdateServer, handleRemoveServer]);
45548
+ },
45549
+ [
45550
+ serverState,
45551
+ handleAddServer,
45552
+ handleUpdateServer,
45553
+ handleRemoveServer,
45554
+ addClientLog
45555
+ ]
45556
+ );
44829
45557
  const handleSaveMultiple = reactExports.useCallback(
44830
45558
  async (clients) => {
44831
45559
  const results = {
@@ -44836,28 +45564,39 @@ const App = () => {
44836
45564
  for (const client2 of clients) {
44837
45565
  try {
44838
45566
  console.log(`🔧 Creating client: "${client2.name}"`);
44839
- await handleAddServer(client2.name, client2.config);
45567
+ await handleAddServer(client2.name, client2.config, {
45568
+ autoConnect: false
45569
+ });
44840
45570
  results.success.push(client2.name);
44841
- console.log(`✅ Successfully created client: "${client2.name}"`);
45571
+ addClientLog(
45572
+ `✅ Successfully created client: "${client2.name}"`,
45573
+ "info"
45574
+ );
44842
45575
  } catch (error) {
44843
45576
  const errorMessage = error instanceof Error ? error.message : String(error);
44844
- console.error(`❌ Failed to create client "${client2.name}":`, errorMessage);
45577
+ addClientLog(
45578
+ `❌ Failed to create client "${client2.name}": ${errorMessage}`,
45579
+ "error"
45580
+ );
44845
45581
  results.failed.push({ name: client2.name, error: errorMessage });
44846
45582
  }
44847
45583
  }
44848
45584
  serverState.handleCancelClientForm();
44849
45585
  if (results.success.length > 0) {
44850
- console.log(`✅ Successfully created ${results.success.length} client(s): ${results.success.join(", ")}`);
45586
+ addClientLog(
45587
+ `✅ Successfully created ${results.success.length} client(s): ${results.success.join(", ")}`,
45588
+ "info"
45589
+ );
44851
45590
  }
44852
45591
  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
- });
45592
+ addClientLog(
45593
+ `❌ Failed to create ${results.failed.length} client(s): ${results.failed.map(({ name, error }) => `${name}: ${error}`).join(", ")}`,
45594
+ "error"
45595
+ );
44857
45596
  }
44858
45597
  return results;
44859
45598
  },
44860
- [handleAddServer, serverState]
45599
+ [handleAddServer, serverState, addClientLog]
44861
45600
  );
44862
45601
  const handleEditClient = reactExports.useCallback(
44863
45602
  (serverName) => {
@@ -44886,6 +45625,13 @@ const App = () => {
44886
45625
  configState.updateClaudeApiKey(newApiKey);
44887
45626
  updateApiKey(newApiKey);
44888
45627
  };
45628
+ const handleConnectServer = reactExports.useCallback(
45629
+ async (serverName) => {
45630
+ await connectionState.connectServer(serverName);
45631
+ mcpOperations.listTools(connectionState.mcpAgent, serverName);
45632
+ },
45633
+ [connectionState, mcpOperations]
45634
+ );
44889
45635
  const makeRequest = reactExports.useCallback(
44890
45636
  async (request) => {
44891
45637
  return await mcpOperations.makeRequest(
@@ -44935,10 +45681,10 @@ const App = () => {
44935
45681
  }, [mcpOperations.roots]);
44936
45682
  reactExports.useEffect(() => {
44937
45683
  const restoreAgentWithoutConnecting = async () => {
45684
+ if (window.location.pathname.startsWith("/oauth/callback")) {
45685
+ return;
45686
+ }
44938
45687
  if (Object.keys(serverState.serverConfigs).length > 0 && !connectionState.mcpAgent) {
44939
- console.log(
44940
- "🔄 Restoring agent with saved server configs (no auto-connect)..."
44941
- );
44942
45688
  try {
44943
45689
  await connectionState.createAgentWithoutConnecting(
44944
45690
  serverState.serverConfigs,
@@ -44950,24 +45696,26 @@ const App = () => {
44950
45696
  onPendingRequest,
44951
45697
  getRootsCallback
44952
45698
  );
44953
- console.log("✅ Successfully restored agent with server configs");
44954
45699
  } catch (error) {
44955
- console.error("❌ Failed to restore agent:", error);
45700
+ addClientLog(
45701
+ `❌ Failed to restore agent: ${error instanceof Error ? error.message : String(error)}`,
45702
+ "error"
45703
+ );
44956
45704
  }
44957
45705
  }
44958
45706
  };
44959
45707
  restoreAgentWithoutConnecting();
44960
45708
  }, [
44961
45709
  serverState.serverConfigs,
44962
- connectionState.mcpAgent,
44963
- connectionState.createAgentWithoutConnecting,
45710
+ connectionState,
44964
45711
  configState.config,
44965
45712
  configState.bearerToken,
44966
45713
  configState.headerName,
44967
45714
  configState.claudeApiKey,
44968
45715
  onStdErrNotification,
44969
45716
  onPendingRequest,
44970
- getRootsCallback
45717
+ getRootsCallback,
45718
+ addClientLog
44971
45719
  ]);
44972
45720
  reactExports.useEffect(() => {
44973
45721
  const currentConfig = serverState.serverConfigs[serverState.selectedServerName];
@@ -45018,24 +45766,19 @@ const App = () => {
45018
45766
  }
45019
45767
  }
45020
45768
  const finalServerName = existingServerName || serverName;
45021
- console.log(
45022
- `🔐 OAuth connecting to: ${serverUrl} as server "${finalServerName}"`
45023
- );
45024
45769
  const serverConfig = {
45025
45770
  transportType: "sse",
45026
45771
  url: new URL(serverUrl)
45027
45772
  };
45028
45773
  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");
45774
+ await handleAddServer(finalServerName, serverConfig, {
45775
+ autoConnect: true
45776
+ });
45034
45777
  } catch (error) {
45035
45778
  console.error("Failed to connect OAuth server:", error);
45036
45779
  }
45037
45780
  },
45038
- [serverState, handleAddServer, connectionState.connectServer]
45781
+ [serverState, handleAddServer]
45039
45782
  );
45040
45783
  const onOAuthDebugConnect = reactExports.useCallback(
45041
45784
  ({
@@ -45083,7 +45826,7 @@ const App = () => {
45083
45826
  }, []);
45084
45827
  if (window.location.pathname === "/oauth/callback") {
45085
45828
  const OAuthCallback = React.lazy(
45086
- () => __vitePreload(() => import("./OAuthCallback-DkLMDxkx.js"), true ? __vite__mapDeps([0,1]) : void 0)
45829
+ () => __vitePreload(() => import("./OAuthCallback-CdxuZKBm.js"), true ? __vite__mapDeps([0,1]) : void 0)
45087
45830
  );
45088
45831
  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
45832
  reactExports.Suspense,
@@ -45098,7 +45841,7 @@ const App = () => {
45098
45841
  }
45099
45842
  if (window.location.pathname === "/oauth/callback/debug") {
45100
45843
  const OAuthDebugCallback = React.lazy(
45101
- () => __vitePreload(() => import("./OAuthDebugCallback-DaNmVTKt.js"), true ? __vite__mapDeps([2,1]) : void 0)
45844
+ () => __vitePreload(() => import("./OAuthDebugCallback-BJaIMNT8.js"), true ? __vite__mapDeps([2,1]) : void 0)
45102
45845
  );
45103
45846
  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
45847
  reactExports.Suspense,
@@ -45381,7 +46124,7 @@ const App = () => {
45381
46124
  selectedServerName: serverState.selectedServerName,
45382
46125
  onServerSelect: serverState.setSelectedServerName,
45383
46126
  onRemoveServer: handleRemoveServer,
45384
- onConnectServer: connectionState.connectServer,
46127
+ onConnectServer: handleConnectServer,
45385
46128
  onDisconnectServer: connectionState.disconnectServer,
45386
46129
  onCreateClient: serverState.handleCreateClient,
45387
46130
  onEditClient: handleEditClient,
@@ -45407,7 +46150,9 @@ const App = () => {
45407
46150
  {
45408
46151
  requestHistory,
45409
46152
  toolResult: mcpOperations.toolResult,
45410
- onClearHistory: mcpOperations.clearRequestHistory
46153
+ clientLogs: mcpOperations.getClientLogs(),
46154
+ onClearHistory: mcpOperations.clearRequestHistory,
46155
+ onClearLogs: mcpOperations.clearClientLogs
45411
46156
  }
45412
46157
  )
45413
46158
  ] })