fastmcp 4.23.9 → 4.23.11

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/FastMCP.cjs CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkPV5VLW7Rcjs = require('./chunk-PV5VLW7R.cjs');
14
+ var _chunkX5ITW7FVcjs = require('./chunk-X5ITW7FV.cjs');
15
15
 
16
16
 
17
17
 
@@ -50,5 +50,5 @@ require('./chunk-6TDYSPLC.cjs');
50
50
 
51
51
 
52
52
 
53
- exports.AuthProvider = _chunk4OWHPJELcjs.AuthProvider; exports.AzureProvider = _chunk4OWHPJELcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkPV5VLW7Rcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkPV5VLW7Rcjs.FastMCP; exports.FastMCPError = _chunkPV5VLW7Rcjs.FastMCPError; exports.FastMCPSession = _chunkPV5VLW7Rcjs.FastMCPSession; exports.GitHubProvider = _chunk4OWHPJELcjs.GitHubProvider; exports.GoogleProvider = _chunk4OWHPJELcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkPV5VLW7Rcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunk4OWHPJELcjs.OAuthProvider; exports.ServerState = _chunkPV5VLW7Rcjs.ServerState; exports.SessionError = _chunkPV5VLW7Rcjs.SessionError; exports.UnexpectedStateError = _chunkPV5VLW7Rcjs.UnexpectedStateError; exports.UserError = _chunkPV5VLW7Rcjs.UserError; exports.audioContent = _chunkPV5VLW7Rcjs.audioContent; exports.getAuthSession = _chunk4OWHPJELcjs.getAuthSession; exports.imageContent = _chunkPV5VLW7Rcjs.imageContent; exports.jsonSchemaAdapter = _chunkPV5VLW7Rcjs.jsonSchemaAdapter; exports.requireAll = _chunk4OWHPJELcjs.requireAll; exports.requireAny = _chunk4OWHPJELcjs.requireAny; exports.requireAuth = _chunk4OWHPJELcjs.requireAuth; exports.requireRole = _chunk4OWHPJELcjs.requireRole; exports.requireScopes = _chunk4OWHPJELcjs.requireScopes;
53
+ exports.AuthProvider = _chunk4OWHPJELcjs.AuthProvider; exports.AzureProvider = _chunk4OWHPJELcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkX5ITW7FVcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkX5ITW7FVcjs.FastMCP; exports.FastMCPError = _chunkX5ITW7FVcjs.FastMCPError; exports.FastMCPSession = _chunkX5ITW7FVcjs.FastMCPSession; exports.GitHubProvider = _chunk4OWHPJELcjs.GitHubProvider; exports.GoogleProvider = _chunk4OWHPJELcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkX5ITW7FVcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunk4OWHPJELcjs.OAuthProvider; exports.ServerState = _chunkX5ITW7FVcjs.ServerState; exports.SessionError = _chunkX5ITW7FVcjs.SessionError; exports.UnexpectedStateError = _chunkX5ITW7FVcjs.UnexpectedStateError; exports.UserError = _chunkX5ITW7FVcjs.UserError; exports.audioContent = _chunkX5ITW7FVcjs.audioContent; exports.getAuthSession = _chunk4OWHPJELcjs.getAuthSession; exports.imageContent = _chunkX5ITW7FVcjs.imageContent; exports.jsonSchemaAdapter = _chunkX5ITW7FVcjs.jsonSchemaAdapter; exports.requireAll = _chunk4OWHPJELcjs.requireAll; exports.requireAny = _chunk4OWHPJELcjs.requireAny; exports.requireAuth = _chunk4OWHPJELcjs.requireAuth; exports.requireRole = _chunk4OWHPJELcjs.requireRole; exports.requireScopes = _chunk4OWHPJELcjs.requireScopes;
54
54
  //# sourceMappingURL=FastMCP.cjs.map
package/dist/FastMCP.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  audioContent,
12
12
  imageContent,
13
13
  jsonSchemaAdapter
14
- } from "./chunk-75ZLE5AS.js";
14
+ } from "./chunk-XUUJOVC7.js";
15
15
  import {
16
16
  AuthProvider,
17
17
  AzureProvider,
@@ -985,7 +985,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
985
985
  };
