@modelcontextprotocol/inspector 0.16.5 → 0.16.7

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.
@@ -15121,6 +15121,7 @@ const enumType = ZodEnum.create;
15121
15121
  ZodPromise.create;
15122
15122
  const optionalType = ZodOptional.create;
15123
15123
  ZodNullable.create;
15124
+ const NEVER = INVALID;
15124
15125
  const LATEST_PROTOCOL_VERSION = "2025-06-18";
15125
15126
  const SUPPORTED_PROTOCOL_VERSIONS = [
15126
15127
  LATEST_PROTOCOL_VERSION,
@@ -15229,6 +15230,20 @@ const CancelledNotificationSchema = NotificationSchema.extend({
15229
15230
  reason: stringType().optional()
15230
15231
  })
15231
15232
  });
15233
+ const IconSchema = objectType({
15234
+ /**
15235
+ * URL or data URI for the icon.
15236
+ */
15237
+ src: stringType(),
15238
+ /**
15239
+ * Optional MIME type for the icon.
15240
+ */
15241
+ mimeType: optionalType(stringType()),
15242
+ /**
15243
+ * Optional string specifying icon dimensions (e.g., "48x48 96x96").
15244
+ */
15245
+ sizes: optionalType(stringType())
15246
+ }).passthrough();
15232
15247
  const BaseMetadataSchema = objectType({
15233
15248
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
15234
15249
  name: stringType(),
@@ -15243,7 +15258,20 @@ const BaseMetadataSchema = objectType({
15243
15258
  title: optionalType(stringType())
15244
15259
  }).passthrough();
15245
15260
  const ImplementationSchema = BaseMetadataSchema.extend({
15246
- version: stringType()
15261
+ version: stringType(),
15262
+ /**
15263
+ * An optional URL of the website for this implementation.
15264
+ */
15265
+ websiteUrl: optionalType(stringType()),
15266
+ /**
15267
+ * An optional list of icons for this implementation.
15268
+ * This can be used by clients to display the implementation in a user interface.
15269
+ * Each icon should have a `kind` property that specifies whether it is a data representation or a URL source, a `src` property that points to the icon file or data representation, and may also include a `mimeType` and `sizes` property.
15270
+ * The `mimeType` property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
15271
+ * The `sizes` property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
15272
+ * The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.
15273
+ */
15274
+ icons: optionalType(arrayType(IconSchema))
15247
15275
  });
15248
15276
  const ClientCapabilitiesSchema = objectType({
15249
15277
  /**
@@ -15434,6 +15462,10 @@ const ResourceSchema = BaseMetadataSchema.extend({
15434
15462
  * The MIME type of this resource, if known.
15435
15463
  */
15436
15464
  mimeType: optionalType(stringType()),
15465
+ /**
15466
+ * An optional list of icons for this resource.
15467
+ */
15468
+ icons: optionalType(arrayType(IconSchema)),
15437
15469
  /**
15438
15470
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15439
15471
  * for notes on _meta usage.
@@ -15538,6 +15570,10 @@ const PromptSchema = BaseMetadataSchema.extend({
15538
15570
  * A list of arguments to use for templating the prompt.
15539
15571
  */
15540
15572
  arguments: optionalType(arrayType(PromptArgumentSchema)),
15573
+ /**
15574
+ * An optional list of icons for this prompt.
15575
+ */
15576
+ icons: optionalType(arrayType(IconSchema)),
15541
15577
  /**
15542
15578
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15543
15579
  * for notes on _meta usage.
@@ -15705,6 +15741,10 @@ const ToolSchema = BaseMetadataSchema.extend({
15705
15741
  * Optional additional tool information.
15706
15742
  */
15707
15743
  annotations: optionalType(ToolAnnotationsSchema),
15744
+ /**
15745
+ * An optional list of icons for this tool.
15746
+ */
15747
+ icons: optionalType(arrayType(IconSchema)),
15708
15748
  /**
15709
15749
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15710
15750
  * for notes on _meta usage.
@@ -16023,7 +16063,7 @@ unionType([
16023
16063
  CallToolRequestSchema,
16024
16064
  ListToolsRequestSchema
16025
16065
  ]);
16026
- const ClientNotificationSchema = unionType([
16066
+ unionType([
16027
16067
  CancelledNotificationSchema,
16028
16068
  ProgressNotificationSchema,
16029
16069
  InitializedNotificationSchema,
@@ -16041,7 +16081,7 @@ unionType([
16041
16081
  ElicitRequestSchema,
16042
16082
  ListRootsRequestSchema
16043
16083
  ]);
16044
- const ServerNotificationSchema = unionType([
16084
+ unionType([
16045
16085
  CancelledNotificationSchema,
16046
16086
  ProgressNotificationSchema,
16047
16087
  LoggingMessageNotificationSchema,
@@ -16070,9 +16110,22 @@ class McpError extends Error {
16070
16110
  this.name = "McpError";
16071
16111
  }
16072
16112
  }
16113
+ const SafeUrlSchema = stringType().url().superRefine((val, ctx) => {
16114
+ if (!URL.canParse(val)) {
16115
+ ctx.addIssue({
16116
+ code: ZodIssueCode.custom,
16117
+ message: "URL must be parseable",
16118
+ fatal: true
16119
+ });
16120
+ return NEVER;
16121
+ }
16122
+ }).refine((url) => {
16123
+ const u2 = new URL(url);
16124
+ return u2.protocol !== "javascript:" && u2.protocol !== "data:" && u2.protocol !== "vbscript:";
16125
+ }, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
16073
16126
  const OAuthProtectedResourceMetadataSchema = objectType({
16074
16127
  resource: stringType().url(),
16075
- authorization_servers: arrayType(stringType().url()).optional(),
16128
+ authorization_servers: arrayType(SafeUrlSchema).optional(),
16076
16129
  jwks_uri: stringType().url().optional(),
16077
16130
  scopes_supported: arrayType(stringType()).optional(),
16078
16131
  bearer_methods_supported: arrayType(stringType()).optional(),
@@ -16088,17 +16141,17 @@ const OAuthProtectedResourceMetadataSchema = objectType({
16088
16141
  }).passthrough();
16089
16142
  const OAuthMetadataSchema = objectType({
16090
16143
  issuer: stringType(),
16091
- authorization_endpoint: stringType(),
16092
- token_endpoint: stringType(),
16093
- registration_endpoint: stringType().optional(),
16144
+ authorization_endpoint: SafeUrlSchema,
16145
+ token_endpoint: SafeUrlSchema,
16146
+ registration_endpoint: SafeUrlSchema.optional(),
16094
16147
  scopes_supported: arrayType(stringType()).optional(),
16095
16148
  response_types_supported: arrayType(stringType()),
16096
16149
  response_modes_supported: arrayType(stringType()).optional(),
16097
16150
  grant_types_supported: arrayType(stringType()).optional(),
16098
16151
  token_endpoint_auth_methods_supported: arrayType(stringType()).optional(),
16099
16152
  token_endpoint_auth_signing_alg_values_supported: arrayType(stringType()).optional(),
16100
- service_documentation: stringType().optional(),
16101
- revocation_endpoint: stringType().optional(),
16153
+ service_documentation: SafeUrlSchema.optional(),
16154
+ revocation_endpoint: SafeUrlSchema.optional(),
16102
16155
  revocation_endpoint_auth_methods_supported: arrayType(stringType()).optional(),
16103
16156
  revocation_endpoint_auth_signing_alg_values_supported: arrayType(stringType()).optional(),
16104
16157
  introspection_endpoint: stringType().optional(),
@@ -16108,11 +16161,11 @@ const OAuthMetadataSchema = objectType({
16108
16161
  }).passthrough();
16109
16162
  const OpenIdProviderMetadataSchema = objectType({
16110
16163
  issuer: stringType(),
16111
- authorization_endpoint: stringType(),
16112
- token_endpoint: stringType(),
16113
- userinfo_endpoint: stringType().optional(),
16114
- jwks_uri: stringType(),
16115
- registration_endpoint: stringType().optional(),
16164
+ authorization_endpoint: SafeUrlSchema,
16165
+ token_endpoint: SafeUrlSchema,
16166
+ userinfo_endpoint: SafeUrlSchema.optional(),
16167
+ jwks_uri: SafeUrlSchema,
16168
+ registration_endpoint: SafeUrlSchema.optional(),
16116
16169
  scopes_supported: arrayType(stringType()).optional(),
16117
16170
  response_types_supported: arrayType(stringType()),
16118
16171
  response_modes_supported: arrayType(stringType()).optional(),
@@ -16140,8 +16193,8 @@ const OpenIdProviderMetadataSchema = objectType({
16140
16193
  request_parameter_supported: booleanType().optional(),
16141
16194
  request_uri_parameter_supported: booleanType().optional(),
16142
16195
  require_request_uri_registration: booleanType().optional(),
16143
- op_policy_uri: stringType().optional(),
16144
- op_tos_uri: stringType().optional()
16196
+ op_policy_uri: SafeUrlSchema.optional(),
16197
+ op_tos_uri: SafeUrlSchema.optional()
16145
16198
  }).passthrough();
16146
16199
  const OpenIdProviderDiscoveryMetadataSchema = OpenIdProviderMetadataSchema.merge(OAuthMetadataSchema.pick({
16147
16200
  code_challenge_methods_supported: true
@@ -16161,18 +16214,18 @@ const OAuthErrorResponseSchema = objectType({
16161
16214
  error_uri: stringType().optional()
16162
16215
  });
16163
16216
  const OAuthClientMetadataSchema = objectType({
16164
- redirect_uris: arrayType(stringType()).refine((uris) => uris.every((uri) => URL.canParse(uri)), { message: "redirect_uris must contain valid URLs" }),
16217
+ redirect_uris: arrayType(SafeUrlSchema),
16165
16218
  token_endpoint_auth_method: stringType().optional(),
16166
16219
  grant_types: arrayType(stringType()).optional(),
16167
16220
  response_types: arrayType(stringType()).optional(),
16168
16221
  client_name: stringType().optional(),
16169
- client_uri: stringType().optional(),
16170
- logo_uri: stringType().optional(),
16222
+ client_uri: SafeUrlSchema.optional(),
16223
+ logo_uri: SafeUrlSchema.optional(),
16171
16224
  scope: stringType().optional(),
16172
16225
  contacts: arrayType(stringType()).optional(),
16173
- tos_uri: stringType().optional(),
16226
+ tos_uri: SafeUrlSchema.optional(),
16174
16227
  policy_uri: stringType().optional(),
16175
- jwks_uri: stringType().optional(),
16228
+ jwks_uri: SafeUrlSchema.optional(),
16176
16229
  jwks: anyType().optional(),
16177
16230
  software_id: stringType().optional(),
16178
16231
  software_version: stringType().optional(),
@@ -16632,7 +16685,7 @@ async function tryMetadataDiscovery(url, protocolVersion, fetchFn = fetch) {
16632
16685
  return await fetchWithCorsRetry(url, headers, fetchFn);
16633
16686
  }
16634
16687
  function shouldAttemptFallback(response, pathname) {
16635
- return !response || response.status === 404 && pathname !== "/";
16688
+ return !response || response.status >= 400 && response.status < 500 && pathname !== "/";
16636
16689
  }
16637
16690
  async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) {
16638
16691
  var _a, _b;
@@ -16888,6 +16941,19 @@ const generateOAuthErrorDescription = (params) => {
16888
16941
  errorUri ? `More info: ${errorUri}.` : ""
16889
16942
  ].filter(Boolean).join("\n");
16890
16943
  };
16944
+ function validateRedirectUrl(url) {
16945
+ try {
16946
+ const parsedUrl = new URL(url);
16947
+ if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
16948
+ throw new Error("Authorization URL must be HTTP or HTTPS");
16949
+ }
16950
+ } catch (error) {
16951
+ if (error instanceof Error && error.message === "Authorization URL must be HTTP or HTTPS") {
16952
+ throw error;
16953
+ }
16954
+ throw new Error(`Invalid URL: ${url}`);
16955
+ }
16956
+ }
16891
16957
  const discoverScopes = async (serverUrl, resourceMetadata) => {
16892
16958
  try {
16893
16959
  const metadata = await discoverAuthorizationServerMetadata(
@@ -16996,9 +17062,7 @@ class InspectorOAuthClientProvider {
16996
17062
  sessionStorage.setItem(key, JSON.stringify(tokens));
16997
17063
  }
16998
17064
  redirectToAuthorization(authorizationUrl) {
16999
- if (authorizationUrl.protocol !== "http:" && authorizationUrl.protocol !== "https:") {
17000
- throw new Error("Authorization URL must be HTTP or HTTPS");
17001
- }
17065
+ validateRedirectUrl(authorizationUrl.href);
17002
17066
  window.location.href = authorizationUrl.href;
17003
17067
  }
17004
17068
  saveCodeVerifier(codeVerifier) {
@@ -17151,7 +17215,7 @@ const oauthTransitions = {
17151
17215
  );
17152
17216
  context.provider.saveCodeVerifier(codeVerifier);
17153
17217
  context.updateState({
17154
- authorizationUrl: authorizationUrl.toString(),
17218
+ authorizationUrl,
17155
17219
  oauthStep: "authorization_code"
17156
17220
  });
17157
17221
  }
@@ -24053,7 +24117,7 @@ function splitLines(chunk) {
24053
24117
  const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
24054
24118
  `, searchIndex);
24055
24119
  let lineEnd = -1;
24056
- if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) {
24120
+ if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) {
24057
24121
  incompleteLine = chunk.slice(searchIndex);
24058
24122
  break;
24059
24123
  } else {
@@ -24841,16 +24905,7 @@ class StreamableHTTPClientTransport {
24841
24905
  return this._protocolVersion;
24842
24906
  }
24843
24907
  }
24844
- const StdErrNotificationSchema = NotificationSchema.extend({
24845
- method: literalType("notifications/stderr"),
24846
- params: objectType({
24847
- content: stringType()
24848
- })
24849
- });
24850
- ClientNotificationSchema.or(
24851
- StdErrNotificationSchema
24852
- ).or(ServerNotificationSchema).or(NotificationSchema);
24853
- const version$1 = "0.16.5";
24908
+ const version$1 = "0.16.7";
24854
24909
  const packageJson = {
24855
24910
  version: version$1
24856
24911
  };
@@ -24982,7 +25037,6 @@ function useConnection({
24982
25037
  oauthScope,
24983
25038
  config,
24984
25039
  onNotification,
24985
- onStdErrNotification,
24986
25040
  onPendingRequest,
24987
25041
  onElicitationRequest,
24988
25042
  getRoots,
@@ -25036,7 +25090,7 @@ function useConnection({
25036
25090
  mcpRequestOptions.onprogress = (params) => {
25037
25091
  if (onNotification) {
25038
25092
  onNotification({
25039
- method: "notification/progress",
25093
+ method: "notifications/progress",
25040
25094
  params
25041
25095
  });
25042
25096
  }
@@ -25221,11 +25275,18 @@ function useConnection({
25221
25275
  let transportOptions;
25222
25276
  let mcpProxyServerUrl;
25223
25277
  switch (transportType) {
25224
- case "stdio":
25278
+ case "stdio": {
25225
25279
  mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/stdio`);
25226
25280
  mcpProxyServerUrl.searchParams.append("command", command);
25227
25281
  mcpProxyServerUrl.searchParams.append("args", args);
25228
25282
  mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env));
25283
+ const proxyFullAddress = config.MCP_PROXY_FULL_ADDRESS.value;
25284
+ if (proxyFullAddress) {
25285
+ mcpProxyServerUrl.searchParams.append(
25286
+ "proxyFullAddress",
25287
+ proxyFullAddress
25288
+ );
25289
+ }
25229
25290
  transportOptions = {
25230
25291
  authProvider: serverAuthProvider,
25231
25292
  eventSourceInit: {
@@ -25239,9 +25300,17 @@ function useConnection({
25239
25300
  }
25240
25301
  };
25241
25302
  break;
25242
- case "sse":
25303
+ }
25304
+ case "sse": {
25243
25305
  mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
25244
25306
  mcpProxyServerUrl.searchParams.append("url", sseUrl);
25307
+ const proxyFullAddressSSE = config.MCP_PROXY_FULL_ADDRESS.value;
25308
+ if (proxyFullAddressSSE) {
25309
+ mcpProxyServerUrl.searchParams.append(
25310
+ "proxyFullAddress",
25311
+ proxyFullAddressSSE
25312
+ );
25313
+ }
25245
25314
  transportOptions = {
25246
25315
  eventSourceInit: {
25247
25316
  fetch: (url, init) => fetch(url, {
@@ -25254,6 +25323,7 @@ function useConnection({
25254
25323
  }
25255
25324
  };
25256
25325
  break;
25326
+ }
25257
25327
  case "streamable-http":
25258
25328
  mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
25259
25329
  mcpProxyServerUrl.searchParams.append("url", sseUrl);
@@ -25297,12 +25367,6 @@ function useConnection({
25297
25367
  return Promise.resolve();
25298
25368
  };
25299
25369
  }
25300
- if (onStdErrNotification) {
25301
- client2.setNotificationHandler(
25302
- StdErrNotificationSchema,
25303
- onStdErrNotification
25304
- );
25305
- }
25306
25370
  let capabilities;
25307
25371
  try {
25308
25372
  const transport = transportType === "streamable-http" ? new StreamableHTTPClientTransport(mcpProxyServerUrl, {
@@ -25363,6 +25427,15 @@ function useConnection({
25363
25427
  if ((capabilities == null ? void 0 : capabilities.logging) && defaultLoggingLevel) {
25364
25428
  lastRequest = "logging/setLevel";
25365
25429
  await client2.setLoggingLevel(defaultLoggingLevel);
25430
+ pushHistory(
25431
+ {
25432
+ method: "logging/setLevel",
25433
+ params: {
25434
+ level: defaultLoggingLevel
25435
+ }
25436
+ },
25437
+ {}
25438
+ );
25366
25439
  lastRequest = "";
25367
25440
  }
25368
25441
  if (onElicitationRequest) {
@@ -25398,11 +25471,15 @@ function useConnection({
25398
25471
  setCompletionsSupported(false);
25399
25472
  setServerCapabilities(null);
25400
25473
  };
25474
+ const clearRequestHistory = () => {
25475
+ setRequestHistory([]);
25476
+ };
25401
25477
  return {
25402
25478
  connectionStatus,
25403
25479
  serverCapabilities,
25404
25480
  mcpClient,
25405
25481
  requestHistory,
25482
+ clearRequestHistory,
25406
25483
  makeRequest,
25407
25484
  sendNotification,
25408
25485
  handleCompletion,
@@ -26567,6 +26644,7 @@ const OAuthFlowProgress = ({
26567
26644
  updateAuthState,
26568
26645
  proceedToNextStep
26569
26646
  }) => {
26647
+ const { toast: toast2 } = useToast();
26570
26648
  const provider = reactExports.useMemo(
26571
26649
  () => new DebugInspectorOAuthClientProvider(serverUrl),
26572
26650
  [serverUrl]
@@ -26695,13 +26773,26 @@ const OAuthFlowProgress = ({
26695
26773
  children: authState.authorizationUrl && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 p-3 border rounded-md bg-muted", children: [
26696
26774
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium mb-2 text-sm", children: "Authorization URL:" }),
26697
26775
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
26698
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs break-all", children: authState.authorizationUrl }),
26776
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs break-all", children: String(authState.authorizationUrl) }),
26699
26777
  /* @__PURE__ */ jsxRuntimeExports.jsx(
26700
- "a",
26778
+ "button",
26701
26779
  {
26702
- href: authState.authorizationUrl,
26703
- target: "_blank",
26704
- rel: "noopener noreferrer",
26780
+ onClick: () => {
26781
+ try {
26782
+ validateRedirectUrl(authState.authorizationUrl);
26783
+ window.open(
26784
+ authState.authorizationUrl,
26785
+ "_blank",
26786
+ "noopener noreferrer"
26787
+ );
26788
+ } catch (error) {
26789
+ toast2({
26790
+ title: "Invalid URL",
26791
+ description: error instanceof Error ? error.message : "The authorization URL is not valid",
26792
+ variant: "destructive"
26793
+ });
26794
+ }
26795
+ },
26705
26796
  className: "flex items-center text-blue-500 hover:text-blue-700",
26706
26797
  "aria-label": "Open authorization URL in new tab",
26707
26798
  title: "Open authorization URL",
@@ -26787,7 +26878,18 @@ const OAuthFlowProgress = ({
26787
26878
  Button,
26788
26879
  {
26789
26880
  variant: "outline",
26790
- onClick: () => window.open(authState.authorizationUrl, "_blank"),
26881
+ onClick: () => {
26882
+ try {
26883
+ validateRedirectUrl(authState.authorizationUrl);
26884
+ window.open(authState.authorizationUrl, "_blank");
26885
+ } catch (error) {
26886
+ toast2({
26887
+ title: "Invalid URL",
26888
+ description: error instanceof Error ? error.message : "The authorization URL is not valid",
26889
+ variant: "destructive"
26890
+ });
26891
+ }
26892
+ },
26791
26893
  children: "Open in New Tab"
26792
26894
  }
26793
26895
  )
@@ -26915,11 +27017,25 @@ const AuthDebugger = ({
26915
27017
  while (currentState.oauthStep !== "complete") {
26916
27018
  await oauthMachine.executeStep(currentState);
26917
27019
  if (currentState.oauthStep === "authorization_code" && currentState.authorizationUrl) {
27020
+ try {
27021
+ validateRedirectUrl(currentState.authorizationUrl);
27022
+ } catch (error) {
27023
+ updateAuthState({
27024
+ ...currentState,
27025
+ isInitiatingAuth: false,
27026
+ latestError: error instanceof Error ? error : new Error(String(error)),
27027
+ statusMessage: {
27028
+ type: "error",
27029
+ message: `Invalid authorization URL: ${error instanceof Error ? error.message : String(error)}`
27030
+ }
27031
+ });
27032
+ return;
27033
+ }
26918
27034
  sessionStorage.setItem(
26919
27035
  SESSION_KEYS.AUTH_DEBUGGER_STATE,
26920
27036
  JSON.stringify(currentState)
26921
27037
  );
26922
- window.location.href = currentState.authorizationUrl;
27038
+ window.location.href = currentState.authorizationUrl.toString();
26923
27039
  break;
26924
27040
  }
26925
27041
  }
@@ -27310,7 +27426,9 @@ const JsonNode = reactExports.memo(
27310
27426
  JsonNode.displayName = "JsonNode";
27311
27427
  const HistoryAndNotifications = ({
27312
27428
  requestHistory,
27313
- serverNotifications
27429
+ serverNotifications,
27430
+ onClearHistory,
27431
+ onClearNotifications
27314
27432
  }) => {
27315
27433
  const [expandedRequests, setExpandedRequests] = reactExports.useState({});
27316
27434
  const [expandedNotifications, setExpandedNotifications] = reactExports.useState({});
@@ -27322,7 +27440,19 @@ const HistoryAndNotifications = ({
27322
27440
  };
27323
27441
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card overflow-hidden flex h-full", children: [
27324
27442
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-4 border-r", children: [
27325
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold mb-4", children: "History" }),
27443
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
27444
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold", children: "History" }),
27445
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27446
+ Button,
27447
+ {
27448
+ variant: "outline",
27449
+ size: "sm",
27450
+ onClick: onClearHistory,
27451
+ disabled: requestHistory.length === 0,
27452
+ children: "Clear"
27453
+ }
27454
+ )
27455
+ ] }),
27326
27456
  requestHistory.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 italic", children: "No history yet" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-3", children: requestHistory.slice().reverse().map((request, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
27327
27457
  "li",
27328
27458
  {
@@ -27372,7 +27502,19 @@ const HistoryAndNotifications = ({
27372
27502
  )) })
27373
27503
  ] }),
27374
27504
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-4", children: [
27375
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold mb-4", children: "Server Notifications" }),
27505
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
27506
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold", children: "Server Notifications" }),
27507
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27508
+ Button,
27509
+ {
27510
+ variant: "outline",
27511
+ size: "sm",
27512
+ onClick: onClearNotifications,
27513
+ disabled: serverNotifications.length === 0,
27514
+ children: "Clear"
27515
+ }
27516
+ )
27517
+ ] }),
27376
27518
  serverNotifications.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 italic", children: "No notifications yet" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-3", children: serverNotifications.slice().reverse().map((notification, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
27377
27519
  "li",
27378
27520
  {
@@ -30322,15 +30464,9 @@ function getWindowScrollBarX(element, rect) {
30322
30464
  }
30323
30465
  return rect.left + leftScroll;
30324
30466
  }
30325
- function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
30326
- if (ignoreScrollbarX === void 0) {
30327
- ignoreScrollbarX = false;
30328
- }
30467
+ function getHTMLOffset(documentElement, scroll) {
30329
30468
  const htmlRect = documentElement.getBoundingClientRect();
30330
- const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
30331
- // RTL <body> scrollbar.
30332
- getWindowScrollBarX(documentElement, htmlRect)
30333
- ));
30469
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
30334
30470
  const y = htmlRect.top + scroll.scrollTop;
30335
30471
  return {
30336
30472
  x,
@@ -30368,7 +30504,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
30368
30504
  offsets.y = offsetRect.y + offsetParent.clientTop;
30369
30505
  }
30370
30506
  }
30371
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
30507
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
30372
30508
  return {
30373
30509
  width: rect.width * scale.x,
30374
30510
  height: rect.height * scale.y,
@@ -30397,6 +30533,7 @@ function getDocumentRect(element) {
30397
30533
  y
30398
30534
  };
30399
30535
  }
30536
+ const SCROLLBAR_MAX = 25;
30400
30537
  function getViewportRect(element, strategy) {
30401
30538
  const win = getWindow(element);
30402
30539
  const html = getDocumentElement(element);
@@ -30414,6 +30551,19 @@ function getViewportRect(element, strategy) {
30414
30551
  y = visualViewport.offsetTop;
30415
30552
  }
30416
30553
  }
30554
+ const windowScrollbarX = getWindowScrollBarX(html);
30555
+ if (windowScrollbarX <= 0) {
30556
+ const doc = html.ownerDocument;
30557
+ const body = doc.body;
30558
+ const bodyStyles = getComputedStyle(body);
30559
+ const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
30560
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
30561
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
30562
+ width -= clippingStableScrollbarWidth;
30563
+ }
30564
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
30565
+ width += windowScrollbarX;
30566
+ }
30417
30567
  return {
30418
30568
  width,
30419
30569
  height,
@@ -36391,7 +36541,7 @@ const useTheme = () => {
36391
36541
  [theme, setThemeWithSideEffect]
36392
36542
  );
36393
36543
  };
36394
- const version = "0.16.5";
36544
+ const version = "0.16.7";
36395
36545
  var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
36396
36546
  createPopperScope
36397
36547
  ]);
