fastmcp 4.20.1 → 4.20.3
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 +2 -2
- package/dist/FastMCP.js +1 -1
- package/dist/{chunk-RGV6FTGL.js → chunk-KBWJEPOD.js} +22 -17
- package/dist/{chunk-RGV6FTGL.js.map → chunk-KBWJEPOD.js.map} +1 -1
- package/dist/{chunk-TMDXVX4L.cjs → chunk-X4AKKWFD.cjs} +22 -17
- package/dist/chunk-X4AKKWFD.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 +5 -5
- package/dist/openapi/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-TMDXVX4L.cjs.map +0 -1
package/dist/FastMCP.cjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkX4AKKWFDcjs = require('./chunk-X4AKKWFD.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -49,5 +49,5 @@ var _chunkYO76IUZ6cjs = require('./chunk-YO76IUZ6.cjs');
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
exports.AuthProvider = _chunkYO76IUZ6cjs.AuthProvider; exports.AzureProvider = _chunkYO76IUZ6cjs.AzureProvider; exports.DiscoveryDocumentCache =
|
|
52
|
+
exports.AuthProvider = _chunkYO76IUZ6cjs.AuthProvider; exports.AzureProvider = _chunkYO76IUZ6cjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkX4AKKWFDcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkX4AKKWFDcjs.FastMCP; exports.FastMCPError = _chunkX4AKKWFDcjs.FastMCPError; exports.FastMCPSession = _chunkX4AKKWFDcjs.FastMCPSession; exports.GitHubProvider = _chunkYO76IUZ6cjs.GitHubProvider; exports.GoogleProvider = _chunkYO76IUZ6cjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkX4AKKWFDcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkYO76IUZ6cjs.OAuthProvider; exports.ServerState = _chunkX4AKKWFDcjs.ServerState; exports.SessionError = _chunkX4AKKWFDcjs.SessionError; exports.UnexpectedStateError = _chunkX4AKKWFDcjs.UnexpectedStateError; exports.UserError = _chunkX4AKKWFDcjs.UserError; exports.audioContent = _chunkX4AKKWFDcjs.audioContent; exports.getAuthSession = _chunkYO76IUZ6cjs.getAuthSession; exports.imageContent = _chunkX4AKKWFDcjs.imageContent; exports.jsonSchemaAdapter = _chunkX4AKKWFDcjs.jsonSchemaAdapter; exports.requireAll = _chunkYO76IUZ6cjs.requireAll; exports.requireAny = _chunkYO76IUZ6cjs.requireAny; exports.requireAuth = _chunkYO76IUZ6cjs.requireAuth; exports.requireRole = _chunkYO76IUZ6cjs.requireRole; exports.requireScopes = _chunkYO76IUZ6cjs.requireScopes;
|
|
53
53
|
//# sourceMappingURL=FastMCP.cjs.map
|
package/dist/FastMCP.js
CHANGED
|
@@ -2280,8 +2280,15 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
2280
2280
|
if (!res.headersSent) {
|
|
2281
2281
|
res.statusCode = honoResponse.status;
|
|
2282
2282
|
honoResponse.headers.forEach((value, key) => {
|
|
2283
|
+
if (key.toLowerCase() === "set-cookie") {
|
|
2284
|
+
return;
|
|
2285
|
+
}
|
|
2283
2286
|
res.setHeader(key, value);
|
|
2284
2287
|
});
|
|
2288
|
+
const setCookies = honoResponse.headers.getSetCookie();
|
|
2289
|
+
if (setCookies.length > 0) {
|
|
2290
|
+
res.setHeader("Set-Cookie", setCookies);
|
|
2291
|
+
}
|
|
2285
2292
|
if (honoResponse.body) {
|
|
2286
2293
|
const reader = honoResponse.body.getReader();
|
|
2287
2294
|
let resolveClosed;
|
|
@@ -2679,26 +2686,24 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
2679
2686
|
}
|
|
2680
2687
|
};
|
|
2681
2688
|
/**
|
|
2682
|
-
*
|
|
2683
|
-
*
|
|
2684
|
-
*
|
|
2685
|
-
*
|
|
2689
|
+
* Only advertise `resource_metadata` when OAuth is enabled: the
|
|
2690
|
+
* `/.well-known/oauth-protected-resource` endpoint is served only under
|
|
2691
|
+
* `oauth.enabled`, so gating here avoids pointing clients at a URL that
|
|
2692
|
+
* would 404. mcp-proxy emits the `WWW-Authenticate` challenge on every 401
|
|
2693
|
+
* regardless (RFC 7235), so no config is needed just to get the header.
|
|
2686
2694
|
*/
|
|
2687
2695
|
#httpStreamOAuthConfig() {
|
|
2688
2696
|
const resource = this.#options.oauth?.enabled ? this.#options.oauth.protectedResource?.resource : void 0;
|
|
2689
|
-
if (resource) {
|
|
2690
|
-
return {
|
|
2691
|
-
oauth: {
|
|
2692
|
-
protectedResource: {
|
|
2693
|
-
resource
|
|
2694
|
-
}
|
|
2695
|
-
}
|
|
2696
|
-
};
|
|
2697
|
-
}
|
|
2698
|
-
if (this.#authenticate) {
|
|
2699
|
-
return { oauth: {} };
|
|
2697
|
+
if (!resource) {
|
|
2698
|
+
return {};
|
|
2700
2699
|
}
|
|
2701
|
-
return {
|
|
2700
|
+
return {
|
|
2701
|
+
oauth: {
|
|
2702
|
+
protectedResource: {
|
|
2703
|
+
resource
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
};
|
|
2702
2707
|
}
|
|
2703
2708
|
/**
|
|
2704
2709
|
* On `httpStream`, `authenticate` is handed to both mcp-proxy (which calls it
|
|
@@ -2902,4 +2907,4 @@ export {
|
|
|
2902
2907
|
FastMCPSession,
|
|
2903
2908
|
FastMCP
|
|
2904
2909
|
};
|
|
2905
|
-
//# sourceMappingURL=chunk-
|
|
2910
|
+
//# sourceMappingURL=chunk-KBWJEPOD.js.map
|