fastmcp 4.26.0 → 4.26.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.
Files changed (36) hide show
  1. package/README.md +8 -2
  2. package/dist/FastMCP.cjs +3 -3
  3. package/dist/FastMCP.d.cts +2 -2
  4. package/dist/FastMCP.d.ts +2 -2
  5. package/dist/FastMCP.js +2 -2
  6. package/dist/{OAuthProvider-CPC9zG96.d.cts → OAuthProvider-5T2VSp7V.d.cts} +34 -1
  7. package/dist/{OAuthProvider-CPC9zG96.d.ts → OAuthProvider-5T2VSp7V.d.ts} +34 -1
  8. package/dist/auth/index.cjs +2 -2
  9. package/dist/auth/index.d.cts +17 -3
  10. package/dist/auth/index.d.ts +17 -3
  11. package/dist/auth/index.js +1 -1
  12. package/dist/{chunk-LUGELV2V.js → chunk-GUHJKVLX.js} +63 -32
  13. package/dist/chunk-GUHJKVLX.js.map +1 -0
  14. package/dist/{chunk-3VYVXSBB.js → chunk-KYUSH4TQ.js} +188 -41
  15. package/dist/chunk-KYUSH4TQ.js.map +1 -0
  16. package/dist/{chunk-ZHTH5HQD.cjs → chunk-MT5SJOZ5.cjs} +93 -62
  17. package/dist/chunk-MT5SJOZ5.cjs.map +1 -0
  18. package/dist/{chunk-AKHG27NY.cjs → chunk-UNS6EZVP.cjs} +202 -55
  19. package/dist/chunk-UNS6EZVP.cjs.map +1 -0
  20. package/dist/edge/index.cjs +110 -16
  21. package/dist/edge/index.cjs.map +1 -1
  22. package/dist/edge/index.d.cts +7 -2
  23. package/dist/edge/index.d.ts +7 -2
  24. package/dist/edge/index.js +110 -16
  25. package/dist/edge/index.js.map +1 -1
  26. package/dist/examples/custom-routes.cjs +3 -3
  27. package/dist/examples/custom-routes.js +2 -2
  28. package/dist/openapi/index.cjs +8 -8
  29. package/dist/openapi/index.d.cts +1 -1
  30. package/dist/openapi/index.d.ts +1 -1
  31. package/dist/openapi/index.js +2 -2
  32. package/package.json +1 -1
  33. package/dist/chunk-3VYVXSBB.js.map +0 -1
  34. package/dist/chunk-AKHG27NY.cjs.map +0 -1
  35. package/dist/chunk-LUGELV2V.js.map +0 -1
  36. package/dist/chunk-ZHTH5HQD.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkAKHG27NYcjs = require('./chunk-AKHG27NY.cjs');
3
+ var _chunkUNS6EZVPcjs = require('./chunk-UNS6EZVP.cjs');
4
4
 
5
5
 
6
6
 
@@ -141,7 +141,7 @@ var DiscoveryDocumentCache = class {
141
141
  throw error;
142
142
  }
143
143
  if (!res.ok) {
144
- await _chunkAKHG27NYcjs.cancelResponseBody.call(void 0, res);
144
+ await _chunkUNS6EZVPcjs.cancelResponseBody.call(void 0, res);
145
145
  throw new Error(
146
146
  `Failed to fetch discovery document from ${url}: ${res.status} ${res.statusText}`
147
147
  );
@@ -258,7 +258,7 @@ var imageContent = async (input) => {
258
258
  signal: AbortSignal.timeout(timeoutMs)
259
259
  });
260
260
  if (!response.ok) {
261
- await _chunkAKHG27NYcjs.cancelResponseBody.call(void 0, response);
261
+ await _chunkUNS6EZVPcjs.cancelResponseBody.call(void 0, response);
262
262
  throw new Error(
263
263
  `Server responded with status: ${response.status} - ${response.statusText}`
264
264
  );
@@ -340,7 +340,7 @@ var audioContent = async (input) => {
340
340
  signal: AbortSignal.timeout(timeoutMs)
341
341
  });
