@mcpjam/inspector 3.5.0 → 3.5.1

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.
@@ -34,7 +34,7 @@ import {
34
34
  supportsOwnershipProof,
35
35
  terminateOwnedProcess,
36
36
  terminateOwnedProcessGroup
37
- } from "./chunk-IIQQS3FK.js";
37
+ } from "./chunk-E6KBPJPA.js";
38
38
  import {
39
39
  ALLOWED_HOSTS,
40
40
  BROWSER_CONSENT_HEADER,
@@ -100880,50 +100880,6 @@ function mapInternalToRequestContext(ctx) {
100880
100880
  };
100881
100881
  }
100882
100882
 
100883
- // server/utils/secret-origin-binding.ts
100884
- function originForCredentialBinding(url) {
100885
- if (typeof url !== "string" || !url.trim()) return null;
100886
- let parsed;
100887
- try {
100888
- parsed = new URL(url);
100889
- } catch {
100890
- return null;
100891
- }
100892
- if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
100893
- return null;
100894
- }
100895
- const host = parsed.hostname.toLowerCase().replace(/\.+$/, "");
100896
- if (!host) return null;
100897
- parsed.protocol = parsed.protocol.toLowerCase();
100898
- parsed.hostname = host;
100899
- return parsed.origin;
100900
- }
100901
- function sameCredentialBindingOrigin(a, b) {
100902
- const left = originForCredentialBinding(a);
100903
- const right = originForCredentialBinding(b);
100904
- if (left === null || right === null) return false;
100905
- return left === right;
100906
- }
100907
- function assertSecretsOriginMatches(check) {
100908
- if (sameCredentialBindingOrigin(check.boundOrigin, check.targetUrl)) {
100909
- return;
100910
- }
100911
- const targetOrigin = originForCredentialBinding(check.targetUrl);
100912
- const named2 = check.serverName ? ` "${check.serverName}"` : "";
100913
- const boundOrigin = originForCredentialBinding(check.boundOrigin);
100914
- const boundTo = boundOrigin ? `saved for ${boundOrigin}` : "not recorded against any origin";
100915
- throw new WebRouteError(
100916
- 403,
100917
- ErrorCode.FORBIDDEN,
100918
- `Server${named2} now points at ${targetOrigin ?? "an unusable URL"}, but its saved credentials were ${boundTo}. They were not sent. Re-enter this server's credentials for the new URL.`,
100919
- {
100920
- secretOriginMismatch: true,
100921
- boundOrigin,
100922
- targetOrigin
100923
- }
100924
- );
100925
- }
100926
-
100927
100883
  // server/utils/server-secrets.ts
100928
100884
  var warnedMissingServiceTokenForIp = false;
