tiny-http-mcp-server 0.1.21 → 0.1.23
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/composition.json +1 -1
- package/node_modules/mcp-oauth/README.md +31 -1
- package/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +63 -14
- package/node_modules/mcp-oauth/dist/client/loopback-authorization.d.ts +5 -0
- package/node_modules/mcp-oauth/dist/client/loopback-authorization.js +134 -72
- package/node_modules/mcp-oauth/dist/client/token-endpoint.d.ts +2 -0
- package/node_modules/mcp-oauth/dist/client/token-endpoint.js +5 -1
- package/node_modules/mcp-oauth/dist/client/types.d.ts +14 -1
- package/node_modules/tiny-mcp-client/README.md +3 -1
- package/node_modules/tiny-mcp-client/dist/index.d.ts +17 -2
- package/node_modules/tiny-mcp-client/dist/index.js +273 -116
- package/package.json +1 -1
|
@@ -109,6 +109,7 @@ interface OAuthClientProvider {
|
|
|
109
109
|
requestUrl: URL;
|
|
110
110
|
headers: Headers;
|
|
111
111
|
fetch: OAuthMetadataFetch;
|
|
112
|
+
signal?: AbortSignal;
|
|
112
113
|
}): Promise<void> | void;
|
|
113
114
|
handleUnauthorized(input: {
|
|
114
115
|
requestUrl: URL;
|
|
@@ -116,6 +117,7 @@ interface OAuthClientProvider {
|
|
|
116
117
|
challenge: OAuthUnauthorizedChallenge | null;
|
|
117
118
|
discovery: OAuthDiscoveryResult;
|
|
118
119
|
fetch: OAuthMetadataFetch;
|
|
120
|
+
signal?: AbortSignal;
|
|
119
121
|
}): Promise<{
|
|
120
122
|
action: "retry";
|
|
121
123
|
} | {
|
|
@@ -172,8 +174,19 @@ interface DefaultOAuthClientProviderOptions {
|
|
|
172
174
|
clientSecret?: string;
|
|
173
175
|
metadata?: OAuthClientMetadata;
|
|
174
176
|
};
|
|
177
|
+
/** Disable interactive authorization while allowing cached tokens and silent refresh. */
|
|
178
|
+
allowInteractive?: boolean;
|
|
179
|
+
/** Import an existing grant for one resource. Persisted sessions take precedence. */
|
|
180
|
+
initialGrant?: {
|
|
181
|
+
resource: string;
|
|
182
|
+
tokens: StoredOAuthTokens;
|
|
183
|
+
};
|
|
175
184
|
browser: {
|
|
176
|
-
openBrowser(url: string): Promise<void>;
|
|
185
|
+
openBrowser?(url: string): Promise<void>;
|
|
186
|
+
/** Exact registered HTTP loopback redirect URI. */
|
|
187
|
+
redirectUri?: string;
|
|
188
|
+
signal?: AbortSignal;
|
|
189
|
+
timeoutMs?: number;
|
|
177
190
|
readLine?: () => Promise<string>;
|
|
178
191
|
createServer?: () => http.Server;
|
|
179
192
|
landingPage?: {
|
|
@@ -202,6 +215,7 @@ interface OAuthMetadataDiscoveryOptions {
|
|
|
202
215
|
}
|
|
203
216
|
interface OAuthMetadataLookupOptions {
|
|
204
217
|
resourceMetadataUrl?: string | URL;
|
|
218
|
+
signal?: AbortSignal;
|
|
205
219
|
}
|
|
206
220
|
declare class OAuthMetadataDiscovery {
|
|
207
221
|
private readonly fetchImpl;
|
|
@@ -209,7 +223,7 @@ declare class OAuthMetadataDiscovery {
|
|
|
209
223
|
private readonly memoryCache;
|
|
210
224
|
constructor({ fetch, cache }?: OAuthMetadataDiscoveryOptions);
|
|
211
225
|
private discoverProtectedResource;
|
|
212
|
-
discover(resourceUrl: string | URL, { resourceMetadataUrl }?: OAuthMetadataLookupOptions): Promise<OAuthDiscoveryResult>;
|
|
226
|
+
discover(resourceUrl: string | URL, { resourceMetadataUrl, signal }?: OAuthMetadataLookupOptions): Promise<OAuthDiscoveryResult>;
|
|
213
227
|
}
|
|
214
228
|
declare function discoverOAuthMetadata(resourceUrl: string | URL, options?: OAuthMetadataDiscoveryOptions & OAuthMetadataLookupOptions): Promise<OAuthDiscoveryResult>;
|
|
215
229
|
|
|
@@ -634,6 +648,7 @@ declare class HttpTransport implements McpTransport {
|
|
|
634
648
|
private readonly oauthProvider;
|
|
635
649
|
private readonly oauthMetadataDiscovery;
|
|
636
650
|
private readonly inFlightFetchAbortControllers;
|
|
651
|
+
private readonly inFlightOAuthAbortControllers;
|
|
637
652
|
private readonly openResponseReaders;
|
|
638
653
|
private readonly modernRequests;
|
|
639
654
|
private modernMode;
|