@modelcontextprotocol/inspector-client 0.16.3 → 0.16.5
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.
- package/dist/assets/{OAuthCallback-DCwiUoWl.js → OAuthCallback-BxZPCak0.js} +1 -2
- package/dist/assets/{OAuthDebugCallback-BNuktUej.js → OAuthDebugCallback-CwfxQhTF.js} +1 -2
- package/dist/assets/{index-CHDvjhl9.js → index-BIvDs4Sc.js} +331 -224
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/oauthUtils-DTcoXpSP.js +0 -33
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { u as useToast, r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-
|
|
2
|
-
import { p as parseOAuthCallbackParams, g as generateOAuthErrorDescription } from "./oauthUtils-DTcoXpSP.js";
|
|
1
|
+
import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-BIvDs4Sc.js";
|
|
3
2
|
const OAuthCallback = ({ onConnect }) => {
|
|
4
3
|
const { toast } = useToast();
|
|
5
4
|
const hasProcessedRef = reactExports.useRef(false);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, S as SESSION_KEYS, j as jsxRuntimeExports } from "./index-
|
|
2
|
-
import { p as parseOAuthCallbackParams, g as generateOAuthErrorDescription } from "./oauthUtils-DTcoXpSP.js";
|
|
1
|
+
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-BIvDs4Sc.js";
|
|
3
2
|
const OAuthDebugCallback = ({ onConnect }) => {
|
|
4
3
|
reactExports.useEffect(() => {
|
|
5
4
|
let isProcessed = false;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2
4
|
function _mergeNamespaces(n, m2) {
|
|
3
5
|
for (var i = 0; i < m2.length; i++) {
|
|
4
6
|
const e = m2[i];
|
|
@@ -1123,13 +1125,13 @@ function requireReactDom_production_min() {
|
|
|
1123
1125
|
function lb(a, b) {
|
|
1124
1126
|
return null == a || "http://www.w3.org/1999/xhtml" === a ? kb(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a;
|
|
1125
1127
|
}
|
|
1126
|
-
var mb, nb = function(a) {
|
|
1128
|
+
var mb, nb = (function(a) {
|
|
1127
1129
|
return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b, c, d, e) {
|
|
1128
1130
|
MSApp.execUnsafeLocalFunction(function() {
|
|
1129
1131
|
return a(b, c, d, e);
|
|
1130
1132
|
});
|
|
1131
1133
|
} : a;
|
|
1132
|
-
}(function(a, b) {
|
|
1134
|
+
})(function(a, b) {
|
|
1133
1135
|
if ("http://www.w3.org/2000/svg" !== a.namespaceURI || "innerHTML" in a) a.innerHTML = b;
|
|
1134
1136
|
else {
|
|
1135
1137
|
mb = mb || document.createElement("div");
|
|
@@ -7809,7 +7811,7 @@ function usePresence(present) {
|
|
|
7809
7811
|
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
7810
7812
|
const handleAnimationEnd = (event) => {
|
|
7811
7813
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
7812
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
7814
|
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
7813
7815
|
if (event.target === node && isCurrentAnimation) {
|
|
7814
7816
|
send("ANIMATION_END");
|
|
7815
7817
|
if (!prevPresentRef.current) {
|
|
@@ -8163,7 +8165,6 @@ var FocusProxy = reactExports.forwardRef(
|
|
|
8163
8165
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8164
8166
|
VisuallyHidden,
|
|
8165
8167
|
{
|
|
8166
|
-
"aria-hidden": true,
|
|
8167
8168
|
tabIndex: 0,
|
|
8168
8169
|
...proxyProps,
|
|
8169
8170
|
ref: forwardedRef,
|
|
@@ -8317,7 +8318,6 @@ var ToastImpl = reactExports.forwardRef(
|
|
|
8317
8318
|
__scopeToast,
|
|
8318
8319
|
role: "status",
|
|
8319
8320
|
"aria-live": type2 === "foreground" ? "assertive" : "polite",
|
|
8320
|
-
"aria-atomic": true,
|
|
8321
8321
|
children: announceTextContent
|
|
8322
8322
|
}
|
|
8323
8323
|
),
|
|
@@ -8333,9 +8333,6 @@ var ToastImpl = reactExports.forwardRef(
|
|
|
8333
8333
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8334
8334
|
Primitive.li,
|
|
8335
8335
|
{
|
|
8336
|
-
role: "status",
|
|
8337
|
-
"aria-live": "off",
|
|
8338
|
-
"aria-atomic": true,
|
|
8339
8336
|
tabIndex: 0,
|
|
8340
8337
|
"data-state": open ? "open" : "closed",
|
|
8341
8338
|
"data-swipe-direction": context.swipeDirection,
|
|
@@ -16258,151 +16255,6 @@ const EMPTY_DEBUGGER_STATE = {
|
|
|
16258
16255
|
statusMessage: null,
|
|
16259
16256
|
validationError: null
|
|
16260
16257
|
};
|
|
16261
|
-
const getClientInformationFromSessionStorage = async ({
|
|
16262
|
-
serverUrl,
|
|
16263
|
-
isPreregistered
|
|
16264
|
-
}) => {
|
|
16265
|
-
const key = getServerSpecificKey(
|
|
16266
|
-
isPreregistered ? SESSION_KEYS.PREREGISTERED_CLIENT_INFORMATION : SESSION_KEYS.CLIENT_INFORMATION,
|
|
16267
|
-
serverUrl
|
|
16268
|
-
);
|
|
16269
|
-
const value = sessionStorage.getItem(key);
|
|
16270
|
-
if (!value) {
|
|
16271
|
-
return void 0;
|
|
16272
|
-
}
|
|
16273
|
-
return await OAuthClientInformationSchema.parseAsync(JSON.parse(value));
|
|
16274
|
-
};
|
|
16275
|
-
const saveClientInformationToSessionStorage = ({
|
|
16276
|
-
serverUrl,
|
|
16277
|
-
clientInformation,
|
|
16278
|
-
isPreregistered
|
|
16279
|
-
}) => {
|
|
16280
|
-
const key = getServerSpecificKey(
|
|
16281
|
-
isPreregistered ? SESSION_KEYS.PREREGISTERED_CLIENT_INFORMATION : SESSION_KEYS.CLIENT_INFORMATION,
|
|
16282
|
-
serverUrl
|
|
16283
|
-
);
|
|
16284
|
-
sessionStorage.setItem(key, JSON.stringify(clientInformation));
|
|
16285
|
-
};
|
|
16286
|
-
const clearClientInformationFromSessionStorage = ({
|
|
16287
|
-
serverUrl,
|
|
16288
|
-
isPreregistered
|
|
16289
|
-
}) => {
|
|
16290
|
-
const key = getServerSpecificKey(
|
|
16291
|
-
isPreregistered ? SESSION_KEYS.PREREGISTERED_CLIENT_INFORMATION : SESSION_KEYS.CLIENT_INFORMATION,
|
|
16292
|
-
serverUrl
|
|
16293
|
-
);
|
|
16294
|
-
sessionStorage.removeItem(key);
|
|
16295
|
-
};
|
|
16296
|
-
class InspectorOAuthClientProvider {
|
|
16297
|
-
constructor(serverUrl) {
|
|
16298
|
-
this.serverUrl = serverUrl;
|
|
16299
|
-
sessionStorage.setItem(SESSION_KEYS.SERVER_URL, serverUrl);
|
|
16300
|
-
}
|
|
16301
|
-
get redirectUrl() {
|
|
16302
|
-
return window.location.origin + "/oauth/callback";
|
|
16303
|
-
}
|
|
16304
|
-
get clientMetadata() {
|
|
16305
|
-
return {
|
|
16306
|
-
redirect_uris: [this.redirectUrl],
|
|
16307
|
-
token_endpoint_auth_method: "none",
|
|
16308
|
-
grant_types: ["authorization_code", "refresh_token"],
|
|
16309
|
-
response_types: ["code"],
|
|
16310
|
-
client_name: "MCP Inspector",
|
|
16311
|
-
client_uri: "https://github.com/modelcontextprotocol/inspector"
|
|
16312
|
-
};
|
|
16313
|
-
}
|
|
16314
|
-
async clientInformation() {
|
|
16315
|
-
const preregisteredClientInformation = await getClientInformationFromSessionStorage({
|
|
16316
|
-
serverUrl: this.serverUrl,
|
|
16317
|
-
isPreregistered: true
|
|
16318
|
-
});
|
|
16319
|
-
return preregisteredClientInformation ?? await getClientInformationFromSessionStorage({
|
|
16320
|
-
serverUrl: this.serverUrl,
|
|
16321
|
-
isPreregistered: false
|
|
16322
|
-
});
|
|
16323
|
-
}
|
|
16324
|
-
saveClientInformation(clientInformation) {
|
|
16325
|
-
saveClientInformationToSessionStorage({
|
|
16326
|
-
serverUrl: this.serverUrl,
|
|
16327
|
-
clientInformation,
|
|
16328
|
-
isPreregistered: false
|
|
16329
|
-
});
|
|
16330
|
-
}
|
|
16331
|
-
async tokens() {
|
|
16332
|
-
const key = getServerSpecificKey(SESSION_KEYS.TOKENS, this.serverUrl);
|
|
16333
|
-
const tokens = sessionStorage.getItem(key);
|
|
16334
|
-
if (!tokens) {
|
|
16335
|
-
return void 0;
|
|
16336
|
-
}
|
|
16337
|
-
return await OAuthTokensSchema.parseAsync(JSON.parse(tokens));
|
|
16338
|
-
}
|
|
16339
|
-
saveTokens(tokens) {
|
|
16340
|
-
const key = getServerSpecificKey(SESSION_KEYS.TOKENS, this.serverUrl);
|
|
16341
|
-
sessionStorage.setItem(key, JSON.stringify(tokens));
|
|
16342
|
-
}
|
|
16343
|
-
redirectToAuthorization(authorizationUrl) {
|
|
16344
|
-
window.location.href = authorizationUrl.href;
|
|
16345
|
-
}
|
|
16346
|
-
saveCodeVerifier(codeVerifier) {
|
|
16347
|
-
const key = getServerSpecificKey(
|
|
16348
|
-
SESSION_KEYS.CODE_VERIFIER,
|
|
16349
|
-
this.serverUrl
|
|
16350
|
-
);
|
|
16351
|
-
sessionStorage.setItem(key, codeVerifier);
|
|
16352
|
-
}
|
|
16353
|
-
codeVerifier() {
|
|
16354
|
-
const key = getServerSpecificKey(
|
|
16355
|
-
SESSION_KEYS.CODE_VERIFIER,
|
|
16356
|
-
this.serverUrl
|
|
16357
|
-
);
|
|
16358
|
-
const verifier = sessionStorage.getItem(key);
|
|
16359
|
-
if (!verifier) {
|
|
16360
|
-
throw new Error("No code verifier saved for session");
|
|
16361
|
-
}
|
|
16362
|
-
return verifier;
|
|
16363
|
-
}
|
|
16364
|
-
clear() {
|
|
16365
|
-
clearClientInformationFromSessionStorage({
|
|
16366
|
-
serverUrl: this.serverUrl,
|
|
16367
|
-
isPreregistered: false
|
|
16368
|
-
});
|
|
16369
|
-
sessionStorage.removeItem(
|
|
16370
|
-
getServerSpecificKey(SESSION_KEYS.TOKENS, this.serverUrl)
|
|
16371
|
-
);
|
|
16372
|
-
sessionStorage.removeItem(
|
|
16373
|
-
getServerSpecificKey(SESSION_KEYS.CODE_VERIFIER, this.serverUrl)
|
|
16374
|
-
);
|
|
16375
|
-
}
|
|
16376
|
-
}
|
|
16377
|
-
class DebugInspectorOAuthClientProvider extends InspectorOAuthClientProvider {
|
|
16378
|
-
get redirectUrl() {
|
|
16379
|
-
return `${window.location.origin}/oauth/callback/debug`;
|
|
16380
|
-
}
|
|
16381
|
-
saveServerMetadata(metadata) {
|
|
16382
|
-
const key = getServerSpecificKey(
|
|
16383
|
-
SESSION_KEYS.SERVER_METADATA,
|
|
16384
|
-
this.serverUrl
|
|
16385
|
-
);
|
|
16386
|
-
sessionStorage.setItem(key, JSON.stringify(metadata));
|
|
16387
|
-
}
|
|
16388
|
-
getServerMetadata() {
|
|
16389
|
-
const key = getServerSpecificKey(
|
|
16390
|
-
SESSION_KEYS.SERVER_METADATA,
|
|
16391
|
-
this.serverUrl
|
|
16392
|
-
);
|
|
16393
|
-
const metadata = sessionStorage.getItem(key);
|
|
16394
|
-
if (!metadata) {
|
|
16395
|
-
return null;
|
|
16396
|
-
}
|
|
16397
|
-
return JSON.parse(metadata);
|
|
16398
|
-
}
|
|
16399
|
-
clear() {
|
|
16400
|
-
super.clear();
|
|
16401
|
-
sessionStorage.removeItem(
|
|
16402
|
-
getServerSpecificKey(SESSION_KEYS.SERVER_METADATA, this.serverUrl)
|
|
16403
|
-
);
|
|
16404
|
-
}
|
|
16405
|
-
}
|
|
16406
16258
|
let crypto$1;
|
|
16407
16259
|
crypto$1 = globalThis.crypto;
|
|
16408
16260
|
async function getRandomValues(size2) {
|
|
@@ -16653,7 +16505,8 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res
|
|
|
16653
16505
|
}
|
|
16654
16506
|
const fullInformation = await registerClient(authorizationServerUrl, {
|
|
16655
16507
|
metadata,
|
|
16656
|
-
clientMetadata: provider.clientMetadata
|
|
16508
|
+
clientMetadata: provider.clientMetadata,
|
|
16509
|
+
fetchFn
|
|
16657
16510
|
});
|
|
16658
16511
|
await provider.saveClientInformation(fullInformation);
|
|
16659
16512
|
clientInformation = fullInformation;
|
|
@@ -16681,7 +16534,8 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res
|
|
|
16681
16534
|
clientInformation,
|
|
16682
16535
|
refreshToken: tokens.refresh_token,
|
|
16683
16536
|
resource,
|
|
16684
|
-
addClientAuthentication: provider.addClientAuthentication
|
|
16537
|
+
addClientAuthentication: provider.addClientAuthentication,
|
|
16538
|
+
fetchFn
|
|
16685
16539
|
});
|
|
16686
16540
|
await provider.saveTokens(newTokens);
|
|
16687
16541
|
return "AUTHORIZED";
|
|
@@ -16799,29 +16653,6 @@ async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, o
|
|
|
16799
16653
|
}
|
|
16800
16654
|
return response;
|
|
16801
16655
|
}
|
|
16802
|
-
async function discoverOAuthMetadata(issuer, { authorizationServerUrl, protocolVersion } = {}, fetchFn = fetch) {
|
|
16803
|
-
if (typeof issuer === "string") {
|
|
16804
|
-
issuer = new URL(issuer);
|
|
16805
|
-
}
|
|
16806
|
-
if (!authorizationServerUrl) {
|
|
16807
|
-
authorizationServerUrl = issuer;
|
|
16808
|
-
}
|
|
16809
|
-
if (typeof authorizationServerUrl === "string") {
|
|
16810
|
-
authorizationServerUrl = new URL(authorizationServerUrl);
|
|
16811
|
-
}
|
|
16812
|
-
protocolVersion !== null && protocolVersion !== void 0 ? protocolVersion : protocolVersion = LATEST_PROTOCOL_VERSION;
|
|
16813
|
-
const response = await discoverMetadataWithFallback(authorizationServerUrl, "oauth-authorization-server", fetchFn, {
|
|
16814
|
-
protocolVersion,
|
|
16815
|
-
metadataServerUrl: authorizationServerUrl
|
|
16816
|
-
});
|
|
16817
|
-
if (!response || response.status === 404) {
|
|
16818
|
-
return void 0;
|
|
16819
|
-
}
|
|
16820
|
-
if (!response.ok) {
|
|
16821
|
-
throw new Error(`HTTP ${response.status} trying to load well-known OAuth metadata`);
|
|
16822
|
-
}
|
|
16823
|
-
return OAuthMetadataSchema.parse(await response.json());
|
|
16824
|
-
}
|
|
16825
16656
|
function buildDiscoveryUrls(authorizationServerUrl) {
|
|
16826
16657
|
const url = typeof authorizationServerUrl === "string" ? new URL(authorizationServerUrl) : authorizationServerUrl;
|
|
16827
16658
|
const hasPath = url.pathname !== "/";
|
|
@@ -17021,6 +16852,215 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata
|
|
|
17021
16852
|
}
|
|
17022
16853
|
return OAuthClientInformationFullSchema.parse(await response.json());
|
|
17023
16854
|
}
|
|
16855
|
+
const parseOAuthCallbackParams = (location) => {
|
|
16856
|
+
const params = new URLSearchParams(location);
|
|
16857
|
+
const code = params.get("code");
|
|
16858
|
+
if (code) {
|
|
16859
|
+
return { successful: true, code };
|
|
16860
|
+
}
|
|
16861
|
+
const error = params.get("error");
|
|
16862
|
+
const error_description = params.get("error_description");
|
|
16863
|
+
const error_uri = params.get("error_uri");
|
|
16864
|
+
if (error) {
|
|
16865
|
+
return { successful: false, error, error_description, error_uri };
|
|
16866
|
+
}
|
|
16867
|
+
return {
|
|
16868
|
+
successful: false,
|
|
16869
|
+
error: "invalid_request",
|
|
16870
|
+
error_description: "Missing code or error in response",
|
|
16871
|
+
error_uri: null
|
|
16872
|
+
};
|
|
16873
|
+
};
|
|
16874
|
+
const generateOAuthState = () => {
|
|
16875
|
+
const array = new Uint8Array(32);
|
|
16876
|
+
crypto.getRandomValues(array);
|
|
16877
|
+
return Array.from(array, (byte) => byte.toString(16).padStart(2, "0")).join(
|
|
16878
|
+
""
|
|
16879
|
+
);
|
|
16880
|
+
};
|
|
16881
|
+
const generateOAuthErrorDescription = (params) => {
|
|
16882
|
+
const error = params.error;
|
|
16883
|
+
const errorDescription = params.error_description;
|
|
16884
|
+
const errorUri = params.error_uri;
|
|
16885
|
+
return [
|
|
16886
|
+
`Error: ${error}.`,
|
|
16887
|
+
errorDescription ? `Details: ${errorDescription}.` : "",
|
|
16888
|
+
errorUri ? `More info: ${errorUri}.` : ""
|
|
16889
|
+
].filter(Boolean).join("\n");
|
|
16890
|
+
};
|
|
16891
|
+
const discoverScopes = async (serverUrl, resourceMetadata) => {
|
|
16892
|
+
try {
|
|
16893
|
+
const metadata = await discoverAuthorizationServerMetadata(
|
|
16894
|
+
new URL("/", serverUrl)
|
|
16895
|
+
);
|
|
16896
|
+
const resourceScopes = resourceMetadata == null ? void 0 : resourceMetadata.scopes_supported;
|
|
16897
|
+
const oauthScopes = metadata == null ? void 0 : metadata.scopes_supported;
|
|
16898
|
+
const scopesSupported = resourceScopes && resourceScopes.length > 0 ? resourceScopes : oauthScopes;
|
|
16899
|
+
return scopesSupported && scopesSupported.length > 0 ? scopesSupported.join(" ") : void 0;
|
|
16900
|
+
} catch (error) {
|
|
16901
|
+
console.debug("OAuth scope discovery failed:", error);
|
|
16902
|
+
return void 0;
|
|
16903
|
+
}
|
|
16904
|
+
};
|
|
16905
|
+
const getClientInformationFromSessionStorage = async ({
|
|
16906
|
+
serverUrl,
|
|
16907
|
+
isPreregistered
|
|
16908
|
+
}) => {
|
|
16909
|
+
const key = getServerSpecificKey(
|
|
16910
|
+
isPreregistered ? SESSION_KEYS.PREREGISTERED_CLIENT_INFORMATION : SESSION_KEYS.CLIENT_INFORMATION,
|
|
16911
|
+
serverUrl
|
|
16912
|
+
);
|
|
16913
|
+
const value = sessionStorage.getItem(key);
|
|
16914
|
+
if (!value) {
|
|
16915
|
+
return void 0;
|
|
16916
|
+
}
|
|
16917
|
+
return await OAuthClientInformationSchema.parseAsync(JSON.parse(value));
|
|
16918
|
+
};
|
|
16919
|
+
const saveClientInformationToSessionStorage = ({
|
|
16920
|
+
serverUrl,
|
|
16921
|
+
clientInformation,
|
|
16922
|
+
isPreregistered
|
|
16923
|
+
}) => {
|
|
16924
|
+
const key = getServerSpecificKey(
|
|
16925
|
+
isPreregistered ? SESSION_KEYS.PREREGISTERED_CLIENT_INFORMATION : SESSION_KEYS.CLIENT_INFORMATION,
|
|
16926
|
+
serverUrl
|
|
16927
|
+
);
|
|
16928
|
+
sessionStorage.setItem(key, JSON.stringify(clientInformation));
|
|
16929
|
+
};
|
|
16930
|
+
const clearClientInformationFromSessionStorage = ({
|
|
16931
|
+
serverUrl,
|
|
16932
|
+
isPreregistered
|
|
16933
|
+
}) => {
|
|
16934
|
+
const key = getServerSpecificKey(
|
|
16935
|
+
isPreregistered ? SESSION_KEYS.PREREGISTERED_CLIENT_INFORMATION : SESSION_KEYS.CLIENT_INFORMATION,
|
|
16936
|
+
serverUrl
|
|
16937
|
+
);
|
|
16938
|
+
sessionStorage.removeItem(key);
|
|
16939
|
+
};
|
|
16940
|
+
class InspectorOAuthClientProvider {
|
|
16941
|
+
constructor(serverUrl, scope) {
|
|
16942
|
+
__publicField(this, "scope");
|
|
16943
|
+
this.serverUrl = serverUrl;
|
|
16944
|
+
this.scope = scope;
|
|
16945
|
+
sessionStorage.setItem(SESSION_KEYS.SERVER_URL, serverUrl);
|
|
16946
|
+
}
|
|
16947
|
+
get redirectUrl() {
|
|
16948
|
+
return window.location.origin + "/oauth/callback";
|
|
16949
|
+
}
|
|
16950
|
+
get clientMetadata() {
|
|
16951
|
+
return {
|
|
16952
|
+
redirect_uris: [this.redirectUrl],
|
|
16953
|
+
token_endpoint_auth_method: "none",
|
|
16954
|
+
grant_types: ["authorization_code", "refresh_token"],
|
|
16955
|
+
response_types: ["code"],
|
|
16956
|
+
client_name: "MCP Inspector",
|
|
16957
|
+
client_uri: "https://github.com/modelcontextprotocol/inspector",
|
|
16958
|
+
scope: this.scope ?? ""
|
|
16959
|
+
};
|
|
16960
|
+
}
|
|
16961
|
+
state() {
|
|
16962
|
+
return generateOAuthState();
|
|
16963
|
+
}
|
|
16964
|
+
async clientInformation() {
|
|
16965
|
+
const preregisteredClientInformation = await getClientInformationFromSessionStorage({
|
|
16966
|
+
serverUrl: this.serverUrl,
|
|
16967
|
+
isPreregistered: true
|
|
16968
|
+
});
|
|
16969
|
+
return preregisteredClientInformation ?? await getClientInformationFromSessionStorage({
|
|
16970
|
+
serverUrl: this.serverUrl,
|
|
16971
|
+
isPreregistered: false
|
|
16972
|
+
});
|
|
16973
|
+
}
|
|
16974
|
+
saveClientInformation(clientInformation) {
|
|
16975
|
+
const safeInfo = Object.fromEntries(
|
|
16976
|
+
Object.entries(clientInformation).filter(
|
|
16977
|
+
([key]) => key !== "client_secret"
|
|
16978
|
+
)
|
|
16979
|
+
);
|
|
16980
|
+
saveClientInformationToSessionStorage({
|
|
16981
|
+
serverUrl: this.serverUrl,
|
|
16982
|
+
clientInformation: safeInfo,
|
|
16983
|
+
isPreregistered: false
|
|
16984
|
+
});
|
|
16985
|
+
}
|
|
16986
|
+
async tokens() {
|
|
16987
|
+
const key = getServerSpecificKey(SESSION_KEYS.TOKENS, this.serverUrl);
|
|
16988
|
+
const tokens = sessionStorage.getItem(key);
|
|
16989
|
+
if (!tokens) {
|
|
16990
|
+
return void 0;
|
|
16991
|
+
}
|
|
16992
|
+
return await OAuthTokensSchema.parseAsync(JSON.parse(tokens));
|
|
16993
|
+
}
|
|
16994
|
+
saveTokens(tokens) {
|
|
16995
|
+
const key = getServerSpecificKey(SESSION_KEYS.TOKENS, this.serverUrl);
|
|
16996
|
+
sessionStorage.setItem(key, JSON.stringify(tokens));
|
|
16997
|
+
}
|
|
16998
|
+
redirectToAuthorization(authorizationUrl) {
|
|
16999
|
+
if (authorizationUrl.protocol !== "http:" && authorizationUrl.protocol !== "https:") {
|
|
17000
|
+
throw new Error("Authorization URL must be HTTP or HTTPS");
|
|
17001
|
+
}
|
|
17002
|
+
window.location.href = authorizationUrl.href;
|
|
17003
|
+
}
|
|
17004
|
+
saveCodeVerifier(codeVerifier) {
|
|
17005
|
+
const key = getServerSpecificKey(
|
|
17006
|
+
SESSION_KEYS.CODE_VERIFIER,
|
|
17007
|
+
this.serverUrl
|
|
17008
|
+
);
|
|
17009
|
+
sessionStorage.setItem(key, codeVerifier);
|
|
17010
|
+
}
|
|
17011
|
+
codeVerifier() {
|
|
17012
|
+
const key = getServerSpecificKey(
|
|
17013
|
+
SESSION_KEYS.CODE_VERIFIER,
|
|
17014
|
+
this.serverUrl
|
|
17015
|
+
);
|
|
17016
|
+
const verifier = sessionStorage.getItem(key);
|
|
17017
|
+
if (!verifier) {
|
|
17018
|
+
throw new Error("No code verifier saved for session");
|
|
17019
|
+
}
|
|
17020
|
+
return verifier;
|
|
17021
|
+
}
|
|
17022
|
+
clear() {
|
|
17023
|
+
clearClientInformationFromSessionStorage({
|
|
17024
|
+
serverUrl: this.serverUrl,
|
|
17025
|
+
isPreregistered: false
|
|
17026
|
+
});
|
|
17027
|
+
sessionStorage.removeItem(
|
|
17028
|
+
getServerSpecificKey(SESSION_KEYS.TOKENS, this.serverUrl)
|
|
17029
|
+
);
|
|
17030
|
+
sessionStorage.removeItem(
|
|
17031
|
+
getServerSpecificKey(SESSION_KEYS.CODE_VERIFIER, this.serverUrl)
|
|
17032
|
+
);
|
|
17033
|
+
}
|
|
17034
|
+
}
|
|
17035
|
+
class DebugInspectorOAuthClientProvider extends InspectorOAuthClientProvider {
|
|
17036
|
+
get redirectUrl() {
|
|
17037
|
+
return `${window.location.origin}/oauth/callback/debug`;
|
|
17038
|
+
}
|
|
17039
|
+
saveServerMetadata(metadata) {
|
|
17040
|
+
const key = getServerSpecificKey(
|
|
17041
|
+
SESSION_KEYS.SERVER_METADATA,
|
|
17042
|
+
this.serverUrl
|
|
17043
|
+
);
|
|
17044
|
+
sessionStorage.setItem(key, JSON.stringify(metadata));
|
|
17045
|
+
}
|
|
17046
|
+
getServerMetadata() {
|
|
17047
|
+
const key = getServerSpecificKey(
|
|
17048
|
+
SESSION_KEYS.SERVER_METADATA,
|
|
17049
|
+
this.serverUrl
|
|
17050
|
+
);
|
|
17051
|
+
const metadata = sessionStorage.getItem(key);
|
|
17052
|
+
if (!metadata) {
|
|
17053
|
+
return null;
|
|
17054
|
+
}
|
|
17055
|
+
return JSON.parse(metadata);
|
|
17056
|
+
}
|
|
17057
|
+
clear() {
|
|
17058
|
+
super.clear();
|
|
17059
|
+
sessionStorage.removeItem(
|
|
17060
|
+
getServerSpecificKey(SESSION_KEYS.SERVER_METADATA, this.serverUrl)
|
|
17061
|
+
);
|
|
17062
|
+
}
|
|
17063
|
+
}
|
|
17024
17064
|
const oauthTransitions = {
|
|
17025
17065
|
metadata_discovery: {
|
|
17026
17066
|
canTransition: async () => true,
|
|
@@ -17049,7 +17089,7 @@ const oauthTransitions = {
|
|
|
17049
17089
|
// we default to null, so swap it for undefined if not set
|
|
17050
17090
|
resourceMetadata ?? void 0
|
|
17051
17091
|
);
|
|
17052
|
-
const metadata = await
|
|
17092
|
+
const metadata = await discoverAuthorizationServerMetadata(authServerUrl);
|
|
17053
17093
|
if (!metadata) {
|
|
17054
17094
|
throw new Error("Failed to discover OAuth metadata");
|
|
17055
17095
|
}
|
|
@@ -17075,11 +17115,14 @@ const oauthTransitions = {
|
|
|
17075
17115
|
if (scopesSupported) {
|
|
17076
17116
|
clientMetadata.scope = scopesSupported.join(" ");
|
|
17077
17117
|
}
|
|
17078
|
-
|
|
17079
|
-
|
|
17080
|
-
|
|
17081
|
-
|
|
17082
|
-
|
|
17118
|
+
let fullInformation = await context.provider.clientInformation();
|
|
17119
|
+
if (!fullInformation) {
|
|
17120
|
+
fullInformation = await registerClient(context.serverUrl, {
|
|
17121
|
+
metadata,
|
|
17122
|
+
clientMetadata
|
|
17123
|
+
});
|
|
17124
|
+
context.provider.saveClientInformation(fullInformation);
|
|
17125
|
+
}
|
|
17083
17126
|
context.updateState({
|
|
17084
17127
|
oauthClientInfo: fullInformation,
|
|
17085
17128
|
oauthStep: "authorization_redirect"
|
|
@@ -17091,16 +17134,10 @@ const oauthTransitions = {
|
|
|
17091
17134
|
execute: async (context) => {
|
|
17092
17135
|
const metadata = context.state.oauthMetadata;
|
|
17093
17136
|
const clientInformation = context.state.oauthClientInfo;
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
const array = new Uint8Array(32);
|
|
17099
|
-
crypto.getRandomValues(array);
|
|
17100
|
-
const state = Array.from(
|
|
17101
|
-
array,
|
|
17102
|
-
(byte) => byte.toString(16).padStart(2, "0")
|
|
17103
|
-
).join("");
|
|
17137
|
+
const scope = await discoverScopes(
|
|
17138
|
+
context.serverUrl,
|
|
17139
|
+
context.state.resourceMetadata ?? void 0
|
|
17140
|
+
);
|
|
17104
17141
|
const { authorizationUrl, codeVerifier } = await startAuthorization(
|
|
17105
17142
|
context.serverUrl,
|
|
17106
17143
|
{
|
|
@@ -17108,7 +17145,7 @@ const oauthTransitions = {
|
|
|
17108
17145
|
clientInformation,
|
|
17109
17146
|
redirectUrl: context.provider.redirectUrl,
|
|
17110
17147
|
scope,
|
|
17111
|
-
state,
|
|
17148
|
+
state: generateOAuthState(),
|
|
17112
17149
|
resource: context.state.resource ?? void 0
|
|
17113
17150
|
}
|
|
17114
17151
|
);
|
|
@@ -17148,7 +17185,7 @@ const oauthTransitions = {
|
|
|
17148
17185
|
authorizationCode: context.state.authorizationCode,
|
|
17149
17186
|
codeVerifier,
|
|
17150
17187
|
redirectUri: context.provider.redirectUrl,
|
|
17151
|
-
resource: context.state.resource
|
|
17188
|
+
resource: context.state.resource ? context.state.resource instanceof URL ? context.state.resource : new URL(context.state.resource) : void 0
|
|
17152
17189
|
});
|
|
17153
17190
|
context.provider.saveTokens(tokens);
|
|
17154
17191
|
context.updateState({
|
|
@@ -17193,7 +17230,7 @@ function requireUri_all() {
|
|
|
17193
17230
|
(function(module, exports) {
|
|
17194
17231
|
(function(global2, factory) {
|
|
17195
17232
|
factory(exports);
|
|
17196
|
-
})(uri_all, function(exports2) {
|
|
17233
|
+
})(uri_all, (function(exports2) {
|
|
17197
17234
|
function merge() {
|
|
17198
17235
|
for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
|
|
17199
17236
|
sets[_key] = arguments[_key];
|
|
@@ -17260,7 +17297,7 @@ function requireUri_all() {
|
|
|
17260
17297
|
}
|
|
17261
17298
|
var URI_PROTOCOL = buildExps(false);
|
|
17262
17299
|
var IRI_PROTOCOL = buildExps(true);
|
|
17263
|
-
var slicedToArray = /* @__PURE__ */ function() {
|
|
17300
|
+
var slicedToArray = /* @__PURE__ */ (function() {
|
|
17264
17301
|
function sliceIterator(arr, i) {
|
|
17265
17302
|
var _arr = [];
|
|
17266
17303
|
var _n = true;
|
|
@@ -17292,7 +17329,7 @@ function requireUri_all() {
|
|
|
17292
17329
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
17293
17330
|
}
|
|
17294
17331
|
};
|
|
17295
|
-
}();
|
|
17332
|
+
})();
|
|
17296
17333
|
var toConsumableArray = function(arr) {
|
|
17297
17334
|
if (Array.isArray(arr)) {
|
|
17298
17335
|
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
@@ -18207,7 +18244,7 @@ function requireUri_all() {
|
|
|
18207
18244
|
exports2.escapeComponent = escapeComponent;
|
|
18208
18245
|
exports2.unescapeComponent = unescapeComponent;
|
|
18209
18246
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
18210
|
-
});
|
|
18247
|
+
}));
|
|
18211
18248
|
})(uri_all$1, uri_all$1.exports);
|
|
18212
18249
|
return uri_all$1.exports;
|
|
18213
18250
|
}
|
|
@@ -18801,7 +18838,7 @@ function requireFastJsonStableStringify() {
|
|
|
18801
18838
|
if (!opts) opts = {};
|
|
18802
18839
|
if (typeof opts === "function") opts = { cmp: opts };
|
|
18803
18840
|
var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
|
|
18804
|
-
var cmp = opts.cmp && /* @__PURE__ */ function(f) {
|
|
18841
|
+
var cmp = opts.cmp && /* @__PURE__ */ (function(f) {
|
|
18805
18842
|
return function(node) {
|
|
18806
18843
|
return function(a, b) {
|
|
18807
18844
|
var aobj = { key: a, value: node[a] };
|
|
@@ -18809,9 +18846,9 @@ function requireFastJsonStableStringify() {
|
|
|
18809
18846
|
return f(aobj, bobj);
|
|
18810
18847
|
};
|
|
18811
18848
|
};
|
|
18812
|
-
}(opts.cmp);
|
|
18849
|
+
})(opts.cmp);
|
|
18813
18850
|
var seen2 = [];
|
|
18814
|
-
return function stringify(node) {
|
|
18851
|
+
return (function stringify(node) {
|
|
18815
18852
|
if (node && node.toJSON && typeof node.toJSON === "function") {
|
|
18816
18853
|
node = node.toJSON();
|
|
18817
18854
|
}
|
|
@@ -18844,7 +18881,7 @@ function requireFastJsonStableStringify() {
|
|
|
18844
18881
|
}
|
|
18845
18882
|
seen2.splice(seenIndex, 1);
|
|
18846
18883
|
return "{" + out + "}";
|
|
18847
|
-
}(data2);
|
|
18884
|
+
})(data2);
|
|
18848
18885
|
};
|
|
18849
18886
|
return fastJsonStableStringify;
|
|
18850
18887
|
}
|
|
@@ -23297,6 +23334,33 @@ function isPropertyRequired(propertyName, schema) {
|
|
|
23297
23334
|
var _a;
|
|
23298
23335
|
return ((_a = schema.required) == null ? void 0 : _a.includes(propertyName)) ?? false;
|
|
23299
23336
|
}
|
|
23337
|
+
function normalizeUnionType(schema) {
|
|
23338
|
+
if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "string") && schema.anyOf.some((t) => t.type === "null")) {
|
|
23339
|
+
return { ...schema, type: "string", anyOf: void 0 };
|
|
23340
|
+
}
|
|
23341
|
+
if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "boolean") && schema.anyOf.some((t) => t.type === "null")) {
|
|
23342
|
+
return { ...schema, type: "boolean", anyOf: void 0 };
|
|
23343
|
+
}
|
|
23344
|
+
if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "number") && schema.anyOf.some((t) => t.type === "null")) {
|
|
23345
|
+
return { ...schema, type: "number", anyOf: void 0 };
|
|
23346
|
+
}
|
|
23347
|
+
if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "integer") && schema.anyOf.some((t) => t.type === "null")) {
|
|
23348
|
+
return { ...schema, type: "integer", anyOf: void 0 };
|
|
23349
|
+
}
|
|
23350
|
+
if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("string") && schema.type.includes("null")) {
|
|
23351
|
+
return { ...schema, type: "string" };
|
|
23352
|
+
}
|
|
23353
|
+
if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("boolean") && schema.type.includes("null")) {
|
|
23354
|
+
return { ...schema, type: "boolean" };
|
|
23355
|
+
}
|
|
23356
|
+
if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("number") && schema.type.includes("null")) {
|
|
23357
|
+
return { ...schema, type: "number" };
|
|
23358
|
+
}
|
|
23359
|
+
if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("integer") && schema.type.includes("null")) {
|
|
23360
|
+
return { ...schema, type: "integer" };
|
|
23361
|
+
}
|
|
23362
|
+
return schema;
|
|
23363
|
+
}
|
|
23300
23364
|
const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
23301
23365
|
class Protocol {
|
|
23302
23366
|
constructor(_options) {
|
|
@@ -24786,7 +24850,7 @@ const StdErrNotificationSchema = NotificationSchema.extend({
|
|
|
24786
24850
|
ClientNotificationSchema.or(
|
|
24787
24851
|
StdErrNotificationSchema
|
|
24788
24852
|
).or(ServerNotificationSchema).or(NotificationSchema);
|
|
24789
|
-
const version$1 = "0.16.
|
|
24853
|
+
const version$1 = "0.16.5";
|
|
24790
24854
|
const packageJson = {
|
|
24791
24855
|
version: version$1
|
|
24792
24856
|
};
|
|
@@ -25089,10 +25153,24 @@ function useConnection({
|
|
|
25089
25153
|
};
|
|
25090
25154
|
const handleAuthError = async (error) => {
|
|
25091
25155
|
if (is401Error(error)) {
|
|
25092
|
-
|
|
25156
|
+
let scope = oauthScope == null ? void 0 : oauthScope.trim();
|
|
25157
|
+
if (!scope) {
|
|
25158
|
+
let resourceMetadata;
|
|
25159
|
+
try {
|
|
25160
|
+
resourceMetadata = await discoverOAuthProtectedResourceMetadata(
|
|
25161
|
+
new URL("/", sseUrl)
|
|
25162
|
+
);
|
|
25163
|
+
} catch {
|
|
25164
|
+
}
|
|
25165
|
+
scope = await discoverScopes(sseUrl, resourceMetadata);
|
|
25166
|
+
}
|
|
25167
|
+
const serverAuthProvider = new InspectorOAuthClientProvider(
|
|
25168
|
+
sseUrl,
|
|
25169
|
+
scope
|
|
25170
|
+
);
|
|
25093
25171
|
const result = await auth(serverAuthProvider, {
|
|
25094
25172
|
serverUrl: sseUrl,
|
|
25095
|
-
scope
|
|
25173
|
+
scope
|
|
25096
25174
|
});
|
|
25097
25175
|
return result === "AUTHORIZED";
|
|
25098
25176
|
}
|
|
@@ -25121,6 +25199,7 @@ function useConnection({
|
|
|
25121
25199
|
setConnectionStatus("error-connecting-to-proxy");
|
|
25122
25200
|
return;
|
|
25123
25201
|
}
|
|
25202
|
+
let lastRequest = "";
|
|
25124
25203
|
try {
|
|
25125
25204
|
const headers = {};
|
|
25126
25205
|
const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl);
|
|
@@ -25282,7 +25361,9 @@ function useConnection({
|
|
|
25282
25361
|
});
|
|
25283
25362
|
}
|
|
25284
25363
|
if ((capabilities == null ? void 0 : capabilities.logging) && defaultLoggingLevel) {
|
|
25364
|
+
lastRequest = "logging/setLevel";
|
|
25285
25365
|
await client2.setLoggingLevel(defaultLoggingLevel);
|
|
25366
|
+
lastRequest = "";
|
|
25286
25367
|
}
|
|
25287
25368
|
if (onElicitationRequest) {
|
|
25288
25369
|
client2.setRequestHandler(ElicitRequestSchema, async (request) => {
|
|
@@ -25294,6 +25375,13 @@ function useConnection({
|
|
|
25294
25375
|
setMcpClient(client2);
|
|
25295
25376
|
setConnectionStatus("connected");
|
|
25296
25377
|
} catch (e) {
|
|
25378
|
+
if (lastRequest === "logging/setLevel" && e instanceof McpError && e.code === ErrorCode.MethodNotFound) {
|
|
25379
|
+
toast2({
|
|
25380
|
+
title: "Error",
|
|
25381
|
+
description: `Server declares logging capability but doesn't implement method: "${lastRequest}"`,
|
|
25382
|
+
variant: "destructive"
|
|
25383
|
+
});
|
|
25384
|
+
}
|
|
25297
25385
|
console.error(e);
|
|
25298
25386
|
setConnectionStatus("error");
|
|
25299
25387
|
}
|
|
@@ -31058,8 +31146,13 @@ var PopperAnchor = reactExports.forwardRef(
|
|
|
31058
31146
|
const context = usePopperContext(ANCHOR_NAME$1, __scopePopper);
|
|
31059
31147
|
const ref2 = reactExports.useRef(null);
|
|
31060
31148
|
const composedRefs = useComposedRefs(forwardedRef, ref2);
|
|
31149
|
+
const anchorRef = reactExports.useRef(null);
|
|
31061
31150
|
reactExports.useEffect(() => {
|
|
31062
|
-
|
|
31151
|
+
const previousAnchor = anchorRef.current;
|
|
31152
|
+
anchorRef.current = (virtualRef == null ? void 0 : virtualRef.current) || ref2.current;
|
|
31153
|
+
if (previousAnchor !== anchorRef.current) {
|
|
31154
|
+
context.onAnchorChange(anchorRef.current);
|
|
31155
|
+
}
|
|
31063
31156
|
});
|
|
31064
31157
|
return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
31065
31158
|
}
|
|
@@ -32435,7 +32528,7 @@ function requireLib() {
|
|
|
32435
32528
|
};
|
|
32436
32529
|
return __assign2.apply(this, arguments);
|
|
32437
32530
|
};
|
|
32438
|
-
var __createBinding = lib && lib.__createBinding || (Object.create ? function(o, m2, k2, k22) {
|
|
32531
|
+
var __createBinding = lib && lib.__createBinding || (Object.create ? (function(o, m2, k2, k22) {
|
|
32439
32532
|
if (k22 === void 0) k22 = k2;
|
|
32440
32533
|
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
32441
32534
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -32444,13 +32537,13 @@ function requireLib() {
|
|
|
32444
32537
|
} };
|
|
32445
32538
|
}
|
|
32446
32539
|
Object.defineProperty(o, k22, desc);
|
|
32447
|
-
} : function(o, m2, k2, k22) {
|
|
32540
|
+
}) : (function(o, m2, k2, k22) {
|
|
32448
32541
|
if (k22 === void 0) k22 = k2;
|
|
32449
32542
|
o[k22] = m2[k2];
|
|
32450
|
-
});
|
|
32451
|
-
var __setModuleDefault = lib && lib.__setModuleDefault || (Object.create ? function(o, v) {
|
|
32543
|
+
}));
|
|
32544
|
+
var __setModuleDefault = lib && lib.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
32452
32545
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
32453
|
-
} : function(o, v) {
|
|
32546
|
+
}) : function(o, v) {
|
|
32454
32547
|
o["default"] = v;
|
|
32455
32548
|
});
|
|
32456
32549
|
var __importStar = lib && lib.__importStar || function(mod) {
|
|
@@ -32836,7 +32929,7 @@ function requirePrism() {
|
|
|
32836
32929
|
* @namespace
|
|
32837
32930
|
* @public
|
|
32838
32931
|
*/
|
|
32839
|
-
var Prism2 = function(_self2) {
|
|
32932
|
+
var Prism2 = (function(_self2) {
|
|
32840
32933
|
var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
|
|
32841
32934
|
var uniqueId = 0;
|
|
32842
32935
|
var plainTextGrammar = {};
|
|
@@ -33721,7 +33814,7 @@ function requirePrism() {
|
|
|
33721
33814
|
}
|
|
33722
33815
|
}
|
|
33723
33816
|
return _;
|
|
33724
|
-
}(_self);
|
|
33817
|
+
})(_self);
|
|
33725
33818
|
if (module.exports) {
|
|
33726
33819
|
module.exports = Prism2;
|
|
33727
33820
|
}
|
|
@@ -34352,12 +34445,18 @@ const JsonEditor = ({
|
|
|
34352
34445
|
displayError && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-red-500 mt-1", children: displayError })
|
|
34353
34446
|
] });
|
|
34354
34447
|
};
|
|
34448
|
+
const isTypeSupported = (type2, supportedTypes) => {
|
|
34449
|
+
if (Array.isArray(type2)) {
|
|
34450
|
+
return type2.every((t) => supportedTypes.includes(t));
|
|
34451
|
+
}
|
|
34452
|
+
return typeof type2 === "string" && supportedTypes.includes(type2);
|
|
34453
|
+
};
|
|
34355
34454
|
const isSimpleObject = (schema) => {
|
|
34356
34455
|
const supportedTypes = ["string", "number", "integer", "boolean", "null"];
|
|
34357
|
-
if (schema.type &&
|
|
34456
|
+
if (schema.type && isTypeSupported(schema.type, supportedTypes)) return true;
|
|
34358
34457
|
if (schema.type === "object") {
|
|
34359
34458
|
return Object.values(schema.properties ?? {}).every(
|
|
34360
|
-
(prop) => prop.type &&
|
|
34459
|
+
(prop) => prop.type && isTypeSupported(prop.type, supportedTypes)
|
|
34361
34460
|
);
|
|
34362
34461
|
}
|
|
34363
34462
|
if (schema.type === "array") {
|
|
@@ -34480,7 +34579,11 @@ const DynamicJsonForm = ({
|
|
|
34480
34579
|
);
|
|
34481
34580
|
}
|
|
34482
34581
|
const isRequired = ((_a = parentSchema == null ? void 0 : parentSchema.required) == null ? void 0 : _a.includes(propertyName || "")) ?? false;
|
|
34483
|
-
|
|
34582
|
+
let fieldType = propSchema.type;
|
|
34583
|
+
if (Array.isArray(fieldType)) {
|
|
34584
|
+
fieldType = fieldType.find((t) => t !== "null") ?? fieldType[0];
|
|
34585
|
+
}
|
|
34586
|
+
switch (fieldType) {
|
|
34484
34587
|
case "string": {
|
|
34485
34588
|
if (propSchema.oneOf && propSchema.oneOf.every(
|
|
34486
34589
|
(option) => typeof option.const === "string" && typeof option.title === "string"
|
|
@@ -34628,6 +34731,8 @@ const DynamicJsonForm = ({
|
|
|
34628
34731
|
required: isRequired
|
|
34629
34732
|
}
|
|
34630
34733
|
);
|
|
34734
|
+
case "null":
|
|
34735
|
+
return null;
|
|
34631
34736
|
case "object":
|
|
34632
34737
|
if (!propSchema.properties) {
|
|
34633
34738
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -36286,7 +36391,7 @@ const useTheme = () => {
|
|
|
36286
36391
|
[theme, setThemeWithSideEffect]
|
|
36287
36392
|
);
|
|
36288
36393
|
};
|
|
36289
|
-
const version = "0.16.
|
|
36394
|
+
const version = "0.16.5";
|
|
36290
36395
|
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
36291
36396
|
createPopperScope
|
|
36292
36397
|
]);
|
|
@@ -38063,7 +38168,7 @@ const ToolsTab = ({
|
|
|
38063
38168
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedTool.description }),
|
|
38064
38169
|
Object.entries(selectedTool.inputSchema.properties ?? []).map(
|
|
38065
38170
|
([key, value]) => {
|
|
38066
|
-
const prop = value;
|
|
38171
|
+
const prop = normalizeUnionType(value);
|
|
38067
38172
|
const inputSchema = selectedTool.inputSchema;
|
|
38068
38173
|
const required2 = isPropertyRequired(key, inputSchema);
|
|
38069
38174
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -38108,7 +38213,7 @@ const ToolsTab = ({
|
|
|
38108
38213
|
value: params[key] ?? "",
|
|
38109
38214
|
onChange: (e) => setParams({
|
|
38110
38215
|
...params,
|
|
38111
|
-
[key]: e.target.value
|
|
38216
|
+
[key]: e.target.value === "" ? void 0 : e.target.value
|
|
38112
38217
|
}),
|
|
38113
38218
|
className: "mt-1"
|
|
38114
38219
|
}
|
|
@@ -38952,13 +39057,13 @@ const App = () => {
|
|
|
38952
39057
|
) });
|
|
38953
39058
|
if (window.location.pathname === "/oauth/callback") {
|
|
38954
39059
|
const OAuthCallback = React.lazy(
|
|
38955
|
-
() => __vitePreload(() => import("./OAuthCallback-
|
|
39060
|
+
() => __vitePreload(() => import("./OAuthCallback-BxZPCak0.js"), true ? [] : void 0)
|
|
38956
39061
|
);
|
|
38957
39062
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
|
|
38958
39063
|
}
|
|
38959
39064
|
if (window.location.pathname === "/oauth/callback/debug") {
|
|
38960
39065
|
const OAuthDebugCallback = React.lazy(
|
|
38961
|
-
() => __vitePreload(() => import("./OAuthDebugCallback-
|
|
39066
|
+
() => __vitePreload(() => import("./OAuthDebugCallback-CwfxQhTF.js"), true ? [] : void 0)
|
|
38962
39067
|
);
|
|
38963
39068
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
|
|
38964
39069
|
}
|
|
@@ -39326,7 +39431,9 @@ export {
|
|
|
39326
39431
|
InspectorOAuthClientProvider as I,
|
|
39327
39432
|
SESSION_KEYS as S,
|
|
39328
39433
|
auth as a,
|
|
39434
|
+
generateOAuthErrorDescription as g,
|
|
39329
39435
|
jsxRuntimeExports as j,
|
|
39436
|
+
parseOAuthCallbackParams as p,
|
|
39330
39437
|
reactExports as r,
|
|
39331
39438
|
useToast as u
|
|
39332
39439
|
};
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/mcp.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>MCP Inspector</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BIvDs4Sc.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BWZfLo5E.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modelcontextprotocol/inspector-client",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
4
4
|
"description": "Client-side application for the Model Context Protocol inspector",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Anthropic, PBC (https://anthropic.com)",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"cleanup:e2e": "node e2e/global-teardown.js"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@modelcontextprotocol/sdk": "^1.17.
|
|
28
|
+
"@modelcontextprotocol/sdk": "^1.17.3",
|
|
29
29
|
"@radix-ui/react-checkbox": "^1.1.4",
|
|
30
30
|
"@radix-ui/react-dialog": "^1.1.3",
|
|
31
31
|
"@radix-ui/react-icons": "^1.3.0",
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const parseOAuthCallbackParams = (location) => {
|
|
2
|
-
const params = new URLSearchParams(location);
|
|
3
|
-
const code = params.get("code");
|
|
4
|
-
if (code) {
|
|
5
|
-
return { successful: true, code };
|
|
6
|
-
}
|
|
7
|
-
const error = params.get("error");
|
|
8
|
-
const error_description = params.get("error_description");
|
|
9
|
-
const error_uri = params.get("error_uri");
|
|
10
|
-
if (error) {
|
|
11
|
-
return { successful: false, error, error_description, error_uri };
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
successful: false,
|
|
15
|
-
error: "invalid_request",
|
|
16
|
-
error_description: "Missing code or error in response",
|
|
17
|
-
error_uri: null
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
const generateOAuthErrorDescription = (params) => {
|
|
21
|
-
const error = params.error;
|
|
22
|
-
const errorDescription = params.error_description;
|
|
23
|
-
const errorUri = params.error_uri;
|
|
24
|
-
return [
|
|
25
|
-
`Error: ${error}.`,
|
|
26
|
-
errorDescription ? `Details: ${errorDescription}.` : "",
|
|
27
|
-
errorUri ? `More info: ${errorUri}.` : ""
|
|
28
|
-
].filter(Boolean).join("\n");
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
generateOAuthErrorDescription as g,
|
|
32
|
-
parseOAuthCallbackParams as p
|
|
33
|
-
};
|