fastmcp 4.22.4 → 4.22.5

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/README.md CHANGED
@@ -518,10 +518,10 @@ You can also enable stateless mode using CLI arguments or environment variables:
518
518
 
519
519
  ```bash
520
520
  # Via CLI argument
521
- npx fastmcp dev src/server.ts --transport http-stream --port 8080 --stateless true
521
+ npx tsx src/server.ts --transport http-stream --port 8080 --stateless true
522
522
 
523
523
  # Via environment variable
524
- FASTMCP_STATELESS=true npx fastmcp dev src/server.ts
524
+ FASTMCP_TRANSPORT=httpStream FASTMCP_STATELESS=true npx tsx src/server.ts
525
525
  ```
526
526
 
527
527
  The `/ready` health check endpoint will indicate when the server is running in stateless mode:
package/dist/FastMCP.cjs CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkV37MCHBLcjs = require('./chunk-V37MCHBL.cjs');
14
+ var _chunkPAWIMJ72cjs = require('./chunk-PAWIMJ72.cjs');
15
15
 
16
16
 
17
17
 
@@ -50,5 +50,5 @@ require('./chunk-O22SYZMC.cjs');
50
50
 
51
51
 
52
52
 
53
- exports.AuthProvider = _chunkYOBCXNFPcjs.AuthProvider; exports.AzureProvider = _chunkYOBCXNFPcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkV37MCHBLcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkV37MCHBLcjs.FastMCP; exports.FastMCPError = _chunkV37MCHBLcjs.FastMCPError; exports.FastMCPSession = _chunkV37MCHBLcjs.FastMCPSession; exports.GitHubProvider = _chunkYOBCXNFPcjs.GitHubProvider; exports.GoogleProvider = _chunkYOBCXNFPcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkV37MCHBLcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkYOBCXNFPcjs.OAuthProvider; exports.ServerState = _chunkV37MCHBLcjs.ServerState; exports.SessionError = _chunkV37MCHBLcjs.SessionError; exports.UnexpectedStateError = _chunkV37MCHBLcjs.UnexpectedStateError; exports.UserError = _chunkV37MCHBLcjs.UserError; exports.audioContent = _chunkV37MCHBLcjs.audioContent; exports.getAuthSession = _chunkYOBCXNFPcjs.getAuthSession; exports.imageContent = _chunkV37MCHBLcjs.imageContent; exports.jsonSchemaAdapter = _chunkV37MCHBLcjs.jsonSchemaAdapter; exports.requireAll = _chunkYOBCXNFPcjs.requireAll; exports.requireAny = _chunkYOBCXNFPcjs.requireAny; exports.requireAuth = _chunkYOBCXNFPcjs.requireAuth; exports.requireRole = _chunkYOBCXNFPcjs.requireRole; exports.requireScopes = _chunkYOBCXNFPcjs.requireScopes;
53
+ exports.AuthProvider = _chunkYOBCXNFPcjs.AuthProvider; exports.AzureProvider = _chunkYOBCXNFPcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkPAWIMJ72cjs.DiscoveryDocumentCache; exports.FastMCP = _chunkPAWIMJ72cjs.FastMCP; exports.FastMCPError = _chunkPAWIMJ72cjs.FastMCPError; exports.FastMCPSession = _chunkPAWIMJ72cjs.FastMCPSession; exports.GitHubProvider = _chunkYOBCXNFPcjs.GitHubProvider; exports.GoogleProvider = _chunkYOBCXNFPcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkPAWIMJ72cjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkYOBCXNFPcjs.OAuthProvider; exports.ServerState = _chunkPAWIMJ72cjs.ServerState; exports.SessionError = _chunkPAWIMJ72cjs.SessionError; exports.UnexpectedStateError = _chunkPAWIMJ72cjs.UnexpectedStateError; exports.UserError = _chunkPAWIMJ72cjs.UserError; exports.audioContent = _chunkPAWIMJ72cjs.audioContent; exports.getAuthSession = _chunkYOBCXNFPcjs.getAuthSession; exports.imageContent = _chunkPAWIMJ72cjs.imageContent; exports.jsonSchemaAdapter = _chunkPAWIMJ72cjs.jsonSchemaAdapter; exports.requireAll = _chunkYOBCXNFPcjs.requireAll; exports.requireAny = _chunkYOBCXNFPcjs.requireAny; exports.requireAuth = _chunkYOBCXNFPcjs.requireAuth; exports.requireRole = _chunkYOBCXNFPcjs.requireRole; exports.requireScopes = _chunkYOBCXNFPcjs.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-TFX7BV4K.js";
14
+ } from "./chunk-A6QGY7T7.js";
15
15
  import {
16
16
  AuthProvider,
17
17
  AzureProvider,
@@ -1048,9 +1048,11 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1048
1048
  return parsed.value;
1049
1049
  }
1050
1050
  addPrompt(inputPrompt) {
1051
- const completers = {};
1052
- const enums = {};
1053
- const fuseInstances = {};
1051
+ const completers = /* @__PURE__ */ Object.create(
1052
+ null
1053
+ );
1054
+ const enums = /* @__PURE__ */ Object.create(null);
1055
+ const fuseInstances = /* @__PURE__ */ Object.create(null);
1054
1056
  for (const argument of inputPrompt.arguments ?? []) {
1055
1057
  if (argument.complete) {
1056
1058
  completers[argument.name] = argument.complete;
@@ -1098,7 +1100,9 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1098
1100
  this.#resources.set(inputResource.uri, inputResource);
1099
1101
  }
1100
1102
  addResourceTemplate(inputResourceTemplate) {
1101
- const completers = {};
1103
+ const completers = /* @__PURE__ */ Object.create(
1104
+ null
1105
+ );
1102
1106
  for (const argument of inputResourceTemplate.arguments ?? []) {
1103
1107
  if (argument.complete) {
1104
1108
  completers[argument.name] = argument.complete;
@@ -1233,7 +1237,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1233
1237
  }
1234
1238
  const args = request.params.arguments;
1235
1239
  for (const arg of prompt.arguments ?? []) {
1236
- if (arg.required && !(args && arg.name in args)) {
1240
+ if (arg.required && !(args && Object.hasOwn(args, arg.name))) {
1237
1241
  throw new McpError(
1238
1242
  ErrorCode.InvalidParams,
1239
1243
  `Prompt '${request.params.name}' requires argument '${arg.name}': ${arg.description || "No description provided"}`
@@ -2922,7 +2926,7 @@ var FastMCP = class extends FastMCPEventEmitter {
2922
2926
  overrides?.httpStream?.basePath || basePathArg || envBasePath
2923
2927
  );
2924
2928
  const enableJsonResponse = overrides?.httpStream?.enableJsonResponse || false;
2925
- const stateless = overrides?.httpStream?.stateless || statelessArg === "true" || envStateless === "true" || false;
2929
+ const stateless = overrides?.httpStream?.stateless ?? (statelessArg !== void 0 ? statelessArg === "true" : envStateless === "true");
2926
2930
  const cors = overrides?.httpStream?.cors;
2927
2931
  const eventStore = overrides?.httpStream?.eventStore;
2928
2932
  const sslCa = overrides?.httpStream?.sslCa;
@@ -3048,4 +3052,4 @@ export {
3048
3052
  FastMCPSession,
3049
3053
  FastMCP
3050
3054
  };
3051
- //# sourceMappingURL=chunk-TFX7BV4K.js.map
3055
+ //# sourceMappingURL=chunk-A6QGY7T7.js.map