@modelcontextprotocol/inspector-client 0.4.1 → 0.6.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.
package/bin/cli.js CHANGED
@@ -9,7 +9,10 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
9
9
  const distPath = join(__dirname, "../dist");
10
10
 
11
11
  const server = http.createServer((request, response) => {
12
- return handler(request, response, { public: distPath });
12
+ return handler(request, response, {
13
+ public: distPath,
14
+ rewrites: [{ source: "/**", destination: "/index.html" }],
15
+ });
13
16
  });
14
17
 
15
18
  const port = process.env.PORT || 5173;
@@ -1,4 +1,4 @@
1
- import { r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS, h as handleOAuthCallback } from "./index-DVugRvpa.js";
1
+ import { r as reactExports, j as jsxRuntimeExports, S as SESSION_KEYS, a as auth, b as authProvider } from "./index-BK1TrpAN.js";
2
2
  const OAuthCallback = () => {
3
3
  const hasProcessedRef = reactExports.useRef(false);
4
4
  reactExports.useEffect(() => {
@@ -16,12 +16,13 @@ const OAuthCallback = () => {
16
16
  return;
17
17
  }
18
18
  try {
19
- const tokens = await handleOAuthCallback(serverUrl, code);
20
- sessionStorage.setItem(SESSION_KEYS.ACCESS_TOKEN, tokens.access_token);
21
- if (tokens.refresh_token) {
22
- sessionStorage.setItem(
23
- SESSION_KEYS.REFRESH_TOKEN,
24
- tokens.refresh_token
19
+ const result = await auth(authProvider, {
20
+ serverUrl,
21
+ authorizationCode: code
22
+ });
23
+ if (result !== "AUTHORIZED") {
24
+ throw new Error(
25
+ `Expected to be authorized after providing auth code, got: ${result}`
25
26
  );
26
27
  }
27
28
  window.location.href = `/?serverUrl=${encodeURIComponent(serverUrl)}`;