986
986
  }
987
987
  /**
988
- * Fetches the client's roots if it advertised `roots.listChanged`.
988
+ * Fetches the client's roots if it advertised the `roots` capability.
989
989
  *
990
990
  * Over Streamable HTTP a server-initiated request travels on the client's
991
991
  * standalone GET stream, which the client opens only after initialization,
@@ -993,7 +993,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
993
993
  * is bounded and retried, and the result is announced with `rootsChanged`.
994
994
  */
995
995
  async #loadRoots(streamableHttp) {
996
- if (_optionalChain([this, 'access', _36 => _36.#rootsConfig, 'optionalAccess', _37 => _37.enabled]) === false || !_optionalChain([this, 'access', _38 => _38.#clientCapabilities, 'optionalAccess', _39 => _39.roots, 'optionalAccess', _40 => _40.listChanged]) || typeof this.#server.listRoots !== "function") {
996
+ if (_optionalChain([this, 'access', _36 => _36.#rootsConfig, 'optionalAccess', _37 => _37.enabled]) === false || !_optionalChain([this, 'access', _38 => _38.#clientCapabilities, 'optionalAccess', _39 => _39.roots]) || typeof this.#server.listRoots !== "function") {
997
997
  return;
998
998
  }
999
999
  const maxAttempts = streamableHttp ? 5 : 1;
@@ -1003,7 +1003,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1003
1003
  void 0,
1004
1004
  streamableHttp ? { timeout: 1e3 } : void 0
1005
1005
  );
1006
- this.#roots = _optionalChain([roots, 'optionalAccess', _41 => _41.roots]) || [];
1006
+ this.#roots = _optionalChain([roots, 'optionalAccess', _40 => _40.roots]) || [];
1007
1007
  if (streamableHttp) {
1008
1008
  this.emit("rootsChanged", { roots: this.#roots });
1009
1009
  }
@@ -1141,7 +1141,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1141
1141
  */
1142
1142
  #startStreamKeepalive(extra, toolName) {
1143
1143
  const config = this.#streamKeepaliveConfig;
1144
- if (!_optionalChain([config, 'optionalAccess', _42 => _42.enabled]) || _optionalChain([extra, 'access', _43 => _43.signal, 'optionalAccess', _44 => _44.aborted])) {
1144
+ if (!_optionalChain([config, 'optionalAccess', _41 => _41.enabled]) || _optionalChain([extra, 'access', _42 => _42.signal, 'optionalAccess', _43 => _43.aborted])) {
1145
1145
  return () => {
1146
1146
  };
1147
1147
  }
@@ -1161,12 +1161,12 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1161
1161
  );
1162
1162
  });
1163
1163
  }, intervalMs);
1164
- _optionalChain([timer, 'access', _45 => _45.unref, 'optionalCall', _46 => _46()]);
1164
+ _optionalChain([timer, 'access', _44 => _44.unref, 'optionalCall', _45 => _45()]);
1165
1165
  const stop = () => {
1166
1166
  clearInterval(timer);
1167
- _optionalChain([extra, 'access', _47 => _47.signal, 'optionalAccess', _48 => _48.removeEventListener, 'call', _49 => _49("abort", stop)]);
1167
+ _optionalChain([extra, 'access', _46 => _46.signal, 'optionalAccess', _47 => _47.removeEventListener, 'call', _48 => _48("abort", stop)]);
1168
1168
  };
1169
- _optionalChain([extra, 'access', _50 => _50.signal, 'optionalAccess', _51 => _51.addEventListener, 'call', _52 => _52("abort", stop, { once: true })]);
1169
+ _optionalChain([extra, 'access', _49 => _49.signal, 'optionalAccess', _50 => _50.addEventListener, 'call', _51 => _51("abort", stop, { once: true })]);
1170
1170
  return stop;
1171
1171
  }
1172
1172
  async #validateStructuredContent(tool, value, toolName) {
@@ -1386,7 +1386,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1386
1386
  _nullishCoalesce(args, () => ( {})),
1387
1387
  this.#auth,
1388
1388
  this.#createLoadContext(
1389
- _optionalChain([request, 'access', _53 => _53.params, 'optionalAccess', _54 => _54._meta]),
1389
+ _optionalChain([request, 'access', _52 => _52.params, 'optionalAccess', _53 => _53._meta]),
1390
1390
  extra.sendNotification,
1391
1391
  extra.requestId
1392
1392
  )