100929
100885
  function parseRecord(value) {
@@ -105288,13 +105244,6 @@ function toMCPServerConfig(authResult, options) {
105288
105244
  async function applyLocalRuntimeResolution(result, args) {
105289
105245
  const { bearerToken, projectId, serverId } = args;
105290
105246
  const needsRuntimeSecrets = result.serverConfig.transportType === "stdio" && result.serverConfig.hasEnv === true && !hasNonEmptyStringRecord(result.serverConfig.env) || result.serverConfig.transportType === "http" && result.serverConfig.hasHeaders === true && !hasNonEmptyStringRecord(result.serverConfig.headers);
105291
- if (result.serverConfig.transportType === "http" && result.serverConfig.hasHeaders === true) {
105292
- assertSecretsOriginMatches({
105293
- boundOrigin: result.serverConfig.secretsBoundOrigin,
105294
- targetUrl: result.serverConfig.url,
105295
- serverName: args.serverDisplayName ?? args.managerKey
105296
- });
105297
- }
105298
105247
  if (needsRuntimeSecrets) {
105299
105248
  const secrets2 = await fetchRuntimeServerSecrets({
105300
105249
  bearerToken,
@@ -105464,18 +105413,6 @@ async function resolveLocalServerForConnect(c, bearerToken, projectId, serverId,
105464
105413
  );
105465
105414
  }
105466
105415
  const useOAuth = effectiveAuth === "oauth";
105467
- if (result.serverConfig.transportType === "http") {
105468
- const httpConfig = result.serverConfig;
105469
- const willMintXaa = effectiveAuth === "xaa";
105470
- const xaaMintSendsRowSecret = willMintXaa && resolveXaaConnectRegistrationMode(httpConfig.registrationMode) !== "cimd";
105471
- if (xaaMintSendsRowSecret || !willMintXaa && (useOAuth || result.oauthAccessToken != null)) {
105472
- assertSecretsOriginMatches({
105473
- boundOrigin: httpConfig.secretsBoundOrigin,
105474
- targetUrl: httpConfig.url,
105475
- serverName: options?.serverDisplayName ?? serverId
105476
- });
105477
- }
105478
- }
105479
105416
  let resolvedOauthAccessToken = result.oauthAccessToken ?? void 0;
105480
105417
  if (useOAuth && !resolvedOauthAccessToken) {
105481
105418
  const displayName = options?.serverDisplayName ?? serverId;
@@ -105524,13 +105461,6 @@ async function resolveLocalServerForConnect(c, bearerToken, projectId, serverId,
105524
105461
  }
105525
105462
  );
105526
105463
  }
105527
- if (resolvedOauthAccessToken && result.serverConfig.transportType === "http") {
105528
- assertSecretsOriginMatches({
105529
- boundOrigin: result.serverConfig.secretsBoundOrigin,
105530
- targetUrl: result.serverConfig.url,
105531
- serverName: options?.serverDisplayName ?? serverId
105532
- });
105533
- }
105534
105464
  }
105535
105465
  const useXaa = effectiveAuth === "xaa";
105536
105466
  let xaaUnauthorizedHandler;
@@ -207306,19 +207236,7 @@ async function createAuthorizedManager(caller, bearerToken, projectId, serverIds
207306
207236
  }
207307
207237
  let connectToken = oauthToken;
207308
207238
  let connectOnUnauthorized = onUnauthorized;
207309
- const oauthTokenIsRowDerived = recoveredOAuthTokens[serverId] != null || auth.oauthAccessToken != null;
207310
- const willMintXaa = auth.serverConfig.transportType === "http" && effectiveAuth === "xaa";
207311
- const xaaMintSendsRowSecret = willMintXaa && resolveXaaConnectRegistrationMode(
207312
- auth.serverConfig.registrationMode
207313
- ) !== "cimd";
207314
- if (xaaMintSendsRowSecret || !willMintXaa && oauthToken && oauthTokenIsRowDerived) {
207315
- assertSecretsOriginMatches({
207316
- boundOrigin: auth.serverConfig.secretsBoundOrigin,
207317
- targetUrl: auth.serverConfig.url,
207318
- serverName: displayServerName
207319
- });
207320
- }
207321
- const useXaa = willMintXaa;
207239
+ const useXaa = auth.serverConfig.transportType === "http" && effectiveAuth === "xaa";
207322
207240
  if (useXaa) {
207323
207241
  if (!options?.xaaIssuer) {
207324
207242
  throw new WebRouteError(
@@ -207417,13 +207335,6 @@ async function createAuthorizedManager(caller, bearerToken, projectId, serverIds
207417
207335
  );
207418
207336
  };
207419
207337
  }
207420
- if (auth.serverConfig.hasHeaders === true) {
207421
- assertSecretsOriginMatches({
207422
- boundOrigin: auth.serverConfig.secretsBoundOrigin,
207423
- targetUrl: auth.serverConfig.url,
207424
- serverName: displayServerName
207425
- });
207426
- }
207427
207338
  const authForConfig = auth.serverConfig.hasHeaders === true && !hasNonEmptyStringRecord2(auth.serverConfig.headers) ? {
207428
207339
  ...auth,
207429
207340
  serverConfig: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mcpjam/inspector",
3
3
  "productName": "MCPJam Inspector",
4
- "version": "3.5.0",
4
+ "version": "3.5.1",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=22.0.0"