fastmcp 4.22.3 → 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 +2 -2
- package/dist/FastMCP.cjs +2 -2
- package/dist/FastMCP.js +1 -1
- package/dist/{chunk-TFX7BV4K.js → chunk-A6QGY7T7.js} +11 -7
- package/dist/chunk-A6QGY7T7.js.map +1 -0
- package/dist/{chunk-V37MCHBL.cjs → chunk-PAWIMJ72.cjs} +11 -7
- package/dist/chunk-PAWIMJ72.cjs.map +1 -0
- package/dist/examples/custom-routes.cjs +2 -2
- package/dist/examples/custom-routes.js +1 -1
- package/dist/openapi/index.cjs +51 -19
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +2 -0
- package/dist/openapi/index.d.ts +2 -0
- package/dist/openapi/index.js +37 -5
- package/dist/openapi/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-TFX7BV4K.js.map +0 -1
- package/dist/chunk-V37MCHBL.cjs.map +0 -1
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
|
|
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
|
|
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
|
|
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 =
|
|
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
|
@@ -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
|
-
|
|
1053
|
-
|
|
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
|
|
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
|
|
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-
|
|
3055
|
+
//# sourceMappingURL=chunk-A6QGY7T7.js.map
|