@@ -36896,8 +37046,6 @@ const Sidebar = ({
36896
37046
  setOauthScope,
36897
37047
  onConnect,
36898
37048
  onDisconnect,
36899
- stdErrNotifications,
36900
- clearStdErrNotifications,
36901
37049
  logLevel,
36902
37050
  sendLogLevelRequest,
36903
37051
  loggingSupported,
@@ -36967,7 +37115,7 @@ const Sidebar = ({
36967
37115
  setCopiedServerEntry(true);
36968
37116
  toast2({
36969
37117
  title: "Config entry copied",
36970
- description: transportType === "stdio" ? "Server configuration has been copied to clipboard. Add this to your mcp.json inside the 'mcpServers' object with your preferred server name." : "SSE URL has been copied. Use this URL directly in your MCP Client."
37118
+ description: transportType === "stdio" ? "Server configuration has been copied to clipboard. Add this to your mcp.json inside the 'mcpServers' object with your preferred server name." : transportType === "streamable-http" ? "Streamable HTTP URL has been copied. Use this URL directly in your MCP Client." : "SSE URL has been copied. Use this URL directly in your MCP Client."
36971
37119
  });
36972
37120
  setTimeout(() => {
36973
37121
  setCopiedServerEntry(false);
@@ -37039,6 +37187,7 @@ const Sidebar = ({
37039
37187
  placeholder: "Command",
37040
37188
  value: command,
37041
37189
  onChange: (e) => setCommand(e.target.value),
37190
+ onBlur: (e) => setCommand(e.target.value.trim()),
37042
37191
  className: "font-mono"
37043
37192
  }
37044
37193
  )
@@ -37508,30 +37657,7 @@ const Sidebar = ({
37508
37657
  ]
37509
37658
  }
37510
37659
  )
37511
- ] }),
37512
- stdErrNotifications.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 border-t border-gray-200 pt-4", children: [
37513
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
37514
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium", children: "Error output from MCP server" }),
37515
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37516
- Button,
37517
- {
37518
- variant: "outline",
37519
- size: "sm",
37520
- onClick: clearStdErrNotifications,
37521
- className: "h-8 px-2",
37522
- children: "Clear"
37523
- }
37524
- )
37525
- ] }),
37526
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 max-h-80 overflow-y-auto", children: stdErrNotifications.map((notification, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
37527
- "div",
37528
- {
37529
- className: "text-sm text-red-500 font-mono py-2 border-b border-gray-200 last:border-b-0",
37530
- children: notification.params.content
37531
- },
37532
- index2
37533
- )) })
37534
- ] }) })
37660
+ ] })
37535
37661
  ] })
