@modelcontextprotocol/inspector-client 1.0.2 → 1.0.3
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/bin/start.js +10 -1
- package/dist/assets/{OAuthCallback-at8T3Iwi.js → OAuthCallback-jbB02Bt3.js} +6 -2
- package/dist/assets/{OAuthDebugCallback-ZJ9hxfpr.js → OAuthDebugCallback-VeJ8bP3s.js} +1 -1
- package/dist/assets/{index-DdyO6kfY.js → index-C2CDzlVy.js} +1505 -745
- package/dist/index.html +1 -1
- package/package.json +1 -1
package/bin/start.js
CHANGED
|
@@ -9,6 +9,15 @@ import { randomBytes } from "crypto";
|
|
|
9
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
10
|
const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
|
|
11
11
|
|
|
12
|
+
// Only an explicit truthy value disables auth; unset, empty, "false", "0" and
|
|
13
|
+
// anything unrecognized leave it enabled. Identical to isAuthDisabledFlag in
|
|
14
|
+
// server/src/request-guards.ts (whose parser lives in server/src/env-flags.ts)
|
|
15
|
+
// so the launcher and the proxy always agree; keep the two in sync.
|
|
16
|
+
function isAuthDisabledFlag(value) {
|
|
17
|
+
if (value === undefined) return false;
|
|
18
|
+
return ["true", "1", "yes"].includes(value.trim().toLowerCase());
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
function delay(ms) {
|
|
13
22
|
return new Promise((resolve) => setTimeout(resolve, ms, true));
|
|
14
23
|
}
|
|
@@ -292,7 +301,7 @@ async function main() {
|
|
|
292
301
|
// Use provided token from environment or generate a new one
|
|
293
302
|
const sessionToken =
|
|
294
303
|
process.env.MCP_PROXY_AUTH_TOKEN || randomBytes(32).toString("hex");
|
|
295
|
-
const authDisabled =
|
|
304
|
+
const authDisabled = isAuthDisabledFlag(process.env.DANGEROUSLY_OMIT_AUTH);
|
|
296
305
|
|
|
297
306
|
const abort = new AbortController();
|
|
298
307
|
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
1
|
+
import { u as useToast, r as reactExports, c as clearOAuthConnectionSnapshot, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-C2CDzlVy.js";
|
|
2
2
|
const OAuthCallback = ({ onConnect }) => {
|
|
3
3
|
const { toast } = useToast();
|
|
4
4
|
const hasProcessedRef = reactExports.useRef(false);
|
|
@@ -42,9 +42,13 @@ const OAuthCallback = ({ onConnect }) => {
|
|
|
42
42
|
description: "Successfully authenticated with OAuth",
|
|
43
43
|
variant: "default"
|
|
44
44
|
});
|
|
45
|
-
onConnect(serverUrl);
|
|
45
|
+
const refusal = onConnect(serverUrl);
|
|
46
|
+
if (refusal) {
|
|
47
|
+
notifyError(refusal);
|
|
48
|
+
}
|
|
46
49
|
};
|
|
47
50
|
handleCallback().finally(() => {
|
|
51
|
+
clearOAuthConnectionSnapshot();
|
|
48
52
|
window.history.replaceState({}, document.title, "/");
|
|
49
53
|
});
|
|
50
54
|
}, [toast, onConnect]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-
|
|
1
|
+
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-C2CDzlVy.js";
|
|
2
2
|
const OAuthDebugCallback = ({ onConnect }) => {
|
|
3
3
|
reactExports.useEffect(() => {
|
|
4
4
|
let isProcessed = false;
|