@@ -1451,12 +1451,11 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1451
1451
  if (!match) {
1452
1452
  continue;
1453
1453
  }
1454
- const uri = uriTemplate.fill(match);
1455
1454
  const result = await resourceTemplate.load(
1456
1455
  match,
1457
1456
  this.#auth,
1458
1457
  this.#createLoadContext(
1459
- _optionalChain([request, 'access', _55 => _55.params, 'optionalAccess', _56 => _56._meta]),
1458
+ _optionalChain([request, 'access', _54 => _54.params, 'optionalAccess', _55 => _55._meta]),
1460
1459
  extra.sendNotification,
1461
1460
  extra.requestId
1462
1461
  )
@@ -1468,7 +1467,9 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1468
1467
  description: resourceTemplate.description,
1469
1468
  mimeType: _nullishCoalesce(resource2.mimeType, () => ( resourceTemplate.mimeType)),
1470
1469
  name: resourceTemplate.name,
1471
- uri: _nullishCoalesce(resource2.uri, () => ( uri))
1470
+ // The URI asked for. Refilling the template from `match` can
1471
+ // spell it differently: `{path}` refills `a,b` as `a%2Cb`.
1472
+ uri: _nullishCoalesce(resource2.uri, () => ( request.params.uri))
1472
1473
  }))
1473
1474
  };
1474
1475
  }
@@ -1486,7 +1487,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1486
1487
  maybeArrayResult = await resource.load(
1487
1488
  this.#auth,
1488
1489
  this.#createLoadContext(
1489
- _optionalChain([request, 'access', _57 => _57.params, 'optionalAccess', _58 => _58._meta]),
1490
+ _optionalChain([request, 'access', _56 => _56.params, 'optionalAccess', _57 => _57._meta]),
1490
1491
  extra.sendNotification,
1491
1492
  extra.requestId
1492
1493
  )
@@ -1552,7 +1553,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1552
1553
  );
1553
1554
  }
