fastmcp 4.19.1 → 4.20.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.
- package/dist/FastMCP.cjs +2 -2
- package/dist/FastMCP.js +1 -1
- package/dist/{chunk-XJWV6G5Q.js → chunk-RGV6FTGL.js} +25 -15
- package/dist/{chunk-XJWV6G5Q.js.map → chunk-RGV6FTGL.js.map} +1 -1
- package/dist/{chunk-KGXPEC7J.cjs → chunk-TMDXVX4L.cjs} +48 -38
- package/dist/chunk-TMDXVX4L.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 +131 -43
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +19 -0
- package/dist/openapi/index.d.ts +19 -0
- package/dist/openapi/index.js +124 -36
- package/dist/openapi/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-KGXPEC7J.cjs.map +0 -1
package/dist/FastMCP.cjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkTMDXVX4Lcjs = require('./chunk-TMDXVX4L.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 = _chunkTMDXVX4Lcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkTMDXVX4Lcjs.FastMCP; exports.FastMCPError = _chunkTMDXVX4Lcjs.FastMCPError; exports.FastMCPSession = _chunkTMDXVX4Lcjs.FastMCPSession; exports.GitHubProvider = _chunkYO76IUZ6cjs.GitHubProvider; exports.GoogleProvider = _chunkYO76IUZ6cjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkTMDXVX4Lcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkYO76IUZ6cjs.OAuthProvider; exports.ServerState = _chunkTMDXVX4Lcjs.ServerState; exports.SessionError = _chunkTMDXVX4Lcjs.SessionError; exports.UnexpectedStateError = _chunkTMDXVX4Lcjs.UnexpectedStateError; exports.UserError = _chunkTMDXVX4Lcjs.UserError; exports.audioContent = _chunkTMDXVX4Lcjs.audioContent; exports.getAuthSession = _chunkYO76IUZ6cjs.getAuthSession; exports.imageContent = _chunkTMDXVX4Lcjs.imageContent; exports.jsonSchemaAdapter = _chunkTMDXVX4Lcjs.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
|
@@ -2097,13 +2097,7 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
2097
2097
|
enableJsonResponse: httpConfig.enableJsonResponse,
|
|
2098
2098
|
eventStore: httpConfig.eventStore,
|
|
2099
2099
|
host: httpConfig.host,
|
|
2100
|
-
...this.#
|
|
2101
|
-
oauth: {
|
|
2102
|
-
protectedResource: {
|
|
2103
|
-
resource: this.#options.oauth.protectedResource.resource
|
|
2104
|
-
}
|
|
2105
|
-
}
|
|
2106
|
-
} : {},
|
|
2100
|
+
...this.#httpStreamOAuthConfig(),
|
|
2107
2101
|
// In stateless mode, we don't track sessions
|
|
2108
2102
|
onClose: async () => {
|
|
2109
2103
|
},
|
|
@@ -2145,13 +2139,7 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
2145
2139
|
enableJsonResponse: httpConfig.enableJsonResponse,
|
|
2146
2140
|
eventStore: httpConfig.eventStore,
|
|
2147
2141
|
host: httpConfig.host,
|
|
2148
|
-
...this.#
|
|
2149
|
-
oauth: {
|
|
2150
|
-
protectedResource: {
|
|
2151
|
-
resource: this.#options.oauth.protectedResource.resource
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
} : {},
|
|
2142
|
+
...this.#httpStreamOAuthConfig(),
|
|
2155
2143
|
onClose: async (session) => {
|
|
2156
2144
|
const sessionIndex = this.#sessions.indexOf(session);
|
|
2157
2145
|
if (sessionIndex !== -1) this.#sessions.splice(sessionIndex, 1);
|
|
@@ -2690,6 +2678,28 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
2690
2678
|
}
|
|
2691
2679
|
}
|
|
2692
2680
|
};
|
|
2681
|
+
/**
|
|
2682
|
+
* mcp-proxy only emits `WWW-Authenticate` on 401 when `oauth` is set.
|
|
2683
|
+
* Custom `authenticate()` still needs that challenge with no OAuth metadata
|
|
2684
|
+
* configured (RFC 7235). Pass an empty oauth object in that case so the
|
|
2685
|
+
* header is present without advertising a resource_metadata URL that 404s.
|
|
2686
|
+
*/
|
|
2687
|
+
#httpStreamOAuthConfig() {
|
|
2688
|
+
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: {} };
|
|
2700
|
+
}
|
|
2701
|
+
return {};
|
|
2702
|
+
}
|
|
2693
2703
|
/**
|
|
2694
2704
|
* On `httpStream`, `authenticate` is handed to both mcp-proxy (which calls it
|
|
2695
2705
|
* once per request to gate the 401) and this server's own `createServer`
|
|
@@ -2892,4 +2902,4 @@ export {
|
|
|
2892
2902
|
FastMCPSession,
|
|
2893
2903
|
FastMCP
|
|
2894
2904
|
};
|
|
2895
|
-
//# sourceMappingURL=chunk-
|
|
2905
|
+
//# sourceMappingURL=chunk-RGV6FTGL.js.map
|