342
342
  if (!response.ok) {
343
- await _chunkAKHG27NYcjs.cancelResponseBody.call(void 0, response);
343
+ await _chunkUNS6EZVPcjs.cancelResponseBody.call(void 0, response);
344
344
  throw new Error(
345
345
  `Server responded with status: ${response.status} - ${response.statusText}`
346
346
  );
@@ -697,7 +697,7 @@ var FastMCPSession = class extends FastMCPSessionEventEmitter {
697
697
  this.setupCompleteHandlers();
698
698
  if (supportsTools) {
699
699
  this.setupToolHandlers(
700
- toolsVisibleTo(tools, this.#auth, this.#authRequired)
700
+ toolsVisibleTo(tools, this.#auth, this.#authRequired, this.#logger)
701
701
  );
702
702
  }
703
703
  if (resources.length || resourcesTemplates.length) {
@@ -839,7 +839,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
839
839
  }
840
840
  this.#tools = tools;
841
841
  this.setupToolHandlers(
842
- toolsVisibleTo(tools, this.#auth, this.#authRequired)
842
+ toolsVisibleTo(tools, this.#auth, this.#authRequired, this.#logger)
843
843
  );
844
844
  this.triggerListChangedNotification("notifications/tools/list_changed");
845
845
  }
@@ -862,7 +862,12 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
862
862
  */
863
863
  updateAuth(auth) {
864
864
  this.#auth = auth;
865
- const tools = toolsVisibleTo(this.#tools, auth, this.#authRequired);
865
+ const tools = toolsVisibleTo(
866
+ this.#tools,
867
+ auth,
868
+ this.#authRequired,
869
+ this.#logger
870
+ );
866
871
  if (tools.length !== this.#visibleTools.length || tools.some((tool, index) => tool !== this.#visibleTools[index])) {
867
872
  this.setupToolHandlers(tools);
868
873
  this.triggerListChangedNotification("notifications/tools/list_changed");
@@ -1934,6 +1939,9 @@ function convertObjectToSnakeCase(obj) {
1934
1939
  }
1935
1940
  return result;
1936
1941
  }
1942
+ function cookieHeaders(req) {
1943
+ return req.headers.cookie ? { cookie: req.headers.cookie } : {};
1944
+ }
1937
1945
  function isStreamableHttpTransport(transport) {
1938
1946
  return "handleRequest" in transport && typeof transport.handleRequest === "function";
1939
1947
  }
@@ -2058,6 +2066,20 @@ function grantedScopes(auth) {
2058
2066
  const values = Array.isArray(scopes) ? scopes : scopes instanceof Set ? [...scopes] : [];
2059
2067
  return values.filter((scope) => typeof scope === "string");
2060
2068
  }
2069
+ async function sendOAuthProxyResponse(res, response) {
2070
+ const body = await response.text();
2071
+ const headers = {};
2072
+ response.headers.forEach((value, key) => {
2073
+ if (key.toLowerCase() !== "set-cookie") {
2074
+ headers[key] = value;
2075
+ }
2076
+ });
2077
+ const setCookies = response.headers.getSetCookie();
2078
+ if (setCookies.length > 0) {
2079
+ headers["set-cookie"] = setCookies;
2080
+ }
2081
+ res.writeHead(response.status, headers).end(body);
2082
+ }
2061
2083
  function stripBasePath(path, basePath) {
2062
2084
  if (!basePath) {
2063
2085
  return path;
@@ -2070,12 +2092,32 @@ function stripBasePath(path, basePath) {
2070
2092
  }
2071
2093
  return null;
2072
2094
  }
2073
- function toolsVisibleTo(tools, auth, authRequired) {
2074
- if (auth) {
2075
- return tools.filter(
2076
- (tool) => tool.canAccess ? tool.canAccess(auth) : true
2095
+ var toolsWithInvalidCanAccess = /* @__PURE__ */ new WeakSet();
2096
+ function toolAdmits(tool, auth, logger) {
2097
+ if (!tool.canAccess) {
2098
+ return true;
2099
+ }
2100
+ const admitted = tool.canAccess(auth);
2101
+ if (typeof admitted === "boolean") {
2102
+ return admitted;
2103
+ }
2104
+ const isPromise = typeof _optionalChain([admitted, 'optionalAccess', _71 => _71.then]) === "function";
2105
+ if (isPromise) {
2106
+ Promise.resolve(admitted).catch(() => {
2107
+ });
2108
+ }
2109
+ if (admitted && !toolsWithInvalidCanAccess.has(tool)) {
2110
+ toolsWithInvalidCanAccess.add(tool);
2111
+ logger.warn(
2112
+ `[FastMCP warning] Tool '${tool.name}' is hidden: its canAccess returned ${isPromise ? "a Promise" : "a non-boolean value"}. canAccess must return a boolean synchronously.`
2077
2113
  );
2078
2114
  }
2115
+ return false;
2116
+ }
2117
+ function toolsVisibleTo(tools, auth, authRequired, logger) {
2118
+ if (auth) {
2119
+ return tools.filter((tool) => toolAdmits(tool, auth, logger));
2120
+ }
2079
2121
  return authRequired ? tools.filter((tool) => !tool.canAccess) : tools;
2080
2122
  }
2081
2123
  var FastMCPEventEmitterBase = _events.EventEmitter;
@@ -2697,9 +2739,9 @@ var FastMCP = class extends FastMCPEventEmitter {
2697
2739
  const originalOnClose = transport.onclose;
2698
2740
  transport.onclose = () => {
2699
2741
  closed = true;
2700
- _optionalChain([onClose, 'optionalCall', _71 => _71()]);
2742
+ _optionalChain([onClose, 'optionalCall', _72 => _72()]);
2701
2743
  this.#removeSession(session);
2702
- _optionalChain([originalOnClose, 'optionalCall', _72 => _72()]);
2744
+ _optionalChain([originalOnClose, 'optionalCall', _73 => _73()]);
2703
2745
  };
2704
2746
  await session.connect(transport);
2705
2747
  if (closed) {
@@ -2726,7 +2768,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2726
2768
  */
2727
2769
  #createInsufficientScopeResponse(challenge, id) {
2728
2770
  const oauth = this.#options.oauth;
2729
- const resource = _optionalChain([oauth, 'optionalAccess', _73 => _73.enabled]) ? _optionalChain([oauth, 'access', _74 => _74.protectedResource, 'optionalAccess', _75 => _75.resource]) : void 0;
2771
+ const resource = _optionalChain([oauth, 'optionalAccess', _74 => _74.enabled]) ? _optionalChain([oauth, 'access', _75 => _75.protectedResource, 'optionalAccess', _76 => _76.resource]) : void 0;
2730
2772
  const wwwAuthenticateParts = [
2731
2773
  'error="insufficient_scope"',
2732
2774
  `scope="${challenge.scopes.filter((scope) => SCOPE_TOKEN.test(scope)).join(" ")}"`
@@ -2812,7 +2854,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2812
2854
  */
2813
2855
  #createUnauthorizedResponse(message) {
2814
2856
  const oauth = this.#options.oauth;
2815
- const resource = _optionalChain([oauth, 'optionalAccess', _76 => _76.enabled]) ? _optionalChain([oauth, 'access', _77 => _77.protectedResource, 'optionalAccess', _78 => _78.resource]) : void 0;
2857
+ const resource = _optionalChain([oauth, 'optionalAccess', _77 => _77.enabled]) ? _optionalChain([oauth, 'access', _78 => _78.protectedResource, 'optionalAccess', _79 => _79.resource]) : void 0;
2816
2858
  const wwwAuthenticateParts = [
2817
2859
  'error="invalid_token"',
2818
2860
  `error_description="${message.replace(/"/g, '\\"')}"`
@@ -2951,7 +2993,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2951
2993
  }
2952
2994
  }
2953
2995
  const oauthConfig = this.#options.oauth;
2954
- if (_optionalChain([oauthConfig, 'optionalAccess', _79 => _79.enabled]) && req.method === "GET") {
2996
+ if (_optionalChain([oauthConfig, 'optionalAccess', _80 => _80.enabled]) && req.method === "GET") {
2955
2997
  const url2 = new URL(req.url || "", `http://${host}`);
2956
2998
  const authorizationServerMetadataPath = joinPaths(
2957
2999
  "",
@@ -2985,8 +3027,8 @@ var FastMCP = class extends FastMCPEventEmitter {
2985
3027
  }
2986
3028
  }
2987
3029
  }
2988
- const oauthProxy = _optionalChain([oauthConfig, 'optionalAccess', _80 => _80.proxy]);
2989
- if (oauthProxy && _optionalChain([oauthConfig, 'optionalAccess', _81 => _81.enabled])) {
3030
+ const oauthProxy = _optionalChain([oauthConfig, 'optionalAccess', _81 => _81.proxy]);
3031
+ if (oauthProxy && _optionalChain([oauthConfig, 'optionalAccess', _82 => _82.enabled])) {
2990
3032
  const url2 = new URL(req.url || "", `http://${host}`);
2991
3033
  const oauthPath = basePathRelativePath;
2992
3034
  try {
@@ -3039,7 +3081,7 @@ var FastMCP = class extends FastMCPEventEmitter {
3039
3081
  const statusCode = error.statusCode || 400;
3040
3082
  res.writeHead(statusCode, OAUTH_CREDENTIAL_RESPONSE_HEADERS).end(
3041
3083
  JSON.stringify(
3042
- _optionalChain([error, 'access', _82 => _82.toJSON, 'optionalCall', _83 => _83()]) || {
3084
+ _optionalChain([error, 'access', _83 => _83.toJSON, 'optionalCall', _84 => _84()]) || {
3043
3085
  error: "invalid_request"
3044
3086
  }
3045
3087
  )
@@ -3054,19 +3096,17 @@ var FastMCP = class extends FastMCPEventEmitter {
3054
3096
  try {
3055
3097
  const params = Object.fromEntries(url2.searchParams.entries());
3056
3098
  const response = await oauthProxy.authorize(
3057
- params
3099
+ params,
3100
+ // The consent cookie this browser already holds, if any
3101
+ new Request(`http://${host}${req.url}`, {
3102
+ headers: cookieHeaders(req)
3103
+ })
3058
3104
  );
3059
- const location = response.headers.get("Location");
3060
- if (location) {
3061
- res.writeHead(response.status, { Location: location }).end();
3062
- } else {
3063
- const html = await response.text();
3064
- res.writeHead(response.status, { "Content-Type": "text/html" }).end(html);
3065
- }
3105
+ await sendOAuthProxyResponse(res, response);
3066
3106
  } catch (error) {
3067
3107
  res.writeHead(400, { "Content-Type": "application/json" }).end(
3068
3108
  JSON.stringify(
3069
- _optionalChain([error, 'access', _84 => _84.toJSON, 'optionalCall', _85 => _85()]) || {
3109
+ _optionalChain([error, 'access', _85 => _85.toJSON, 'optionalCall', _86 => _86()]) || {
3070
3110
  error: "invalid_request"
3071
3111
  }
3072
3112
  )
@@ -3076,19 +3116,15 @@ var FastMCP = class extends FastMCPEventEmitter {
3076
3116
  }
3077
3117
  if (req.method === "GET" && oauthPath === "/oauth/callback") {
3078
3118
  try {
3079
- const mockRequest = new Request(`http://${host}${req.url}`);
3119
+ const mockRequest = new Request(`http://${host}${req.url}`, {
3120
+ headers: cookieHeaders(req)
3121
+ });
3080
3122
  const response = await oauthProxy.handleCallback(mockRequest);
3081
- const location = response.headers.get("Location");
3082
- if (location) {
3083
- res.writeHead(response.status, { Location: location }).end();
3084
- } else {
3085
- const text = await response.text();
3086
- res.writeHead(response.status).end(text);
3087
- }
3123
+ await sendOAuthProxyResponse(res, response);
3088
3124
  } catch (error) {
3089
3125
  res.writeHead(400, { "Content-Type": "application/json" }).end(
3090
3126
  JSON.stringify(
3091
- _optionalChain([error, 'access', _86 => _86.toJSON, 'optionalCall', _87 => _87()]) || {
3127
+ _optionalChain([error, 'access', _87 => _87.toJSON, 'optionalCall', _88 => _88()]) || {
3092
3128
  error: "server_error"
3093
3129
  }
3094
3130
  )
@@ -3141,23 +3177,18 @@ var FastMCP = class extends FastMCPEventEmitter {
3141
3177
  {
3142
3178
  body: Buffer.concat(bodyChunks).toString("utf8"),
3143
3179
  headers: {
3180
+ ...cookieHeaders(req),
3144
3181
  "Content-Type": "application/x-www-form-urlencoded"
3145
3182
  },
3146
3183
  method: "POST"
3147
3184
  }
3148
3185
  );
3149
3186
  const response = await oauthProxy.handleConsent(mockRequest);
3150
- const location = response.headers.get("Location");
3151
- if (location) {
3152
- res.writeHead(response.status, { Location: location }).end();
3153
- } else {
3154
- const text = await response.text();
3155
- res.writeHead(response.status).end(text);
3156
- }
3187
+ await sendOAuthProxyResponse(res, response);
3157
3188
  } catch (error) {
3158
3189
  res.writeHead(400, { "Content-Type": "application/json" }).end(
3159
3190
  JSON.stringify(
3160
- _optionalChain([error, 'access', _88 => _88.toJSON, 'optionalCall', _89 => _89()]) || {
3191
+ _optionalChain([error, 'access', _89 => _89.toJSON, 'optionalCall', _90 => _90()]) || {
3161
3192
  error: "server_error"
3162
3193
  }
3163
3194
  )
@@ -3272,7 +3303,7 @@ var FastMCP = class extends FastMCPEventEmitter {
3272
3303
  }
3273
3304
  res.writeHead(200, OAUTH_CREDENTIAL_RESPONSE_HEADERS).end(JSON.stringify(response));
3274
3305
  } catch (error) {
3275
- const body = _optionalChain([error, 'access', _90 => _90.toJSON, 'optionalCall', _91 => _91()]) || {
3306
+ const body = _optionalChain([error, 'access', _91 => _91.toJSON, 'optionalCall', _92 => _92()]) || {
3276
3307
  error: "invalid_request"
3277
3308
  };
3278
3309
  if (body.error === "invalid_client") {
@@ -3302,7 +3333,7 @@ var FastMCP = class extends FastMCPEventEmitter {
3302
3333
  * regardless (RFC 7235), so no config is needed just to get the header.
3303
3334
  */
3304
3335
  #httpStreamOAuthConfig() {
3305
- const resource = _optionalChain([this, 'access', _92 => _92.#options, 'access', _93 => _93.oauth, 'optionalAccess', _94 => _94.enabled]) ? _optionalChain([this, 'access', _95 => _95.#options, 'access', _96 => _96.oauth, 'access', _97 => _97.protectedResource, 'optionalAccess', _98 => _98.resource]) : void 0;
3336
+ const resource = _optionalChain([this, 'access', _93 => _93.#options, 'access', _94 => _94.oauth, 'optionalAccess', _95 => _95.enabled]) ? _optionalChain([this, 'access', _96 => _96.#options, 'access', _97 => _97.oauth, 'access', _98 => _98.protectedResource, 'optionalAccess', _99 => _99.resource]) : void 0;
3306
3337
  if (!resource) {
3307
3338
  return {};
3308
3339
  }
@@ -3408,25 +3439,25 @@ var FastMCP = class extends FastMCPEventEmitter {
3408
3439
  const envBasePath = process.env.FASTMCP_BASE_PATH;
3409
3440
  const envStateless = process.env.FASTMCP_STATELESS;
3410
3441
  const envHost = process.env.FASTMCP_HOST;
3411
- const transportType = _optionalChain([overrides, 'optionalAccess', _99 => _99.transportType]) || parseTransportSetting(transportArg, "--transport") || parseTransportSetting(envTransport, "FASTMCP_TRANSPORT") || "stdio";
3442
+ const transportType = _optionalChain([overrides, 'optionalAccess', _100 => _100.transportType]) || parseTransportSetting(transportArg, "--transport") || parseTransportSetting(envTransport, "FASTMCP_TRANSPORT") || "stdio";
3412
3443
  if (transportType === "httpStream") {
3413
3444
  const port = parseInt(
3414
- _optionalChain([overrides, 'optionalAccess', _100 => _100.httpStream, 'optionalAccess', _101 => _101.port, 'optionalAccess', _102 => _102.toString, 'call', _103 => _103()]) || portArg || envPort || "8080"
3445
+ _optionalChain([overrides, 'optionalAccess', _101 => _101.httpStream, 'optionalAccess', _102 => _102.port, 'optionalAccess', _103 => _103.toString, 'call', _104 => _104()]) || portArg || envPort || "8080"
3415
3446
  );
3416
- const host = _optionalChain([overrides, 'optionalAccess', _104 => _104.httpStream, 'optionalAccess', _105 => _105.host]) || hostArg || envHost || "localhost";
3417
- const endpoint = _optionalChain([overrides, 'optionalAccess', _106 => _106.httpStream, 'optionalAccess', _107 => _107.endpoint]) || endpointArg || envEndpoint || "/mcp";
3447
+ const host = _optionalChain([overrides, 'optionalAccess', _105 => _105.httpStream, 'optionalAccess', _106 => _106.host]) || hostArg || envHost || "localhost";
3448
+ const endpoint = _optionalChain([overrides, 'optionalAccess', _107 => _107.httpStream, 'optionalAccess', _108 => _108.endpoint]) || endpointArg || envEndpoint || "/mcp";
3418
3449
  const basePath = normalizeBasePath(
3419
- _optionalChain([overrides, 'optionalAccess', _108 => _108.httpStream, 'optionalAccess', _109 => _109.basePath]) || basePathArg || envBasePath
3450
+ _optionalChain([overrides, 'optionalAccess', _109 => _109.httpStream, 'optionalAccess', _110 => _110.basePath]) || basePathArg || envBasePath
3420
3451
  );
3421
- const enableJsonResponse = _optionalChain([overrides, 'optionalAccess', _110 => _110.httpStream, 'optionalAccess', _111 => _111.enableJsonResponse]) || false;
3422
- const stateless = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([overrides, 'optionalAccess', _112 => _112.httpStream, 'optionalAccess', _113 => _113.stateless]), () => ( // A bare `--stateless` means `--stateless true`.
3452
+ const enableJsonResponse = _optionalChain([overrides, 'optionalAccess', _111 => _111.httpStream, 'optionalAccess', _112 => _112.enableJsonResponse]) || false;
3453
+ const stateless = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([overrides, 'optionalAccess', _113 => _113.httpStream, 'optionalAccess', _114 => _114.stateless]), () => ( // A bare `--stateless` means `--stateless true`.
3423
3454
  (statelessArg === "" ? true : parseBooleanSetting(statelessArg, "--stateless")))), () => ( parseBooleanSetting(envStateless, "FASTMCP_STATELESS"))), () => ( false));
3424
- const cors = _optionalChain([overrides, 'optionalAccess', _114 => _114.httpStream, 'optionalAccess', _115 => _115.cors]);
3425
- const eventStore = _optionalChain([overrides, 'optionalAccess', _116 => _116.httpStream, 'optionalAccess', _117 => _117.eventStore]);
3426
- const sseEndpoint = _optionalChain([overrides, 'optionalAccess', _118 => _118.httpStream, 'optionalAccess', _119 => _119.sseEndpoint]);
3427
- const sslCa = _optionalChain([overrides, 'optionalAccess', _120 => _120.httpStream, 'optionalAccess', _121 => _121.sslCa]);
3428
- const sslCert = _optionalChain([overrides, 'optionalAccess', _122 => _122.httpStream, 'optionalAccess', _123 => _123.sslCert]);
3429
- const sslKey = _optionalChain([overrides, 'optionalAccess', _124 => _124.httpStream, 'optionalAccess', _125 => _125.sslKey]);
3455
+ const cors = _optionalChain([overrides, 'optionalAccess', _115 => _115.httpStream, 'optionalAccess', _116 => _116.cors]);
3456
+ const eventStore = _optionalChain([overrides, 'optionalAccess', _117 => _117.httpStream, 'optionalAccess', _118 => _118.eventStore]);
3457
+ const sseEndpoint = _optionalChain([overrides, 'optionalAccess', _119 => _119.httpStream, 'optionalAccess', _120 => _120.sseEndpoint]);
3458
+ const sslCa = _optionalChain([overrides, 'optionalAccess', _121 => _121.httpStream, 'optionalAccess', _122 => _122.sslCa]);
3459
+ const sslCert = _optionalChain([overrides, 'optionalAccess', _123 => _123.httpStream, 'optionalAccess', _124 => _124.sslCert]);
3460
+ const sslKey = _optionalChain([overrides, 'optionalAccess', _125 => _125.httpStream, 'optionalAccess', _126 => _126.sslKey]);
3430
3461
  return {
3431
3462
  httpStream: {
3432
3463
  basePath,
@@ -3518,7 +3549,7 @@ var FastMCP = class extends FastMCPEventEmitter {
3518
3549
  */
3519
3550
  #useEndpointAsResource(endpoint) {
3520
3551
  const oauth = this.#options.oauth;
3521
- if (this.#providerResourceBase === void 0 || !_optionalChain([oauth, 'optionalAccess', _126 => _126.protectedResource]))
3552
+ if (this.#providerResourceBase === void 0 || !_optionalChain([oauth, 'optionalAccess', _127 => _127.protectedResource]))
3522
3553
  return;
3523
3554
  this.#options = {
3524
3555
  ...this.#options,
@@ -3547,4 +3578,4 @@ var FastMCP = class extends FastMCPEventEmitter {
3547
3578
 
3548
3579
 
3549
3580
  exports.DiscoveryDocumentCache = DiscoveryDocumentCache; exports.jsonSchemaAdapter = jsonSchemaAdapter; exports.MEDIA_FETCH_TIMEOUT_MS = MEDIA_FETCH_TIMEOUT_MS; exports.imageContent = imageContent; exports.audioContent = audioContent; exports.FastMCPError = FastMCPError; exports.SessionError = SessionError; exports.UnexpectedStateError = UnexpectedStateError; exports.UserError = UserError; exports.ServerState = ServerState; exports.FastMCPSession = FastMCPSession; exports.FastMCP = FastMCP;
3550
- //# sourceMappingURL=chunk-ZHTH5HQD.cjs.map
3581
+ //# sourceMappingURL=chunk-MT5SJOZ5.cjs.map