1554
1555
  setupRootsHandlers() {
1555
- if (_optionalChain([this, 'access', _59 => _59.#rootsConfig, 'optionalAccess', _60 => _60.enabled]) === false) {
1556
+ if (_optionalChain([this, 'access', _58 => _58.#rootsConfig, 'optionalAccess', _59 => _59.enabled]) === false) {
1556
1557
  this.#logger.debug(
1557
1558
  "[FastMCP debug] roots capability explicitly disabled via config"
1558
1559
  );
@@ -1649,7 +1650,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1649
1650
  }
1650
1651
  args = parsed.value;
1651
1652
  }
1652
- const progressToken = _optionalChain([request, 'access', _61 => _61.params, 'optionalAccess', _62 => _62._meta, 'optionalAccess', _63 => _63.progressToken]);
1653
+ const progressToken = _optionalChain([request, 'access', _60 => _60.params, 'optionalAccess', _61 => _61._meta, 'optionalAccess', _62 => _62.progressToken]);
1653
1654
  let result;
1654
1655
  const timeoutAbort = new AbortController();
1655
1656
  const signal = AbortSignal.any([
@@ -1729,7 +1730,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1729
1730
  elicit: this.#createElicit(extra.requestId),
1730
1731
  log,
1731
1732
  reportProgress,
1732
- requestId: typeof _optionalChain([request, 'access', _64 => _64.params, 'optionalAccess', _65 => _65._meta, 'optionalAccess', _66 => _66.requestId]) === "string" ? request.params._meta.requestId : void 0,
1733
+ requestId: typeof _optionalChain([request, 'access', _63 => _63.params, 'optionalAccess', _64 => _64._meta, 'optionalAccess', _65 => _65.requestId]) === "string" ? request.params._meta.requestId : void 0,
1733
1734
  session: this.#auth,
1734
1735
  sessionId: this.sessionId,
1735
1736
  signal,
@@ -1879,6 +1880,19 @@ function matchUriTemplate(template, uri) {
1879
1880
  if (!match) {
1880
1881
  return void 0;
1881
1882
  }
1883
+ const scalarNames = new Set(template.varNames);
1884
+ for (const [expression] of template.template.matchAll(/\{[^}]*\}/g)) {
1885
+ if (/^\{[?&]/.test(expression) || expression.includes("*")) {
1886
+ for (const name of _uritemplates2.default.call(void 0, expression).varNames) {
1887
+ scalarNames.delete(name);
1888
+ }
1889
+ }
1890
+ }
1891
+ for (const [name, value] of Object.entries(match)) {
1892
+ if (scalarNames.has(name) && Array.isArray(value)) {
1893
+ match[name] = value.join(",");
1894
+ }
1895
+ }
1882
1896
  const checksQuery = !/\{[?&]/.test(template.template);
1883
1897
  const checksFragment = !template.template.includes("{#");
1884
1898
  const shape = (value) => [
@@ -1900,7 +1914,7 @@ function normalizePath(path) {
1900
1914
  return path.startsWith("/") ? path : `/${path}`;
1901
1915
  }
1902
1916
  function parseBasicAuthHeader(authHeader) {
1903
- const basicMatch = _optionalChain([authHeader, 'optionalAccess', _67 => _67.match, 'call', _68 => _68(/^Basic\s+(.+)$/)]);
1917
+ const basicMatch = _optionalChain([authHeader, 'optionalAccess', _66 => _66.match, 'call', _67 => _67(/^Basic\s+(.+)$/)]);
1904
1918
  if (!basicMatch) return null;
1905
1919
  try {
1906
1920
  const credentials = Buffer.from(basicMatch[1], "base64").toString("utf-8");
@@ -2570,9 +2584,9 @@ var FastMCP = class extends FastMCPEventEmitter {
2570
2584
  const originalOnClose = transport.onclose;
2571
2585
  transport.onclose = () => {
2572
2586
  closed = true;
2573
- _optionalChain([onClose, 'optionalCall', _69 => _69()]);
2587
+ _optionalChain([onClose, 'optionalCall', _68 => _68()]);
2574
2588
  this.#removeSession(session);
2575
- _optionalChain([originalOnClose, 'optionalCall', _70 => _70()]);
2589
+ _optionalChain([originalOnClose, 'optionalCall', _69 => _69()]);
2576
2590
  };
2577
2591
  await session.connect(transport);
2578
2592
  if (closed) {
@@ -2637,7 +2651,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2637
2651
  */
2638
2652
  #createUnauthorizedResponse(message) {
2639
2653
  const oauth = this.#options.oauth;
2640
- const resource = _optionalChain([oauth, 'optionalAccess', _71 => _71.enabled]) ? _optionalChain([oauth, 'access', _72 => _72.protectedResource, 'optionalAccess', _73 => _73.resource]) : void 0;
2654
+ const resource = _optionalChain([oauth, 'optionalAccess', _70 => _70.enabled]) ? _optionalChain([oauth, 'access', _71 => _71.protectedResource, 'optionalAccess', _72 => _72.resource]) : void 0;
2641
2655
  const wwwAuthenticateParts = [
2642
2656
  'error="invalid_token"',
2643
2657
  `error_description="${message.replace(/"/g, '\\"')}"`
@@ -2776,7 +2790,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2776
2790
  }
2777
2791
  }
2778
2792
  const oauthConfig = this.#options.oauth;
2779
- if (_optionalChain([oauthConfig, 'optionalAccess', _74 => _74.enabled]) && req.method === "GET") {
2793
+ if (_optionalChain([oauthConfig, 'optionalAccess', _73 => _73.enabled]) && req.method === "GET") {
2780
2794
  const url2 = new URL(req.url || "", `http://${host}`);
2781
2795
  const authorizationServerMetadataPath = joinPaths(
2782
2796
  "",
@@ -2810,8 +2824,8 @@ var FastMCP = class extends FastMCPEventEmitter {
2810
2824
  }
2811
2825
  }
2812
2826
  }
2813
- const oauthProxy = _optionalChain([oauthConfig, 'optionalAccess', _75 => _75.proxy]);
2814
- if (oauthProxy && _optionalChain([oauthConfig, 'optionalAccess', _76 => _76.enabled])) {
2827
+ const oauthProxy = _optionalChain([oauthConfig, 'optionalAccess', _74 => _74.proxy]);
2828
+ if (oauthProxy && _optionalChain([oauthConfig, 'optionalAccess', _75 => _75.enabled])) {
2815
2829
  const url2 = new URL(req.url || "", `http://${host}`);
2816
2830
  const oauthPath = basePathRelativePath;
2817
2831
  try {
@@ -2864,7 +2878,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2864
2878
  const statusCode = error.statusCode || 400;
2865
2879
  res.writeHead(statusCode, OAUTH_CREDENTIAL_RESPONSE_HEADERS).end(
2866
2880
  JSON.stringify(
2867
- _optionalChain([error, 'access', _77 => _77.toJSON, 'optionalCall', _78 => _78()]) || {
2881
+ _optionalChain([error, 'access', _76 => _76.toJSON, 'optionalCall', _77 => _77()]) || {
2868
2882
  error: "invalid_request"
2869
2883
  }
2870
2884
  )
@@ -2891,7 +2905,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2891
2905
  } catch (error) {
2892
2906
  res.writeHead(400, { "Content-Type": "application/json" }).end(
2893
2907
  JSON.stringify(
2894
- _optionalChain([error, 'access', _79 => _79.toJSON, 'optionalCall', _80 => _80()]) || {
2908
+ _optionalChain([error, 'access', _78 => _78.toJSON, 'optionalCall', _79 => _79()]) || {
2895
2909
  error: "invalid_request"
2896
2910
  }
2897
2911
  )
@@ -2913,7 +2927,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2913
2927
  } catch (error) {
2914
2928
  res.writeHead(400, { "Content-Type": "application/json" }).end(
2915
2929
  JSON.stringify(
2916
- _optionalChain([error, 'access', _81 => _81.toJSON, 'optionalCall', _82 => _82()]) || {
2930
+ _optionalChain([error, 'access', _80 => _80.toJSON, 'optionalCall', _81 => _81()]) || {
2917
2931
  error: "server_error"
2918
2932
  }
2919
2933
  )
@@ -2982,7 +2996,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2982
2996
  } catch (error) {
2983
2997
  res.writeHead(400, { "Content-Type": "application/json" }).end(
2984
2998
  JSON.stringify(
2985
- _optionalChain([error, 'access', _83 => _83.toJSON, 'optionalCall', _84 => _84()]) || {
2999
+ _optionalChain([error, 'access', _82 => _82.toJSON, 'optionalCall', _83 => _83()]) || {
2986
3000
  error: "server_error"
2987
3001
  }
2988
3002
  )
@@ -3040,8 +3054,8 @@ var FastMCP = class extends FastMCPEventEmitter {
3040
3054
  const basicAuth = parseBasicAuthHeader(
3041
3055
  req.headers.authorization
3042
3056
  );
3043
- const clientId = _optionalChain([basicAuth, 'optionalAccess', _85 => _85.clientId]) || params.get("client_id") || "";
3044
- const clientSecret = _nullishCoalesce(_nullishCoalesce(_optionalChain([basicAuth, 'optionalAccess', _86 => _86.clientSecret]), () => ( params.get("client_secret"))), () => ( void 0));
3057
+ const clientId = _optionalChain([basicAuth, 'optionalAccess', _84 => _84.clientId]) || params.get("client_id") || "";
3058
+ const clientSecret = _nullishCoalesce(_nullishCoalesce(_optionalChain([basicAuth, 'optionalAccess', _85 => _85.clientSecret]), () => ( params.get("client_secret"))), () => ( void 0));
3045
3059
  let response;
3046
3060
  if (grantType === "authorization_code") {
3047
3061
  response = await oauthProxy.exchangeAuthorizationCode({
@@ -3071,7 +3085,7 @@ var FastMCP = class extends FastMCPEventEmitter {
3071
3085
  const statusCode = error.statusCode || 400;
3072
3086
  res.writeHead(statusCode, OAUTH_CREDENTIAL_RESPONSE_HEADERS).end(
3073
3087
  JSON.stringify(
3074
- _optionalChain([error, 'access', _87 => _87.toJSON, 'optionalCall', _88 => _88()]) || {
3088
+ _optionalChain([error, 'access', _86 => _86.toJSON, 'optionalCall', _87 => _87()]) || {
3075
3089
  error: "invalid_request"
3076
3090
  }
3077
3091
  )
@@ -3097,7 +3111,7 @@ var FastMCP = class extends FastMCPEventEmitter {
3097
3111
  * regardless (RFC 7235), so no config is needed just to get the header.
3098
3112
  */
3099
3113
  #httpStreamOAuthConfig() {
3100
- const resource = _optionalChain([this, 'access', _89 => _89.#options, 'access', _90 => _90.oauth, 'optionalAccess', _91 => _91.enabled]) ? _optionalChain([this, 'access', _92 => _92.#options, 'access', _93 => _93.oauth, 'access', _94 => _94.protectedResource, 'optionalAccess', _95 => _95.resource]) : void 0;
3114
+ const resource = _optionalChain([this, 'access', _88 => _88.#options, 'access', _89 => _89.oauth, 'optionalAccess', _90 => _90.enabled]) ? _optionalChain([this, 'access', _91 => _91.#options, 'access', _92 => _92.oauth, 'access', _93 => _93.protectedResource, 'optionalAccess', _94 => _94.resource]) : void 0;
3101
3115
  if (!resource) {
3102
3116
  return {};
3103
3117
  }
@@ -3203,24 +3217,24 @@ var FastMCP = class extends FastMCPEventEmitter {
3203
3217
  const envBasePath = process.env.FASTMCP_BASE_PATH;
3204
3218
  const envStateless = process.env.FASTMCP_STATELESS;
3205
3219
  const envHost = process.env.FASTMCP_HOST;
3206
- const transportType = _optionalChain([overrides, 'optionalAccess', _96 => _96.transportType]) || parseTransportSetting(transportArg, "--transport") || parseTransportSetting(envTransport, "FASTMCP_TRANSPORT") || "stdio";
3220
+ const transportType = _optionalChain([overrides, 'optionalAccess', _95 => _95.transportType]) || parseTransportSetting(transportArg, "--transport") || parseTransportSetting(envTransport, "FASTMCP_TRANSPORT") || "stdio";
3207
3221
  if (transportType === "httpStream") {
3208
3222
  const port = parseInt(
3209
- _optionalChain([overrides, 'optionalAccess', _97 => _97.httpStream, 'optionalAccess', _98 => _98.port, 'optionalAccess', _99 => _99.toString, 'call', _100 => _100()]) || portArg || envPort || "8080"
3223
+ _optionalChain([overrides, 'optionalAccess', _96 => _96.httpStream, 'optionalAccess', _97 => _97.port, 'optionalAccess', _98 => _98.toString, 'call', _99 => _99()]) || portArg || envPort || "8080"
3210
3224
  );
3211
- const host = _optionalChain([overrides, 'optionalAccess', _101 => _101.httpStream, 'optionalAccess', _102 => _102.host]) || hostArg || envHost || "localhost";
3212
- const endpoint = _optionalChain([overrides, 'optionalAccess', _103 => _103.httpStream, 'optionalAccess', _104 => _104.endpoint]) || endpointArg || envEndpoint || "/mcp";
3225
+ const host = _optionalChain([overrides, 'optionalAccess', _100 => _100.httpStream, 'optionalAccess', _101 => _101.host]) || hostArg || envHost || "localhost";
3226
+ const endpoint = _optionalChain([overrides, 'optionalAccess', _102 => _102.httpStream, 'optionalAccess', _103 => _103.endpoint]) || endpointArg || envEndpoint || "/mcp";
3213
3227
  const basePath = normalizeBasePath(
3214
- _optionalChain([overrides, 'optionalAccess', _105 => _105.httpStream, 'optionalAccess', _106 => _106.basePath]) || basePathArg || envBasePath
3228
+ _optionalChain([overrides, 'optionalAccess', _104 => _104.httpStream, 'optionalAccess', _105 => _105.basePath]) || basePathArg || envBasePath
3215
3229
  );
3216
- const enableJsonResponse = _optionalChain([overrides, 'optionalAccess', _107 => _107.httpStream, 'optionalAccess', _108 => _108.enableJsonResponse]) || false;
3217
- const stateless = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([overrides, 'optionalAccess', _109 => _109.httpStream, 'optionalAccess', _110 => _110.stateless]), () => ( // A bare `--stateless` means `--stateless true`.
3230
+ const enableJsonResponse = _optionalChain([overrides, 'optionalAccess', _106 => _106.httpStream, 'optionalAccess', _107 => _107.enableJsonResponse]) || false;
3231
+ const stateless = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([overrides, 'optionalAccess', _108 => _108.httpStream, 'optionalAccess', _109 => _109.stateless]), () => ( // A bare `--stateless` means `--stateless true`.
3218
3232
  (statelessArg === "" ? true : parseBooleanSetting(statelessArg, "--stateless")))), () => ( parseBooleanSetting(envStateless, "FASTMCP_STATELESS"))), () => ( false));
3219
- const cors = _optionalChain([overrides, 'optionalAccess', _111 => _111.httpStream, 'optionalAccess', _112 => _112.cors]);
3220
- const eventStore = _optionalChain([overrides, 'optionalAccess', _113 => _113.httpStream, 'optionalAccess', _114 => _114.eventStore]);
3221
- const sslCa = _optionalChain([overrides, 'optionalAccess', _115 => _115.httpStream, 'optionalAccess', _116 => _116.sslCa]);
3222
- const sslCert = _optionalChain([overrides, 'optionalAccess', _117 => _117.httpStream, 'optionalAccess', _118 => _118.sslCert]);
3223
- const sslKey = _optionalChain([overrides, 'optionalAccess', _119 => _119.httpStream, 'optionalAccess', _120 => _120.sslKey]);
3233
+ const cors = _optionalChain([overrides, 'optionalAccess', _110 => _110.httpStream, 'optionalAccess', _111 => _111.cors]);
3234
+ const eventStore = _optionalChain([overrides, 'optionalAccess', _112 => _112.httpStream, 'optionalAccess', _113 => _113.eventStore]);
3235
+ const sslCa = _optionalChain([overrides, 'optionalAccess', _114 => _114.httpStream, 'optionalAccess', _115 => _115.sslCa]);
3236
+ const sslCert = _optionalChain([overrides, 'optionalAccess', _116 => _116.httpStream, 'optionalAccess', _117 => _117.sslCert]);
3237
+ const sslKey = _optionalChain([overrides, 'optionalAccess', _118 => _118.httpStream, 'optionalAccess', _119 => _119.sslKey]);
3224
3238
  return {
3225
3239
  httpStream: {
3226
3240
  basePath,
@@ -3312,7 +3326,7 @@ var FastMCP = class extends FastMCPEventEmitter {
3312
3326
  */
3313
3327
  #useEndpointAsResource(endpoint) {
3314
3328
  const oauth = this.#options.oauth;
3315
- if (this.#providerResourceBase === void 0 || !_optionalChain([oauth, 'optionalAccess', _121 => _121.protectedResource]))
3329
+ if (this.#providerResourceBase === void 0 || !_optionalChain([oauth, 'optionalAccess', _120 => _120.protectedResource]))
3316
3330
  return;
3317
3331
  this.#options = {
3318
3332
  ...this.#options,
@@ -3341,4 +3355,4 @@ var FastMCP = class extends FastMCPEventEmitter {
3341
3355
 
3342
3356
 
3343
3357
  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;
3344
- //# sourceMappingURL=chunk-PV5VLW7R.cjs.map
3358
+ //# sourceMappingURL=chunk-X5ITW7FV.cjs.map