integrate-sdk 0.7.1 → 0.7.3
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/adapters/auto-routes.js +2 -2
- package/dist/adapters/base-handler.js +2 -2
- package/dist/adapters/nextjs.js +2 -2
- package/dist/adapters/node.js +2 -2
- package/dist/adapters/solid-start.js +2 -42
- package/dist/adapters/svelte-kit.js +2 -42
- package/dist/index.js +26 -59
- package/dist/oauth.js +2 -2
- package/dist/server.js +26 -59
- package/dist/src/client.d.ts +0 -6
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/server.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -138,7 +138,7 @@ class OAuthHandler {
|
|
|
138
138
|
return data;
|
|
139
139
|
}
|
|
140
140
|
async handleToolCall(request, authHeader) {
|
|
141
|
-
const url =
|
|
141
|
+
const url = this.serverUrl;
|
|
142
142
|
const headers = this.getHeaders({
|
|
143
143
|
"Content-Type": "application/json"
|
|
144
144
|
});
|
|
@@ -154,7 +154,7 @@ class OAuthHandler {
|
|
|
154
154
|
arguments: request.arguments || {}
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
|
-
const response = await fetch(url
|
|
157
|
+
const response = await fetch(url, {
|
|
158
158
|
method: "POST",
|
|
159
159
|
headers,
|
|
160
160
|
body: JSON.stringify(jsonRpcRequest)
|
|
@@ -138,7 +138,7 @@ class OAuthHandler {
|
|
|
138
138
|
return data;
|
|
139
139
|
}
|
|
140
140
|
async handleToolCall(request, authHeader) {
|
|
141
|
-
const url =
|
|
141
|
+
const url = this.serverUrl;
|
|
142
142
|
const headers = this.getHeaders({
|
|
143
143
|
"Content-Type": "application/json"
|
|
144
144
|
});
|
|
@@ -154,7 +154,7 @@ class OAuthHandler {
|
|
|
154
154
|
arguments: request.arguments || {}
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
|
-
const response = await fetch(url
|
|
157
|
+
const response = await fetch(url, {
|
|
158
158
|
method: "POST",
|
|
159
159
|
headers,
|
|
160
160
|
body: JSON.stringify(jsonRpcRequest)
|
package/dist/adapters/nextjs.js
CHANGED
|
@@ -138,7 +138,7 @@ class OAuthHandler {
|
|
|
138
138
|
return data;
|
|
139
139
|
}
|
|
140
140
|
async handleToolCall(request, authHeader) {
|
|
141
|
-
const url =
|
|
141
|
+
const url = this.serverUrl;
|
|
142
142
|
const headers = this.getHeaders({
|
|
143
143
|
"Content-Type": "application/json"
|
|
144
144
|
});
|
|
@@ -154,7 +154,7 @@ class OAuthHandler {
|
|
|
154
154
|
arguments: request.arguments || {}
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
|
-
const response = await fetch(url
|
|
157
|
+
const response = await fetch(url, {
|
|
158
158
|
method: "POST",
|
|
159
159
|
headers,
|
|
160
160
|
body: JSON.stringify(jsonRpcRequest)
|
package/dist/adapters/node.js
CHANGED
|
@@ -138,7 +138,7 @@ class OAuthHandler {
|
|
|
138
138
|
return data;
|
|
139
139
|
}
|
|
140
140
|
async handleToolCall(request, authHeader) {
|
|
141
|
-
const url =
|
|
141
|
+
const url = this.serverUrl;
|
|
142
142
|
const headers = this.getHeaders({
|
|
143
143
|
"Content-Type": "application/json"
|
|
144
144
|
});
|
|
@@ -154,7 +154,7 @@ class OAuthHandler {
|
|
|
154
154
|
arguments: request.arguments || {}
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
|
-
const response = await fetch(url
|
|
157
|
+
const response = await fetch(url, {
|
|
158
158
|
method: "POST",
|
|
159
159
|
headers,
|
|
160
160
|
body: JSON.stringify(jsonRpcRequest)
|
|
@@ -138,7 +138,7 @@ class OAuthHandler {
|
|
|
138
138
|
return data;
|
|
139
139
|
}
|
|
140
140
|
async handleToolCall(request, authHeader) {
|
|
141
|
-
const url =
|
|
141
|
+
const url = this.serverUrl;
|
|
142
142
|
const headers = this.getHeaders({
|
|
143
143
|
"Content-Type": "application/json"
|
|
144
144
|
});
|
|
@@ -154,7 +154,7 @@ class OAuthHandler {
|
|
|
154
154
|
arguments: request.arguments || {}
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
|
-
const response = await fetch(url
|
|
157
|
+
const response = await fetch(url, {
|
|
158
158
|
method: "POST",
|
|
159
159
|
headers,
|
|
160
160
|
body: JSON.stringify(jsonRpcRequest)
|
|
@@ -1326,8 +1326,6 @@ class MCPClient {
|
|
|
1326
1326
|
onReauthRequired;
|
|
1327
1327
|
maxReauthRetries;
|
|
1328
1328
|
authState = new Map;
|
|
1329
|
-
connectionMode;
|
|
1330
|
-
connecting = null;
|
|
1331
1329
|
oauthManager;
|
|
1332
1330
|
eventEmitter = new SimpleEventEmitter;
|
|
1333
1331
|
apiRouteBase;
|
|
@@ -1361,7 +1359,6 @@ class MCPClient {
|
|
|
1361
1359
|
};
|
|
1362
1360
|
this.onReauthRequired = config.onReauthRequired;
|
|
1363
1361
|
this.maxReauthRetries = config.maxReauthRetries ?? 1;
|
|
1364
|
-
this.connectionMode = config.connectionMode ?? "lazy";
|
|
1365
1362
|
this.oauthManager = new OAuthManager(oauthApiBase, config.oauthFlow);
|
|
1366
1363
|
const providers = this.plugins.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1367
1364
|
this.oauthManager.loadAllProviderTokens(providers);
|
|
@@ -1387,28 +1384,10 @@ class MCPClient {
|
|
|
1387
1384
|
const normalizedPath = oauthApiBase.replace(/\/$/, "");
|
|
1388
1385
|
return `${origin}${normalizedPath}/callback`;
|
|
1389
1386
|
}
|
|
1390
|
-
async ensureConnected() {
|
|
1391
|
-
if (this.initialized && this.transport.isConnected()) {
|
|
1392
|
-
return;
|
|
1393
|
-
}
|
|
1394
|
-
if (this.connecting) {
|
|
1395
|
-
return this.connecting;
|
|
1396
|
-
}
|
|
1397
|
-
if (this.connectionMode === "manual" && !this.initialized) {
|
|
1398
|
-
throw new Error("Client not connected. Call connect() first when using manual connection mode.");
|
|
1399
|
-
}
|
|
1400
|
-
this.connecting = this.connect();
|
|
1401
|
-
try {
|
|
1402
|
-
await this.connecting;
|
|
1403
|
-
} finally {
|
|
1404
|
-
this.connecting = null;
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
1387
|
createPluginProxy(pluginId) {
|
|
1408
1388
|
return new Proxy({}, {
|
|
1409
1389
|
get: (_target, methodName) => {
|
|
1410
1390
|
return async (args) => {
|
|
1411
|
-
await this.ensureConnected();
|
|
1412
1391
|
const toolName = methodToToolName(methodName, pluginId);
|
|
1413
1392
|
return await this.callToolWithRetry(toolName, args, 0);
|
|
1414
1393
|
};
|
|
@@ -1419,7 +1398,6 @@ class MCPClient {
|
|
|
1419
1398
|
return new Proxy({}, {
|
|
1420
1399
|
get: (_target, methodName) => {
|
|
1421
1400
|
return async (args) => {
|
|
1422
|
-
await this.ensureConnected();
|
|
1423
1401
|
const toolName = methodToToolName(methodName, "");
|
|
1424
1402
|
const finalToolName = toolName.startsWith("_") ? toolName.substring(1) : toolName;
|
|
1425
1403
|
return await this.callServerToolInternal(finalToolName, args);
|
|
@@ -1428,12 +1406,6 @@ class MCPClient {
|
|
|
1428
1406
|
});
|
|
1429
1407
|
}
|
|
1430
1408
|
async callServerToolInternal(name, args) {
|
|
1431
|
-
if (!this.initialized) {
|
|
1432
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1433
|
-
}
|
|
1434
|
-
if (!this.availableTools.has(name)) {
|
|
1435
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1436
|
-
}
|
|
1437
1409
|
try {
|
|
1438
1410
|
const response = await this.callToolThroughHandler(name, args);
|
|
1439
1411
|
return response;
|
|
@@ -1488,12 +1460,6 @@ class MCPClient {
|
|
|
1488
1460
|
return await this.callToolWithRetry(name, args, 0);
|
|
1489
1461
|
}
|
|
1490
1462
|
async callServerTool(name, args) {
|
|
1491
|
-
if (!this.initialized) {
|
|
1492
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1493
|
-
}
|
|
1494
|
-
if (!this.availableTools.has(name)) {
|
|
1495
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1496
|
-
}
|
|
1497
1463
|
try {
|
|
1498
1464
|
const response = await this.callToolThroughHandler(name, args);
|
|
1499
1465
|
return response;
|
|
@@ -1547,15 +1513,9 @@ class MCPClient {
|
|
|
1547
1513
|
return result;
|
|
1548
1514
|
}
|
|
1549
1515
|
async callToolWithRetry(name, args, retryCount = 0) {
|
|
1550
|
-
if (!this.initialized) {
|
|
1551
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1552
|
-
}
|
|
1553
1516
|
if (!this.enabledToolNames.has(name)) {
|
|
1554
1517
|
throw new Error(`Tool "${name}" is not enabled. Enable it by adding the appropriate plugin.`);
|
|
1555
1518
|
}
|
|
1556
|
-
if (!this.availableTools.has(name)) {
|
|
1557
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1558
|
-
}
|
|
1559
1519
|
const provider = this.getProviderForTool(name);
|
|
1560
1520
|
try {
|
|
1561
1521
|
const response = await this.callToolThroughHandler(name, args, provider);
|
|
@@ -138,7 +138,7 @@ class OAuthHandler {
|
|
|
138
138
|
return data;
|
|
139
139
|
}
|
|
140
140
|
async handleToolCall(request, authHeader) {
|
|
141
|
-
const url =
|
|
141
|
+
const url = this.serverUrl;
|
|
142
142
|
const headers = this.getHeaders({
|
|
143
143
|
"Content-Type": "application/json"
|
|
144
144
|
});
|
|
@@ -154,7 +154,7 @@ class OAuthHandler {
|
|
|
154
154
|
arguments: request.arguments || {}
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
|
-
const response = await fetch(url
|
|
157
|
+
const response = await fetch(url, {
|
|
158
158
|
method: "POST",
|
|
159
159
|
headers,
|
|
160
160
|
body: JSON.stringify(jsonRpcRequest)
|
|
@@ -1326,8 +1326,6 @@ class MCPClient {
|
|
|
1326
1326
|
onReauthRequired;
|
|
1327
1327
|
maxReauthRetries;
|
|
1328
1328
|
authState = new Map;
|
|
1329
|
-
connectionMode;
|
|
1330
|
-
connecting = null;
|
|
1331
1329
|
oauthManager;
|
|
1332
1330
|
eventEmitter = new SimpleEventEmitter;
|
|
1333
1331
|
apiRouteBase;
|
|
@@ -1361,7 +1359,6 @@ class MCPClient {
|
|
|
1361
1359
|
};
|
|
1362
1360
|
this.onReauthRequired = config.onReauthRequired;
|
|
1363
1361
|
this.maxReauthRetries = config.maxReauthRetries ?? 1;
|
|
1364
|
-
this.connectionMode = config.connectionMode ?? "lazy";
|
|
1365
1362
|
this.oauthManager = new OAuthManager(oauthApiBase, config.oauthFlow);
|
|
1366
1363
|
const providers = this.plugins.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1367
1364
|
this.oauthManager.loadAllProviderTokens(providers);
|
|
@@ -1387,28 +1384,10 @@ class MCPClient {
|
|
|
1387
1384
|
const normalizedPath = oauthApiBase.replace(/\/$/, "");
|
|
1388
1385
|
return `${origin}${normalizedPath}/callback`;
|
|
1389
1386
|
}
|
|
1390
|
-
async ensureConnected() {
|
|
1391
|
-
if (this.initialized && this.transport.isConnected()) {
|
|
1392
|
-
return;
|
|
1393
|
-
}
|
|
1394
|
-
if (this.connecting) {
|
|
1395
|
-
return this.connecting;
|
|
1396
|
-
}
|
|
1397
|
-
if (this.connectionMode === "manual" && !this.initialized) {
|
|
1398
|
-
throw new Error("Client not connected. Call connect() first when using manual connection mode.");
|
|
1399
|
-
}
|
|
1400
|
-
this.connecting = this.connect();
|
|
1401
|
-
try {
|
|
1402
|
-
await this.connecting;
|
|
1403
|
-
} finally {
|
|
1404
|
-
this.connecting = null;
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
1387
|
createPluginProxy(pluginId) {
|
|
1408
1388
|
return new Proxy({}, {
|
|
1409
1389
|
get: (_target, methodName) => {
|
|
1410
1390
|
return async (args) => {
|
|
1411
|
-
await this.ensureConnected();
|
|
1412
1391
|
const toolName = methodToToolName(methodName, pluginId);
|
|
1413
1392
|
return await this.callToolWithRetry(toolName, args, 0);
|
|
1414
1393
|
};
|
|
@@ -1419,7 +1398,6 @@ class MCPClient {
|
|
|
1419
1398
|
return new Proxy({}, {
|
|
1420
1399
|
get: (_target, methodName) => {
|
|
1421
1400
|
return async (args) => {
|
|
1422
|
-
await this.ensureConnected();
|
|
1423
1401
|
const toolName = methodToToolName(methodName, "");
|
|
1424
1402
|
const finalToolName = toolName.startsWith("_") ? toolName.substring(1) : toolName;
|
|
1425
1403
|
return await this.callServerToolInternal(finalToolName, args);
|
|
@@ -1428,12 +1406,6 @@ class MCPClient {
|
|
|
1428
1406
|
});
|
|
1429
1407
|
}
|
|
1430
1408
|
async callServerToolInternal(name, args) {
|
|
1431
|
-
if (!this.initialized) {
|
|
1432
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1433
|
-
}
|
|
1434
|
-
if (!this.availableTools.has(name)) {
|
|
1435
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1436
|
-
}
|
|
1437
1409
|
try {
|
|
1438
1410
|
const response = await this.callToolThroughHandler(name, args);
|
|
1439
1411
|
return response;
|
|
@@ -1488,12 +1460,6 @@ class MCPClient {
|
|
|
1488
1460
|
return await this.callToolWithRetry(name, args, 0);
|
|
1489
1461
|
}
|
|
1490
1462
|
async callServerTool(name, args) {
|
|
1491
|
-
if (!this.initialized) {
|
|
1492
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1493
|
-
}
|
|
1494
|
-
if (!this.availableTools.has(name)) {
|
|
1495
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1496
|
-
}
|
|
1497
1463
|
try {
|
|
1498
1464
|
const response = await this.callToolThroughHandler(name, args);
|
|
1499
1465
|
return response;
|
|
@@ -1547,15 +1513,9 @@ class MCPClient {
|
|
|
1547
1513
|
return result;
|
|
1548
1514
|
}
|
|
1549
1515
|
async callToolWithRetry(name, args, retryCount = 0) {
|
|
1550
|
-
if (!this.initialized) {
|
|
1551
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1552
|
-
}
|
|
1553
1516
|
if (!this.enabledToolNames.has(name)) {
|
|
1554
1517
|
throw new Error(`Tool "${name}" is not enabled. Enable it by adding the appropriate plugin.`);
|
|
1555
1518
|
}
|
|
1556
|
-
if (!this.availableTools.has(name)) {
|
|
1557
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1558
|
-
}
|
|
1559
1519
|
const provider = this.getProviderForTool(name);
|
|
1560
1520
|
try {
|
|
1561
1521
|
const response = await this.callToolThroughHandler(name, args, provider);
|
package/dist/index.js
CHANGED
|
@@ -377,7 +377,7 @@ class OAuthHandler {
|
|
|
377
377
|
return data;
|
|
378
378
|
}
|
|
379
379
|
async handleToolCall(request, authHeader) {
|
|
380
|
-
const url =
|
|
380
|
+
const url = this.serverUrl;
|
|
381
381
|
const headers = this.getHeaders({
|
|
382
382
|
"Content-Type": "application/json"
|
|
383
383
|
});
|
|
@@ -393,7 +393,7 @@ class OAuthHandler {
|
|
|
393
393
|
arguments: request.arguments || {}
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
|
-
const response = await fetch(url
|
|
396
|
+
const response = await fetch(url, {
|
|
397
397
|
method: "POST",
|
|
398
398
|
headers,
|
|
399
399
|
body: JSON.stringify(jsonRpcRequest)
|
|
@@ -1180,8 +1180,6 @@ class MCPClient {
|
|
|
1180
1180
|
onReauthRequired;
|
|
1181
1181
|
maxReauthRetries;
|
|
1182
1182
|
authState = new Map;
|
|
1183
|
-
connectionMode;
|
|
1184
|
-
connecting = null;
|
|
1185
1183
|
oauthManager;
|
|
1186
1184
|
eventEmitter = new SimpleEventEmitter;
|
|
1187
1185
|
apiRouteBase;
|
|
@@ -1215,7 +1213,6 @@ class MCPClient {
|
|
|
1215
1213
|
};
|
|
1216
1214
|
this.onReauthRequired = config.onReauthRequired;
|
|
1217
1215
|
this.maxReauthRetries = config.maxReauthRetries ?? 1;
|
|
1218
|
-
this.connectionMode = config.connectionMode ?? "lazy";
|
|
1219
1216
|
this.oauthManager = new OAuthManager(oauthApiBase, config.oauthFlow);
|
|
1220
1217
|
const providers = this.plugins.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1221
1218
|
this.oauthManager.loadAllProviderTokens(providers);
|
|
@@ -1241,28 +1238,10 @@ class MCPClient {
|
|
|
1241
1238
|
const normalizedPath = oauthApiBase.replace(/\/$/, "");
|
|
1242
1239
|
return `${origin}${normalizedPath}/callback`;
|
|
1243
1240
|
}
|
|
1244
|
-
async ensureConnected() {
|
|
1245
|
-
if (this.initialized && this.transport.isConnected()) {
|
|
1246
|
-
return;
|
|
1247
|
-
}
|
|
1248
|
-
if (this.connecting) {
|
|
1249
|
-
return this.connecting;
|
|
1250
|
-
}
|
|
1251
|
-
if (this.connectionMode === "manual" && !this.initialized) {
|
|
1252
|
-
throw new Error("Client not connected. Call connect() first when using manual connection mode.");
|
|
1253
|
-
}
|
|
1254
|
-
this.connecting = this.connect();
|
|
1255
|
-
try {
|
|
1256
|
-
await this.connecting;
|
|
1257
|
-
} finally {
|
|
1258
|
-
this.connecting = null;
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
1241
|
createPluginProxy(pluginId) {
|
|
1262
1242
|
return new Proxy({}, {
|
|
1263
1243
|
get: (_target, methodName) => {
|
|
1264
1244
|
return async (args) => {
|
|
1265
|
-
await this.ensureConnected();
|
|
1266
1245
|
const toolName = methodToToolName(methodName, pluginId);
|
|
1267
1246
|
return await this.callToolWithRetry(toolName, args, 0);
|
|
1268
1247
|
};
|
|
@@ -1273,7 +1252,6 @@ class MCPClient {
|
|
|
1273
1252
|
return new Proxy({}, {
|
|
1274
1253
|
get: (_target, methodName) => {
|
|
1275
1254
|
return async (args) => {
|
|
1276
|
-
await this.ensureConnected();
|
|
1277
1255
|
const toolName = methodToToolName(methodName, "");
|
|
1278
1256
|
const finalToolName = toolName.startsWith("_") ? toolName.substring(1) : toolName;
|
|
1279
1257
|
return await this.callServerToolInternal(finalToolName, args);
|
|
@@ -1282,12 +1260,6 @@ class MCPClient {
|
|
|
1282
1260
|
});
|
|
1283
1261
|
}
|
|
1284
1262
|
async callServerToolInternal(name, args) {
|
|
1285
|
-
if (!this.initialized) {
|
|
1286
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1287
|
-
}
|
|
1288
|
-
if (!this.availableTools.has(name)) {
|
|
1289
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1290
|
-
}
|
|
1291
1263
|
try {
|
|
1292
1264
|
const response = await this.callToolThroughHandler(name, args);
|
|
1293
1265
|
return response;
|
|
@@ -1342,12 +1314,6 @@ class MCPClient {
|
|
|
1342
1314
|
return await this.callToolWithRetry(name, args, 0);
|
|
1343
1315
|
}
|
|
1344
1316
|
async callServerTool(name, args) {
|
|
1345
|
-
if (!this.initialized) {
|
|
1346
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1347
|
-
}
|
|
1348
|
-
if (!this.availableTools.has(name)) {
|
|
1349
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1350
|
-
}
|
|
1351
1317
|
try {
|
|
1352
1318
|
const response = await this.callToolThroughHandler(name, args);
|
|
1353
1319
|
return response;
|
|
@@ -1401,15 +1367,9 @@ class MCPClient {
|
|
|
1401
1367
|
return result;
|
|
1402
1368
|
}
|
|
1403
1369
|
async callToolWithRetry(name, args, retryCount = 0) {
|
|
1404
|
-
if (!this.initialized) {
|
|
1405
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1406
|
-
}
|
|
1407
1370
|
if (!this.enabledToolNames.has(name)) {
|
|
1408
1371
|
throw new Error(`Tool "${name}" is not enabled. Enable it by adding the appropriate plugin.`);
|
|
1409
1372
|
}
|
|
1410
|
-
if (!this.availableTools.has(name)) {
|
|
1411
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1412
|
-
}
|
|
1413
1373
|
const provider = this.getProviderForTool(name);
|
|
1414
1374
|
try {
|
|
1415
1375
|
const response = await this.callToolThroughHandler(name, args, provider);
|
|
@@ -2322,7 +2282,11 @@ function createMCPServer(config) {
|
|
|
2322
2282
|
if (segments.length === 2 && segments[0] === "oauth") {
|
|
2323
2283
|
action = segments[1];
|
|
2324
2284
|
} else if (segments.length === 1) {
|
|
2325
|
-
|
|
2285
|
+
if (segments[0] === "mcp") {
|
|
2286
|
+
action = "mcp";
|
|
2287
|
+
} else {
|
|
2288
|
+
action = segments[0];
|
|
2289
|
+
}
|
|
2326
2290
|
} else if (segments.length > 0) {
|
|
2327
2291
|
action = segments[segments.length - 1];
|
|
2328
2292
|
}
|
|
@@ -2339,26 +2303,29 @@ function createMCPServer(config) {
|
|
|
2339
2303
|
action = "callback";
|
|
2340
2304
|
}
|
|
2341
2305
|
}
|
|
2306
|
+
if (action === "mcp" && method === "POST") {
|
|
2307
|
+
try {
|
|
2308
|
+
const body = await request.json();
|
|
2309
|
+
const authHeader = request.headers.get("authorization");
|
|
2310
|
+
const { OAuthHandler: OAuthHandler2 } = await Promise.resolve().then(() => exports_base_handler);
|
|
2311
|
+
const oauthHandler = new OAuthHandler2({
|
|
2312
|
+
providers,
|
|
2313
|
+
serverUrl: config.serverUrl,
|
|
2314
|
+
apiKey: config.apiKey
|
|
2315
|
+
});
|
|
2316
|
+
const result = await oauthHandler.handleToolCall(body, authHeader);
|
|
2317
|
+
return Response.json(result);
|
|
2318
|
+
} catch (error) {
|
|
2319
|
+
console.error("[MCP Tool Call] Error:", error);
|
|
2320
|
+
return Response.json({ error: error.message || "Failed to execute tool call" }, { status: error.statusCode || 500 });
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2342
2323
|
if (segments.length > 0) {
|
|
2343
2324
|
if (segments.length === 2 && segments[0] !== "oauth") {
|
|
2344
2325
|
return Response.json({ error: `Invalid route: /${segments.join("/")}` }, { status: 404 });
|
|
2345
2326
|
}
|
|
2346
|
-
if (segments.length === 1 && segments[0] === "mcp"
|
|
2347
|
-
|
|
2348
|
-
const body = await request.json();
|
|
2349
|
-
const authHeader = request.headers.get("authorization");
|
|
2350
|
-
const { OAuthHandler: OAuthHandler2 } = await Promise.resolve().then(() => exports_base_handler);
|
|
2351
|
-
const oauthHandler = new OAuthHandler2({
|
|
2352
|
-
providers,
|
|
2353
|
-
serverUrl: config.serverUrl,
|
|
2354
|
-
apiKey: config.apiKey
|
|
2355
|
-
});
|
|
2356
|
-
const result = await oauthHandler.handleToolCall(body, authHeader);
|
|
2357
|
-
return Response.json(result);
|
|
2358
|
-
} catch (error) {
|
|
2359
|
-
console.error("[MCP Tool Call] Error:", error);
|
|
2360
|
-
return Response.json({ error: error.message || "Failed to execute tool call" }, { status: error.statusCode || 500 });
|
|
2361
|
-
}
|
|
2327
|
+
if (segments.length === 1 && segments[0] === "mcp") {
|
|
2328
|
+
return Response.json({ error: `Method ${method} not allowed for /mcp route. Use POST.` }, { status: 405 });
|
|
2362
2329
|
}
|
|
2363
2330
|
}
|
|
2364
2331
|
if (method === "GET" && action === "callback") {
|
package/dist/oauth.js
CHANGED
|
@@ -143,7 +143,7 @@ class OAuthHandler {
|
|
|
143
143
|
return data;
|
|
144
144
|
}
|
|
145
145
|
async handleToolCall(request, authHeader) {
|
|
146
|
-
const url =
|
|
146
|
+
const url = this.serverUrl;
|
|
147
147
|
const headers = this.getHeaders({
|
|
148
148
|
"Content-Type": "application/json"
|
|
149
149
|
});
|
|
@@ -159,7 +159,7 @@ class OAuthHandler {
|
|
|
159
159
|
arguments: request.arguments || {}
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
const response = await fetch(url
|
|
162
|
+
const response = await fetch(url, {
|
|
163
163
|
method: "POST",
|
|
164
164
|
headers,
|
|
165
165
|
body: JSON.stringify(jsonRpcRequest)
|
package/dist/server.js
CHANGED
|
@@ -377,7 +377,7 @@ class OAuthHandler {
|
|
|
377
377
|
return data;
|
|
378
378
|
}
|
|
379
379
|
async handleToolCall(request, authHeader) {
|
|
380
|
-
const url =
|
|
380
|
+
const url = this.serverUrl;
|
|
381
381
|
const headers = this.getHeaders({
|
|
382
382
|
"Content-Type": "application/json"
|
|
383
383
|
});
|
|
@@ -393,7 +393,7 @@ class OAuthHandler {
|
|
|
393
393
|
arguments: request.arguments || {}
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
|
-
const response = await fetch(url
|
|
396
|
+
const response = await fetch(url, {
|
|
397
397
|
method: "POST",
|
|
398
398
|
headers,
|
|
399
399
|
body: JSON.stringify(jsonRpcRequest)
|
|
@@ -1180,8 +1180,6 @@ class MCPClient {
|
|
|
1180
1180
|
onReauthRequired;
|
|
1181
1181
|
maxReauthRetries;
|
|
1182
1182
|
authState = new Map;
|
|
1183
|
-
connectionMode;
|
|
1184
|
-
connecting = null;
|
|
1185
1183
|
oauthManager;
|
|
1186
1184
|
eventEmitter = new SimpleEventEmitter;
|
|
1187
1185
|
apiRouteBase;
|
|
@@ -1215,7 +1213,6 @@ class MCPClient {
|
|
|
1215
1213
|
};
|
|
1216
1214
|
this.onReauthRequired = config.onReauthRequired;
|
|
1217
1215
|
this.maxReauthRetries = config.maxReauthRetries ?? 1;
|
|
1218
|
-
this.connectionMode = config.connectionMode ?? "lazy";
|
|
1219
1216
|
this.oauthManager = new OAuthManager(oauthApiBase, config.oauthFlow);
|
|
1220
1217
|
const providers = this.plugins.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1221
1218
|
this.oauthManager.loadAllProviderTokens(providers);
|
|
@@ -1241,28 +1238,10 @@ class MCPClient {
|
|
|
1241
1238
|
const normalizedPath = oauthApiBase.replace(/\/$/, "");
|
|
1242
1239
|
return `${origin}${normalizedPath}/callback`;
|
|
1243
1240
|
}
|
|
1244
|
-
async ensureConnected() {
|
|
1245
|
-
if (this.initialized && this.transport.isConnected()) {
|
|
1246
|
-
return;
|
|
1247
|
-
}
|
|
1248
|
-
if (this.connecting) {
|
|
1249
|
-
return this.connecting;
|
|
1250
|
-
}
|
|
1251
|
-
if (this.connectionMode === "manual" && !this.initialized) {
|
|
1252
|
-
throw new Error("Client not connected. Call connect() first when using manual connection mode.");
|
|
1253
|
-
}
|
|
1254
|
-
this.connecting = this.connect();
|
|
1255
|
-
try {
|
|
1256
|
-
await this.connecting;
|
|
1257
|
-
} finally {
|
|
1258
|
-
this.connecting = null;
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
1241
|
createPluginProxy(pluginId) {
|
|
1262
1242
|
return new Proxy({}, {
|
|
1263
1243
|
get: (_target, methodName) => {
|
|
1264
1244
|
return async (args) => {
|
|
1265
|
-
await this.ensureConnected();
|
|
1266
1245
|
const toolName = methodToToolName(methodName, pluginId);
|
|
1267
1246
|
return await this.callToolWithRetry(toolName, args, 0);
|
|
1268
1247
|
};
|
|
@@ -1273,7 +1252,6 @@ class MCPClient {
|
|
|
1273
1252
|
return new Proxy({}, {
|
|
1274
1253
|
get: (_target, methodName) => {
|
|
1275
1254
|
return async (args) => {
|
|
1276
|
-
await this.ensureConnected();
|
|
1277
1255
|
const toolName = methodToToolName(methodName, "");
|
|
1278
1256
|
const finalToolName = toolName.startsWith("_") ? toolName.substring(1) : toolName;
|
|
1279
1257
|
return await this.callServerToolInternal(finalToolName, args);
|
|
@@ -1282,12 +1260,6 @@ class MCPClient {
|
|
|
1282
1260
|
});
|
|
1283
1261
|
}
|
|
1284
1262
|
async callServerToolInternal(name, args) {
|
|
1285
|
-
if (!this.initialized) {
|
|
1286
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1287
|
-
}
|
|
1288
|
-
if (!this.availableTools.has(name)) {
|
|
1289
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1290
|
-
}
|
|
1291
1263
|
try {
|
|
1292
1264
|
const response = await this.callToolThroughHandler(name, args);
|
|
1293
1265
|
return response;
|
|
@@ -1342,12 +1314,6 @@ class MCPClient {
|
|
|
1342
1314
|
return await this.callToolWithRetry(name, args, 0);
|
|
1343
1315
|
}
|
|
1344
1316
|
async callServerTool(name, args) {
|
|
1345
|
-
if (!this.initialized) {
|
|
1346
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1347
|
-
}
|
|
1348
|
-
if (!this.availableTools.has(name)) {
|
|
1349
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1350
|
-
}
|
|
1351
1317
|
try {
|
|
1352
1318
|
const response = await this.callToolThroughHandler(name, args);
|
|
1353
1319
|
return response;
|
|
@@ -1401,15 +1367,9 @@ class MCPClient {
|
|
|
1401
1367
|
return result;
|
|
1402
1368
|
}
|
|
1403
1369
|
async callToolWithRetry(name, args, retryCount = 0) {
|
|
1404
|
-
if (!this.initialized) {
|
|
1405
|
-
throw new Error("Client not initialized. Call connect() first.");
|
|
1406
|
-
}
|
|
1407
1370
|
if (!this.enabledToolNames.has(name)) {
|
|
1408
1371
|
throw new Error(`Tool "${name}" is not enabled. Enable it by adding the appropriate plugin.`);
|
|
1409
1372
|
}
|
|
1410
|
-
if (!this.availableTools.has(name)) {
|
|
1411
|
-
throw new Error(`Tool "${name}" is not available on the server. Available tools: ${Array.from(this.availableTools.keys()).join(", ")}`);
|
|
1412
|
-
}
|
|
1413
1373
|
const provider = this.getProviderForTool(name);
|
|
1414
1374
|
try {
|
|
1415
1375
|
const response = await this.callToolThroughHandler(name, args, provider);
|
|
@@ -2148,7 +2108,11 @@ function createMCPServer(config) {
|
|
|
2148
2108
|
if (segments.length === 2 && segments[0] === "oauth") {
|
|
2149
2109
|
action = segments[1];
|
|
2150
2110
|
} else if (segments.length === 1) {
|
|
2151
|
-
|
|
2111
|
+
if (segments[0] === "mcp") {
|
|
2112
|
+
action = "mcp";
|
|
2113
|
+
} else {
|
|
2114
|
+
action = segments[0];
|
|
2115
|
+
}
|
|
2152
2116
|
} else if (segments.length > 0) {
|
|
2153
2117
|
action = segments[segments.length - 1];
|
|
2154
2118
|
}
|
|
@@ -2165,26 +2129,29 @@ function createMCPServer(config) {
|
|
|
2165
2129
|
action = "callback";
|
|
2166
2130
|
}
|
|
2167
2131
|
}
|
|
2132
|
+
if (action === "mcp" && method === "POST") {
|
|
2133
|
+
try {
|
|
2134
|
+
const body = await request.json();
|
|
2135
|
+
const authHeader = request.headers.get("authorization");
|
|
2136
|
+
const { OAuthHandler: OAuthHandler2 } = await Promise.resolve().then(() => exports_base_handler);
|
|
2137
|
+
const oauthHandler = new OAuthHandler2({
|
|
2138
|
+
providers,
|
|
2139
|
+
serverUrl: config.serverUrl,
|
|
2140
|
+
apiKey: config.apiKey
|
|
2141
|
+
});
|
|
2142
|
+
const result = await oauthHandler.handleToolCall(body, authHeader);
|
|
2143
|
+
return Response.json(result);
|
|
2144
|
+
} catch (error) {
|
|
2145
|
+
console.error("[MCP Tool Call] Error:", error);
|
|
2146
|
+
return Response.json({ error: error.message || "Failed to execute tool call" }, { status: error.statusCode || 500 });
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2168
2149
|
if (segments.length > 0) {
|
|
2169
2150
|
if (segments.length === 2 && segments[0] !== "oauth") {
|
|
2170
2151
|
return Response.json({ error: `Invalid route: /${segments.join("/")}` }, { status: 404 });
|
|
2171
2152
|
}
|
|
2172
|
-
if (segments.length === 1 && segments[0] === "mcp"
|
|
2173
|
-
|
|
2174
|
-
const body = await request.json();
|
|
2175
|
-
const authHeader = request.headers.get("authorization");
|
|
2176
|
-
const { OAuthHandler: OAuthHandler2 } = await Promise.resolve().then(() => exports_base_handler);
|
|
2177
|
-
const oauthHandler = new OAuthHandler2({
|
|
2178
|
-
providers,
|
|
2179
|
-
serverUrl: config.serverUrl,
|
|
2180
|
-
apiKey: config.apiKey
|
|
2181
|
-
});
|
|
2182
|
-
const result = await oauthHandler.handleToolCall(body, authHeader);
|
|
2183
|
-
return Response.json(result);
|
|
2184
|
-
} catch (error) {
|
|
2185
|
-
console.error("[MCP Tool Call] Error:", error);
|
|
2186
|
-
return Response.json({ error: error.message || "Failed to execute tool call" }, { status: error.statusCode || 500 });
|
|
2187
|
-
}
|
|
2153
|
+
if (segments.length === 1 && segments[0] === "mcp") {
|
|
2154
|
+
return Response.json({ error: `Method ${method} not allowed for /mcp route. Use POST.` }, { status: 405 });
|
|
2188
2155
|
}
|
|
2189
2156
|
}
|
|
2190
2157
|
if (method === "GET" && action === "callback") {
|
package/dist/src/client.d.ts
CHANGED
|
@@ -53,8 +53,6 @@ export declare class MCPClient<TPlugins extends readonly MCPPlugin[] = readonly
|
|
|
53
53
|
private onReauthRequired?;
|
|
54
54
|
private maxReauthRetries;
|
|
55
55
|
private authState;
|
|
56
|
-
private connectionMode;
|
|
57
|
-
private connecting;
|
|
58
56
|
private oauthManager;
|
|
59
57
|
private eventEmitter;
|
|
60
58
|
private apiRouteBase;
|
|
@@ -74,10 +72,6 @@ export declare class MCPClient<TPlugins extends readonly MCPPlugin[] = readonly
|
|
|
74
72
|
* @returns Default redirect URI
|
|
75
73
|
*/
|
|
76
74
|
private getDefaultRedirectUri;
|
|
77
|
-
/**
|
|
78
|
-
* Ensure the client is connected (for lazy connection mode)
|
|
79
|
-
*/
|
|
80
|
-
private ensureConnected;
|
|
81
75
|
/**
|
|
82
76
|
* Create a proxy for a plugin namespace that intercepts method calls
|
|
83
77
|
* and routes them to the appropriate tool
|
package/dist/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,OAAO,EAEP,mBAAmB,EAGpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjE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B,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBrE;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,kBAAkB,EAAE,iBAAiB,GAAG,SAAS;IAI5F;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,kBAAkB,EAAE,iBAAiB,GAAG,IAAI;IAKjG;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAW9C;;;OAGG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CA2BzD;AA6DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EACnE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,GAChC,SAAS,CAAC,QAAQ,CAAC,CAkErB;AA0CD;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAetD"}
|
package/dist/src/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA8CpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EACnE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","s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