mcp-remote 0.0.19 → 0.0.20
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.
|
@@ -14,7 +14,7 @@ var require_package = __commonJS({
|
|
|
14
14
|
"package.json"(exports, module) {
|
|
15
15
|
module.exports = {
|
|
16
16
|
name: "mcp-remote",
|
|
17
|
-
version: "0.0.
|
|
17
|
+
version: "0.0.20",
|
|
18
18
|
description: "Remote proxy for Model Context Protocol, allowing local-only clients to connect to remote servers using oAuth",
|
|
19
19
|
keywords: [
|
|
20
20
|
"mcp",
|
|
@@ -125,13 +125,17 @@ async function connectToRemoteServer(serverUrl, authProvider, headers, waitForAu
|
|
|
125
125
|
const url = new URL(serverUrl);
|
|
126
126
|
const eventSourceInit = {
|
|
127
127
|
fetch: (url2, init) => {
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
128
|
+
return Promise.resolve(authProvider?.tokens?.()).then(
|
|
129
|
+
(tokens) => fetch(url2, {
|
|
130
|
+
...init,
|
|
131
|
+
headers: {
|
|
132
|
+
...init?.headers,
|
|
133
|
+
...headers,
|
|
134
|
+
...tokens?.access_token ? { Authorization: `Bearer ${tokens.access_token}` } : {},
|
|
135
|
+
Accept: "text/event-stream"
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
);
|
|
135
139
|
}
|
|
136
140
|
};
|
|
137
141
|
const transport = new SSEClientTransport(url, {
|
package/dist/client.js
CHANGED
package/dist/proxy.js
CHANGED