37536
37662
  ] }) }),
37537
37663
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
@@ -38521,7 +38647,6 @@ const App = () => {
38521
38647
  const [transportType, setTransportType] = reactExports.useState(getInitialTransportType);
38522
38648
  const [logLevel, setLogLevel] = reactExports.useState("debug");
38523
38649
  const [notifications, setNotifications] = reactExports.useState([]);
38524
- const [stdErrNotifications, setStdErrNotifications] = reactExports.useState([]);
38525
38650
  const [roots, setRoots] = reactExports.useState([]);
38526
38651
  const [env, setEnv] = reactExports.useState({});
38527
38652
  const [config, setConfig] = reactExports.useState(
@@ -38580,6 +38705,7 @@ const App = () => {
38580
38705
  serverCapabilities,
38581
38706
  mcpClient,
38582
38707
  requestHistory,
38708
+ clearRequestHistory,
38583
38709
  makeRequest,
38584
38710
  sendNotification,
38585
38711
  handleCompletion,
@@ -38600,12 +38726,6 @@ const App = () => {
38600
38726
  onNotification: (notification) => {
38601
38727
  setNotifications((prev) => [...prev, notification]);
38602
38728
  },
38603
- onStdErrNotification: (notification) => {
38604
- setStdErrNotifications((prev) => [
38605
- ...prev,
38606
- notification
38607
- ]);
38608
- },
38609
38729
  onPendingRequest: (request, resolve, reject) => {
38610
38730
  setPendingSampleRequests((prev) => [
38611
38731
  ...prev,
@@ -39033,6 +39153,9 @@ const App = () => {
39033
39153
  const handleRootsChange = async () => {
39034
39154
  await sendNotification({ method: "notifications/roots/list_changed" });
39035
39155
  };
39156
+ const handleClearNotifications = () => {
39157
+ setNotifications([]);
39158
+ };
39036
39159
  const sendLogLevelRequest = async (level) => {
39037
39160
  await sendMCPRequest(
39038
39161
  {
@@ -39043,9 +39166,6 @@ const App = () => {
39043
39166
  );
39044
39167
  setLogLevel(level);
39045
39168
  };
39046
- const clearStdErrNotifications = () => {
39047
- setStdErrNotifications([]);
39048
- };
39049
39169
  const AuthDebuggerWrapper = () => /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "auth", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
39050
39170
  AuthDebugger,
39051
39171
  {
@@ -39057,13 +39177,13 @@ const App = () => {
39057
39177
  ) });
39058
39178
  if (window.location.pathname === "/oauth/callback") {
39059
39179
  const OAuthCallback = React.lazy(
39060
- () => __vitePreload(() => import("./OAuthCallback-BxZPCak0.js"), true ? [] : void 0)
39180
+ () => __vitePreload(() => import("./OAuthCallback-aXDAN43J.js"), true ? [] : void 0)
39061
39181
  );
39062
39182
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
39063
39183
  }
39064
39184
  if (window.location.pathname === "/oauth/callback/debug") {
39065
39185
  const OAuthDebugCallback = React.lazy(
39066
- () => __vitePreload(() => import("./OAuthDebugCallback-CwfxQhTF.js"), true ? [] : void 0)
39186
+ () => __vitePreload(() => import("./OAuthDebugCallback-BanjyQ_V.js"), true ? [] : void 0)
39067
39187
  );
39068
39188
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
39069
39189
  }
@@ -39105,11 +39225,9 @@ const App = () => {
39105
39225
  setOauthScope,
39106
39226
  onConnect: connectMcpServer,
39107
39227
  onDisconnect: disconnectMcpServer,
39108
- stdErrNotifications,
39109
39228
  logLevel,
39110
39229
  sendLogLevelRequest,
39111
- loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false,
39112
- clearStdErrNotifications
39230
+ loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false
39113
39231
  }
39114
39232
  ),
39115
39233
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -39412,7 +39530,9 @@ const App = () => {
39412
39530
  HistoryAndNotifications,
39413
39531
  {
39414
39532
  requestHistory,
39415
- serverNotifications: notifications
39533
+ serverNotifications: notifications,
39534
+ onClearHistory: clearRequestHistory,
39535
+ onClearNotifications: handleClearNotifications
39416
39536
  }
39417
39537
  ) })
39418
39538
  ]