You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,23 +19,23 @@ export class SseError extends Error {
19
19
exporttypeSSEClientTransportOptions={
20
20
/**
21
21
* An OAuth client provider to use for authentication.
22
-
*
22
+
*
23
23
* When an `authProvider` is specified and the SSE connection is started:
24
24
* 1. The connection is attempted with any existing access token from the `authProvider`.
25
25
* 2. If the access token has expired, the `authProvider` is used to refresh the token.
26
26
* 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`.
27
-
*
27
+
*
28
28
* After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `SSEClientTransport.finishAuth` with the authorization code before retrying the connection.
29
-
*
29
+
*
30
30
* If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown.
31
-
*
31
+
*
32
32
* `UnauthorizedError` might also be thrown when sending any message over the SSE transport, indicating that the session has expired, and needs to be re-authed and reconnected.
33
33
*/
34
34
authProvider?: OAuthClientProvider;
35
35
36
36
/**
37
37
* Customizes the initial SSE request to the server (the request that begins the stream).
38
-
*
38
+
*
39
39
* NOTE: Setting this property will prevent an `Authorization` header from
40
40
* being automatically attached to the SSE request, if an `authProvider` is
41
41
* also given. This can be worked around by setting the `Authorization` header
@@ -58,6 +58,7 @@ export class SSEClientTransport implements Transport {
58
58
private_endpoint?: URL;
59
59
private_abortController?: AbortController;
60
60
private_url: URL;
61
+
private_authServerUrl: URL|undefined;
61
62
private_eventSourceInit?: EventSourceInit;
62
63
private_requestInit?: RequestInit;
63
64
private_authProvider?: OAuthClientProvider;
@@ -71,6 +72,7 @@ export class SSEClientTransport implements Transport {
71
72
opts?: SSEClientTransportOptions,
72
73
){
73
74
this._url=url;
75
+
this._authServerUrl=undefined;
74
76
this._eventSourceInit=opts?.eventSourceInit;
75
77
this._requestInit=opts?.requestInit;
76
78
this._authProvider=opts?.authProvider;
@@ -83,7 +85,7 @@ export class SSEClientTransport implements Transport {
0 commit comments