@usemcpkit/core 0.12.0 → 0.13.2
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/build/usemcpkit.core.d.ts +18 -1
- package/build/usemcpkit.core.js +1 -1
- package/package.json +1 -1
|
@@ -241,12 +241,29 @@ declare interface NoneAuth {
|
|
|
241
241
|
|
|
242
242
|
export declare const number: (description?: string, options?: ParamOptions) => Param;
|
|
243
243
|
|
|
244
|
+
export declare type OAuthAuth = OAuthEndpointsAuth | OAuthDiscoveryAuth;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* The same flow for an MCP server that publishes its own sign-in: the endpoints come from its OAuth metadata (RFC 9728
|
|
248
|
+
* and RFC 8414) and usemcpkit registers itself as a client (RFC 7591), so one click signs in with no app, client id
|
|
249
|
+
* or token typed anywhere. A `clientId` skips the registration.
|
|
250
|
+
*/
|
|
251
|
+
export declare interface OAuthDiscoveryAuth extends OAuthSignInOptions {
|
|
252
|
+
type: "oauth";
|
|
253
|
+
/** The MCP server url, https only. */
|
|
254
|
+
discovery: string;
|
|
255
|
+
clientId?: string;
|
|
256
|
+
}
|
|
257
|
+
|
|
244
258
|
/** OAuth 2.0 authorization code flow with PKCE; the browser sign-in starts on the first tool call without a stored token. */
|
|
245
|
-
export declare interface
|
|
259
|
+
export declare interface OAuthEndpointsAuth extends OAuthSignInOptions {
|
|
246
260
|
type: "oauth";
|
|
247
261
|
authorizationUrl: string;
|
|
248
262
|
tokenUrl: string;
|
|
249
263
|
clientId: string;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare interface OAuthSignInOptions {
|
|
250
267
|
clientSecretEnv?: string;
|
|
251
268
|
scopes?: readonly string[];
|
|
252
269
|
/** Loopback port for the redirect URI; 0 picks a free port. */
|
package/build/usemcpkit.core.js
CHANGED
|
@@ -90,7 +90,7 @@ var fillDomainUrl = (template, domain, loopbackHttp) => {
|
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region src/manifest/domain/apply-auth-domain.ts
|
|
92
92
|
var applyAuthDomain = (auth, domain, loopbackHttp) => {
|
|
93
|
-
if (auth.type !== "oauth") return auth;
|
|
93
|
+
if (auth.type !== "oauth" || "discovery" in auth) return auth;
|
|
94
94
|
return {
|
|
95
95
|
...auth,
|
|
96
96
|
authorizationUrl: fillDomainUrl(auth.authorizationUrl, domain, loopbackHttp),
|