integrate-sdk 0.8.47-dev.0 → 0.8.50-dev.0
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 +130 -3
- package/dist/adapters/index.js +130 -3
- package/dist/adapters/nextjs.js +130 -3
- package/dist/adapters/node.js +130 -3
- package/dist/adapters/svelte-kit.js +130 -3
- package/dist/adapters/tanstack-start.js +130 -3
- package/dist/index.js +130 -3
- package/dist/oauth.js +130 -3
- package/dist/server.js +130 -3
- package/dist/src/client.d.ts +6 -0
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/integrations/airtable.d.ts.map +1 -1
- package/dist/src/integrations/calcom.d.ts.map +1 -1
- package/dist/src/integrations/cursor.d.ts.map +1 -1
- package/dist/src/integrations/figma.d.ts.map +1 -1
- package/dist/src/integrations/gcal.d.ts.map +1 -1
- package/dist/src/integrations/generic.d.ts +4 -0
- package/dist/src/integrations/generic.d.ts.map +1 -1
- package/dist/src/integrations/github.d.ts.map +1 -1
- package/dist/src/integrations/gmail.d.ts.map +1 -1
- package/dist/src/integrations/gworkspace.d.ts.map +1 -1
- package/dist/src/integrations/hubspot.d.ts.map +1 -1
- package/dist/src/integrations/intercom.d.ts.map +1 -1
- package/dist/src/integrations/linear.d.ts.map +1 -1
- package/dist/src/integrations/notion.d.ts.map +1 -1
- package/dist/src/integrations/onedrive.d.ts.map +1 -1
- package/dist/src/integrations/outlook.d.ts.map +1 -1
- package/dist/src/integrations/polar.d.ts.map +1 -1
- package/dist/src/integrations/ramp.d.ts.map +1 -1
- package/dist/src/integrations/server-client.d.ts +22 -2
- package/dist/src/integrations/server-client.d.ts.map +1 -1
- package/dist/src/integrations/slack.d.ts.map +1 -1
- package/dist/src/integrations/stripe.d.ts.map +1 -1
- package/dist/src/integrations/todoist.d.ts.map +1 -1
- package/dist/src/integrations/types.d.ts +4 -0
- package/dist/src/integrations/types.d.ts.map +1 -1
- package/dist/src/integrations/vercel.d.ts.map +1 -1
- package/dist/src/integrations/whatsapp.d.ts.map +1 -1
- package/dist/src/integrations/youtube.d.ts.map +1 -1
- package/dist/src/integrations/zendesk.d.ts.map +1 -1
- package/dist/src/utils/concurrency.d.ts +24 -0
- package/dist/src/utils/concurrency.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1650,6 +1650,32 @@ var init_manager = __esm(() => {
|
|
|
1650
1650
|
logger4 = createLogger("OAuth");
|
|
1651
1651
|
});
|
|
1652
1652
|
|
|
1653
|
+
// src/utils/concurrency.ts
|
|
1654
|
+
var exports_concurrency = {};
|
|
1655
|
+
__export(exports_concurrency, {
|
|
1656
|
+
parallelWithLimit: () => parallelWithLimit
|
|
1657
|
+
});
|
|
1658
|
+
async function parallelWithLimit(items, fn, limit = 3) {
|
|
1659
|
+
const results = [];
|
|
1660
|
+
const executing = [];
|
|
1661
|
+
for (let i = 0;i < items.length; i++) {
|
|
1662
|
+
const item = items[i];
|
|
1663
|
+
const index = i;
|
|
1664
|
+
const promise = fn(item).then((result) => {
|
|
1665
|
+
results[index] = result;
|
|
1666
|
+
}).catch(() => {
|
|
1667
|
+
results[index] = undefined;
|
|
1668
|
+
});
|
|
1669
|
+
executing.push(promise);
|
|
1670
|
+
if (executing.length >= limit) {
|
|
1671
|
+
const completedIndex = await Promise.race(executing.map((p, idx) => p.then(() => idx).catch(() => idx)));
|
|
1672
|
+
executing.splice(completedIndex, 1);
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
await Promise.all(executing);
|
|
1676
|
+
return results;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1653
1679
|
// src/client.ts
|
|
1654
1680
|
class SimpleEventEmitter {
|
|
1655
1681
|
handlers = new Map;
|
|
@@ -1701,6 +1727,7 @@ class MCPClientBase {
|
|
|
1701
1727
|
apiRouteBase;
|
|
1702
1728
|
apiBaseUrl;
|
|
1703
1729
|
databaseDetected = false;
|
|
1730
|
+
__configuredIntegrations;
|
|
1704
1731
|
oauthCallbackPromise;
|
|
1705
1732
|
server;
|
|
1706
1733
|
trigger;
|
|
@@ -1726,6 +1753,7 @@ class MCPClientBase {
|
|
|
1726
1753
|
}
|
|
1727
1754
|
return integration;
|
|
1728
1755
|
});
|
|
1756
|
+
this.__configuredIntegrations = this.integrations;
|
|
1729
1757
|
this.clientInfo = config.clientInfo || {
|
|
1730
1758
|
name: "integrate-sdk",
|
|
1731
1759
|
version: "0.1.0"
|
|
@@ -1868,13 +1896,64 @@ class MCPClientBase {
|
|
|
1868
1896
|
return new Proxy({}, {
|
|
1869
1897
|
get: (_target, methodName) => {
|
|
1870
1898
|
if (methodName === "listConfiguredIntegrations") {
|
|
1871
|
-
return async () => {
|
|
1899
|
+
return async (options) => {
|
|
1872
1900
|
const serverConfig = this.__oauthConfig;
|
|
1873
|
-
const configuredIntegrations = serverConfig?.integrations || this.
|
|
1901
|
+
const configuredIntegrations = serverConfig?.integrations || this.__configuredIntegrations;
|
|
1902
|
+
if (options?.includeToolMetadata) {
|
|
1903
|
+
const { parallelWithLimit: parallelWithLimit2 } = await Promise.resolve().then(() => exports_concurrency);
|
|
1904
|
+
const integrationsWithMetadata = await parallelWithLimit2(configuredIntegrations, async (integration) => {
|
|
1905
|
+
try {
|
|
1906
|
+
const response = await this.callServerToolInternal("list_tools_by_integration", {
|
|
1907
|
+
integration: integration.id
|
|
1908
|
+
});
|
|
1909
|
+
let toolMetadata = [];
|
|
1910
|
+
if (response.content && Array.isArray(response.content)) {
|
|
1911
|
+
for (const item of response.content) {
|
|
1912
|
+
if (item.type === "text" && item.text) {
|
|
1913
|
+
try {
|
|
1914
|
+
const parsed = JSON.parse(item.text);
|
|
1915
|
+
if (Array.isArray(parsed)) {
|
|
1916
|
+
toolMetadata = parsed;
|
|
1917
|
+
} else if (parsed.tools && Array.isArray(parsed.tools)) {
|
|
1918
|
+
toolMetadata = parsed.tools;
|
|
1919
|
+
}
|
|
1920
|
+
} catch {}
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
return {
|
|
1925
|
+
id: integration.id,
|
|
1926
|
+
name: integration.name || integration.id,
|
|
1927
|
+
logoUrl: integration.logoUrl,
|
|
1928
|
+
tools: integration.tools,
|
|
1929
|
+
hasOAuth: !!integration.oauth,
|
|
1930
|
+
scopes: integration.oauth?.scopes,
|
|
1931
|
+
provider: integration.oauth?.provider,
|
|
1932
|
+
toolMetadata
|
|
1933
|
+
};
|
|
1934
|
+
} catch (error) {
|
|
1935
|
+
logger5.error(`Failed to fetch tool metadata for ${integration.id}:`, error);
|
|
1936
|
+
return {
|
|
1937
|
+
id: integration.id,
|
|
1938
|
+
name: integration.name || integration.id,
|
|
1939
|
+
logoUrl: integration.logoUrl,
|
|
1940
|
+
tools: integration.tools,
|
|
1941
|
+
hasOAuth: !!integration.oauth,
|
|
1942
|
+
scopes: integration.oauth?.scopes,
|
|
1943
|
+
provider: integration.oauth?.provider,
|
|
1944
|
+
toolMetadata: []
|
|
1945
|
+
};
|
|
1946
|
+
}
|
|
1947
|
+
}, 3);
|
|
1948
|
+
return {
|
|
1949
|
+
integrations: integrationsWithMetadata
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1874
1952
|
return {
|
|
1875
1953
|
integrations: configuredIntegrations.map((integration) => ({
|
|
1876
1954
|
id: integration.id,
|
|
1877
1955
|
name: integration.name || integration.id,
|
|
1956
|
+
logoUrl: integration.logoUrl,
|
|
1878
1957
|
tools: integration.tools,
|
|
1879
1958
|
hasOAuth: !!integration.oauth,
|
|
1880
1959
|
scopes: integration.oauth?.scopes,
|
|
@@ -2783,6 +2862,8 @@ function githubIntegration(config = {}) {
|
|
|
2783
2862
|
};
|
|
2784
2863
|
return {
|
|
2785
2864
|
id: "github",
|
|
2865
|
+
name: "GitHub",
|
|
2866
|
+
logoUrl: "https://cdn.simpleicons.org/github",
|
|
2786
2867
|
tools: [...GITHUB_TOOLS],
|
|
2787
2868
|
oauth,
|
|
2788
2869
|
async onInit(_client) {
|
|
@@ -2836,6 +2917,8 @@ function gmailIntegration(config = {}) {
|
|
|
2836
2917
|
};
|
|
2837
2918
|
return {
|
|
2838
2919
|
id: "gmail",
|
|
2920
|
+
name: "Gmail",
|
|
2921
|
+
logoUrl: "https://cdn.simpleicons.org/gmail",
|
|
2839
2922
|
tools: [...GMAIL_TOOLS],
|
|
2840
2923
|
oauth,
|
|
2841
2924
|
async onInit(_client) {
|
|
@@ -2875,6 +2958,8 @@ function notionIntegration(config = {}) {
|
|
|
2875
2958
|
};
|
|
2876
2959
|
return {
|
|
2877
2960
|
id: "notion",
|
|
2961
|
+
name: "Notion",
|
|
2962
|
+
logoUrl: "https://cdn.simpleicons.org/notion",
|
|
2878
2963
|
tools: [...NOTION_TOOLS],
|
|
2879
2964
|
oauth,
|
|
2880
2965
|
async onInit(_client) {
|
|
@@ -2909,6 +2994,8 @@ function slackIntegration(config = {}) {
|
|
|
2909
2994
|
};
|
|
2910
2995
|
return {
|
|
2911
2996
|
id: "slack",
|
|
2997
|
+
name: "Slack",
|
|
2998
|
+
logoUrl: "https://cdn.simpleicons.org/slack",
|
|
2912
2999
|
tools: [...SLACK_TOOLS],
|
|
2913
3000
|
oauth,
|
|
2914
3001
|
async onInit(_client) {
|
|
@@ -2950,6 +3037,8 @@ function linearIntegration(config = {}) {
|
|
|
2950
3037
|
};
|
|
2951
3038
|
return {
|
|
2952
3039
|
id: "linear",
|
|
3040
|
+
name: "Linear",
|
|
3041
|
+
logoUrl: "https://cdn.simpleicons.org/linear",
|
|
2953
3042
|
tools: [...LINEAR_TOOLS],
|
|
2954
3043
|
oauth,
|
|
2955
3044
|
async onInit(_client) {
|
|
@@ -2991,6 +3080,8 @@ function vercelIntegration(config = {}) {
|
|
|
2991
3080
|
};
|
|
2992
3081
|
return {
|
|
2993
3082
|
id: "vercel",
|
|
3083
|
+
name: "Vercel",
|
|
3084
|
+
logoUrl: "https://cdn.simpleicons.org/vercel",
|
|
2994
3085
|
tools: [...VERCEL_TOOLS],
|
|
2995
3086
|
oauth,
|
|
2996
3087
|
async onInit(_client) {
|
|
@@ -3033,6 +3124,8 @@ function zendeskIntegration(config = {}) {
|
|
|
3033
3124
|
};
|
|
3034
3125
|
return {
|
|
3035
3126
|
id: "zendesk",
|
|
3127
|
+
name: "Zendesk",
|
|
3128
|
+
logoUrl: "https://cdn.simpleicons.org/zendesk",
|
|
3036
3129
|
tools: [...ZENDESK_TOOLS],
|
|
3037
3130
|
oauth,
|
|
3038
3131
|
async onInit(_client) {
|
|
@@ -3074,6 +3167,8 @@ function stripeIntegration(config = {}) {
|
|
|
3074
3167
|
};
|
|
3075
3168
|
return {
|
|
3076
3169
|
id: "stripe",
|
|
3170
|
+
name: "Stripe",
|
|
3171
|
+
logoUrl: "https://cdn.simpleicons.org/stripe",
|
|
3077
3172
|
tools: [...STRIPE_TOOLS],
|
|
3078
3173
|
oauth,
|
|
3079
3174
|
async onInit(_client) {
|
|
@@ -3115,6 +3210,8 @@ function gcalIntegration(config = {}) {
|
|
|
3115
3210
|
};
|
|
3116
3211
|
return {
|
|
3117
3212
|
id: "gcal",
|
|
3213
|
+
name: "Google Calendar",
|
|
3214
|
+
logoUrl: "https://cdn.simpleicons.org/googlecalendar",
|
|
3118
3215
|
tools: [...GCAL_TOOLS],
|
|
3119
3216
|
oauth,
|
|
3120
3217
|
async onInit(_client) {
|
|
@@ -3156,6 +3253,8 @@ function outlookIntegration(config = {}) {
|
|
|
3156
3253
|
};
|
|
3157
3254
|
return {
|
|
3158
3255
|
id: "outlook",
|
|
3256
|
+
name: "Outlook",
|
|
3257
|
+
logoUrl: "https://cdn.simpleicons.org/microsoftoutlook",
|
|
3159
3258
|
tools: [...OUTLOOK_TOOLS],
|
|
3160
3259
|
oauth,
|
|
3161
3260
|
async onInit(_client) {
|
|
@@ -3197,6 +3296,8 @@ function airtableIntegration(config = {}) {
|
|
|
3197
3296
|
};
|
|
3198
3297
|
return {
|
|
3199
3298
|
id: "airtable",
|
|
3299
|
+
name: "Airtable",
|
|
3300
|
+
logoUrl: "https://cdn.simpleicons.org/airtable",
|
|
3200
3301
|
tools: [...AIRTABLE_TOOLS],
|
|
3201
3302
|
oauth,
|
|
3202
3303
|
async onInit(_client) {
|
|
@@ -3238,6 +3339,8 @@ function todoistIntegration(config = {}) {
|
|
|
3238
3339
|
};
|
|
3239
3340
|
return {
|
|
3240
3341
|
id: "todoist",
|
|
3342
|
+
name: "Todoist",
|
|
3343
|
+
logoUrl: "https://cdn.simpleicons.org/todoist",
|
|
3241
3344
|
tools: [...TODOIST_TOOLS],
|
|
3242
3345
|
oauth,
|
|
3243
3346
|
async onInit(_client) {
|
|
@@ -3280,6 +3383,8 @@ function whatsappIntegration(config = {}) {
|
|
|
3280
3383
|
};
|
|
3281
3384
|
return {
|
|
3282
3385
|
id: "whatsapp",
|
|
3386
|
+
name: "WhatsApp Business",
|
|
3387
|
+
logoUrl: "https://cdn.simpleicons.org/whatsapp",
|
|
3283
3388
|
tools: [...WHATSAPP_TOOLS],
|
|
3284
3389
|
oauth,
|
|
3285
3390
|
async onInit(_client) {
|
|
@@ -3321,6 +3426,8 @@ function calcomIntegration(config = {}) {
|
|
|
3321
3426
|
};
|
|
3322
3427
|
return {
|
|
3323
3428
|
id: "calcom",
|
|
3429
|
+
name: "Cal.com",
|
|
3430
|
+
logoUrl: "https://cdn.simpleicons.org/calendly",
|
|
3324
3431
|
tools: [...CALCOM_TOOLS],
|
|
3325
3432
|
oauth,
|
|
3326
3433
|
async onInit(_client) {
|
|
@@ -3363,6 +3470,8 @@ function rampIntegration(config = {}) {
|
|
|
3363
3470
|
};
|
|
3364
3471
|
return {
|
|
3365
3472
|
id: "ramp",
|
|
3473
|
+
name: "Ramp",
|
|
3474
|
+
logoUrl: "https://cdn.simpleicons.org/ramp",
|
|
3366
3475
|
tools: [...RAMP_TOOLS],
|
|
3367
3476
|
oauth,
|
|
3368
3477
|
async onInit(_client) {
|
|
@@ -3404,6 +3513,8 @@ function onedriveIntegration(config = {}) {
|
|
|
3404
3513
|
};
|
|
3405
3514
|
return {
|
|
3406
3515
|
id: "onedrive",
|
|
3516
|
+
name: "OneDrive",
|
|
3517
|
+
logoUrl: "https://cdn.simpleicons.org/onedrive",
|
|
3407
3518
|
tools: [...ONEDRIVE_TOOLS],
|
|
3408
3519
|
oauth,
|
|
3409
3520
|
async onInit(_client) {
|
|
@@ -3453,6 +3564,8 @@ function gworkspaceIntegration(config = {}) {
|
|
|
3453
3564
|
};
|
|
3454
3565
|
return {
|
|
3455
3566
|
id: "gworkspace",
|
|
3567
|
+
name: "Google Workspace",
|
|
3568
|
+
logoUrl: "https://cdn.simpleicons.org/google",
|
|
3456
3569
|
tools: [...GWORKSPACE_TOOLS],
|
|
3457
3570
|
oauth,
|
|
3458
3571
|
async onInit(_client) {
|
|
@@ -3498,6 +3611,8 @@ function polarIntegration(config = {}) {
|
|
|
3498
3611
|
};
|
|
3499
3612
|
return {
|
|
3500
3613
|
id: "polar",
|
|
3614
|
+
name: "Polar",
|
|
3615
|
+
logoUrl: "https://cdn.simpleicons.org/polar",
|
|
3501
3616
|
tools: [...POLAR_TOOLS],
|
|
3502
3617
|
oauth,
|
|
3503
3618
|
async onInit(_client) {
|
|
@@ -3539,6 +3654,8 @@ function figmaIntegration(config = {}) {
|
|
|
3539
3654
|
};
|
|
3540
3655
|
return {
|
|
3541
3656
|
id: "figma",
|
|
3657
|
+
name: "Figma",
|
|
3658
|
+
logoUrl: "https://cdn.simpleicons.org/figma",
|
|
3542
3659
|
tools: [...FIGMA_TOOLS],
|
|
3543
3660
|
oauth,
|
|
3544
3661
|
async onInit(_client) {
|
|
@@ -3580,6 +3697,8 @@ function intercomIntegration(config = {}) {
|
|
|
3580
3697
|
};
|
|
3581
3698
|
return {
|
|
3582
3699
|
id: "intercom",
|
|
3700
|
+
name: "Intercom",
|
|
3701
|
+
logoUrl: "https://cdn.simpleicons.org/intercom",
|
|
3583
3702
|
tools: [...INTERCOM_TOOLS],
|
|
3584
3703
|
oauth,
|
|
3585
3704
|
async onInit(_client) {
|
|
@@ -3629,6 +3748,8 @@ function hubspotIntegration(config = {}) {
|
|
|
3629
3748
|
};
|
|
3630
3749
|
return {
|
|
3631
3750
|
id: "hubspot",
|
|
3751
|
+
name: "HubSpot",
|
|
3752
|
+
logoUrl: "https://cdn.simpleicons.org/hubspot",
|
|
3632
3753
|
tools: [...HUBSPOT_TOOLS],
|
|
3633
3754
|
oauth,
|
|
3634
3755
|
async onInit(_client) {
|
|
@@ -3673,6 +3794,8 @@ function youtubeIntegration(config = {}) {
|
|
|
3673
3794
|
};
|
|
3674
3795
|
return {
|
|
3675
3796
|
id: "youtube",
|
|
3797
|
+
name: "YouTube",
|
|
3798
|
+
logoUrl: "https://cdn.simpleicons.org/youtube",
|
|
3676
3799
|
tools: [...YOUTUBE_TOOLS],
|
|
3677
3800
|
oauth,
|
|
3678
3801
|
async onInit(_client) {
|
|
@@ -3704,6 +3827,8 @@ var init_youtube = __esm(() => {
|
|
|
3704
3827
|
function cursorIntegration(_config = {}) {
|
|
3705
3828
|
return {
|
|
3706
3829
|
id: "cursor",
|
|
3830
|
+
name: "Cursor",
|
|
3831
|
+
logoUrl: "https://cdn.simpleicons.org/cursor",
|
|
3707
3832
|
tools: [...CURSOR_TOOLS],
|
|
3708
3833
|
async onInit(_client) {
|
|
3709
3834
|
logger29.debug("Cursor integration initialized");
|
|
@@ -3744,6 +3869,8 @@ function genericOAuthIntegration(config) {
|
|
|
3744
3869
|
};
|
|
3745
3870
|
return {
|
|
3746
3871
|
id: config.id,
|
|
3872
|
+
name: config.name,
|
|
3873
|
+
logoUrl: config.logoUrl,
|
|
3747
3874
|
tools: config.tools,
|
|
3748
3875
|
oauth,
|
|
3749
3876
|
onInit: config.onInit,
|
|
@@ -9552,7 +9679,6 @@ var init_zodToJsonSchema = __esm(() => {
|
|
|
9552
9679
|
|
|
9553
9680
|
// node_modules/zod-to-json-schema/dist/esm/index.js
|
|
9554
9681
|
var init_esm = __esm(() => {
|
|
9555
|
-
init_zodToJsonSchema();
|
|
9556
9682
|
init_Options();
|
|
9557
9683
|
init_Refs();
|
|
9558
9684
|
init_parseDef();
|
|
@@ -9584,6 +9710,7 @@ var init_esm = __esm(() => {
|
|
|
9584
9710
|
init_unknown();
|
|
9585
9711
|
init_selectParser();
|
|
9586
9712
|
init_zodToJsonSchema();
|
|
9713
|
+
init_zodToJsonSchema();
|
|
9587
9714
|
});
|
|
9588
9715
|
|
|
9589
9716
|
// src/ai/openai.ts
|
package/dist/oauth.js
CHANGED
|
@@ -1622,6 +1622,32 @@ var init_manager = __esm(() => {
|
|
|
1622
1622
|
logger4 = createLogger("OAuth");
|
|
1623
1623
|
});
|
|
1624
1624
|
|
|
1625
|
+
// src/utils/concurrency.ts
|
|
1626
|
+
var exports_concurrency = {};
|
|
1627
|
+
__export(exports_concurrency, {
|
|
1628
|
+
parallelWithLimit: () => parallelWithLimit
|
|
1629
|
+
});
|
|
1630
|
+
async function parallelWithLimit(items, fn, limit = 3) {
|
|
1631
|
+
const results = [];
|
|
1632
|
+
const executing = [];
|
|
1633
|
+
for (let i = 0;i < items.length; i++) {
|
|
1634
|
+
const item = items[i];
|
|
1635
|
+
const index = i;
|
|
1636
|
+
const promise = fn(item).then((result) => {
|
|
1637
|
+
results[index] = result;
|
|
1638
|
+
}).catch(() => {
|
|
1639
|
+
results[index] = undefined;
|
|
1640
|
+
});
|
|
1641
|
+
executing.push(promise);
|
|
1642
|
+
if (executing.length >= limit) {
|
|
1643
|
+
const completedIndex = await Promise.race(executing.map((p, idx) => p.then(() => idx).catch(() => idx)));
|
|
1644
|
+
executing.splice(completedIndex, 1);
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
await Promise.all(executing);
|
|
1648
|
+
return results;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1625
1651
|
// src/client.ts
|
|
1626
1652
|
class SimpleEventEmitter {
|
|
1627
1653
|
handlers = new Map;
|
|
@@ -1673,6 +1699,7 @@ class MCPClientBase {
|
|
|
1673
1699
|
apiRouteBase;
|
|
1674
1700
|
apiBaseUrl;
|
|
1675
1701
|
databaseDetected = false;
|
|
1702
|
+
__configuredIntegrations;
|
|
1676
1703
|
oauthCallbackPromise;
|
|
1677
1704
|
server;
|
|
1678
1705
|
trigger;
|
|
@@ -1698,6 +1725,7 @@ class MCPClientBase {
|
|
|
1698
1725
|
}
|
|
1699
1726
|
return integration;
|
|
1700
1727
|
});
|
|
1728
|
+
this.__configuredIntegrations = this.integrations;
|
|
1701
1729
|
this.clientInfo = config.clientInfo || {
|
|
1702
1730
|
name: "integrate-sdk",
|
|
1703
1731
|
version: "0.1.0"
|
|
@@ -1840,13 +1868,64 @@ class MCPClientBase {
|
|
|
1840
1868
|
return new Proxy({}, {
|
|
1841
1869
|
get: (_target, methodName) => {
|
|
1842
1870
|
if (methodName === "listConfiguredIntegrations") {
|
|
1843
|
-
return async () => {
|
|
1871
|
+
return async (options) => {
|
|
1844
1872
|
const serverConfig = this.__oauthConfig;
|
|
1845
|
-
const configuredIntegrations = serverConfig?.integrations || this.
|
|
1873
|
+
const configuredIntegrations = serverConfig?.integrations || this.__configuredIntegrations;
|
|
1874
|
+
if (options?.includeToolMetadata) {
|
|
1875
|
+
const { parallelWithLimit: parallelWithLimit2 } = await Promise.resolve().then(() => exports_concurrency);
|
|
1876
|
+
const integrationsWithMetadata = await parallelWithLimit2(configuredIntegrations, async (integration) => {
|
|
1877
|
+
try {
|
|
1878
|
+
const response = await this.callServerToolInternal("list_tools_by_integration", {
|
|
1879
|
+
integration: integration.id
|
|
1880
|
+
});
|
|
1881
|
+
let toolMetadata = [];
|
|
1882
|
+
if (response.content && Array.isArray(response.content)) {
|
|
1883
|
+
for (const item of response.content) {
|
|
1884
|
+
if (item.type === "text" && item.text) {
|
|
1885
|
+
try {
|
|
1886
|
+
const parsed = JSON.parse(item.text);
|
|
1887
|
+
if (Array.isArray(parsed)) {
|
|
1888
|
+
toolMetadata = parsed;
|
|
1889
|
+
} else if (parsed.tools && Array.isArray(parsed.tools)) {
|
|
1890
|
+
toolMetadata = parsed.tools;
|
|
1891
|
+
}
|
|
1892
|
+
} catch {}
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
return {
|
|
1897
|
+
id: integration.id,
|
|
1898
|
+
name: integration.name || integration.id,
|
|
1899
|
+
logoUrl: integration.logoUrl,
|
|
1900
|
+
tools: integration.tools,
|
|
1901
|
+
hasOAuth: !!integration.oauth,
|
|
1902
|
+
scopes: integration.oauth?.scopes,
|
|
1903
|
+
provider: integration.oauth?.provider,
|
|
1904
|
+
toolMetadata
|
|
1905
|
+
};
|
|
1906
|
+
} catch (error) {
|
|
1907
|
+
logger5.error(`Failed to fetch tool metadata for ${integration.id}:`, error);
|
|
1908
|
+
return {
|
|
1909
|
+
id: integration.id,
|
|
1910
|
+
name: integration.name || integration.id,
|
|
1911
|
+
logoUrl: integration.logoUrl,
|
|
1912
|
+
tools: integration.tools,
|
|
1913
|
+
hasOAuth: !!integration.oauth,
|
|
1914
|
+
scopes: integration.oauth?.scopes,
|
|
1915
|
+
provider: integration.oauth?.provider,
|
|
1916
|
+
toolMetadata: []
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
}, 3);
|
|
1920
|
+
return {
|
|
1921
|
+
integrations: integrationsWithMetadata
|
|
1922
|
+
};
|
|
1923
|
+
}
|
|
1846
1924
|
return {
|
|
1847
1925
|
integrations: configuredIntegrations.map((integration) => ({
|
|
1848
1926
|
id: integration.id,
|
|
1849
1927
|
name: integration.name || integration.id,
|
|
1928
|
+
logoUrl: integration.logoUrl,
|
|
1850
1929
|
tools: integration.tools,
|
|
1851
1930
|
hasOAuth: !!integration.oauth,
|
|
1852
1931
|
scopes: integration.oauth?.scopes,
|
|
@@ -2605,6 +2684,8 @@ function githubIntegration(config = {}) {
|
|
|
2605
2684
|
};
|
|
2606
2685
|
return {
|
|
2607
2686
|
id: "github",
|
|
2687
|
+
name: "GitHub",
|
|
2688
|
+
logoUrl: "https://cdn.simpleicons.org/github",
|
|
2608
2689
|
tools: [...GITHUB_TOOLS],
|
|
2609
2690
|
oauth,
|
|
2610
2691
|
async onInit(_client) {
|
|
@@ -2658,6 +2739,8 @@ function gmailIntegration(config = {}) {
|
|
|
2658
2739
|
};
|
|
2659
2740
|
return {
|
|
2660
2741
|
id: "gmail",
|
|
2742
|
+
name: "Gmail",
|
|
2743
|
+
logoUrl: "https://cdn.simpleicons.org/gmail",
|
|
2661
2744
|
tools: [...GMAIL_TOOLS],
|
|
2662
2745
|
oauth,
|
|
2663
2746
|
async onInit(_client) {
|
|
@@ -2697,6 +2780,8 @@ function notionIntegration(config = {}) {
|
|
|
2697
2780
|
};
|
|
2698
2781
|
return {
|
|
2699
2782
|
id: "notion",
|
|
2783
|
+
name: "Notion",
|
|
2784
|
+
logoUrl: "https://cdn.simpleicons.org/notion",
|
|
2700
2785
|
tools: [...NOTION_TOOLS],
|
|
2701
2786
|
oauth,
|
|
2702
2787
|
async onInit(_client) {
|
|
@@ -2731,6 +2816,8 @@ function slackIntegration(config = {}) {
|
|
|
2731
2816
|
};
|
|
2732
2817
|
return {
|
|
2733
2818
|
id: "slack",
|
|
2819
|
+
name: "Slack",
|
|
2820
|
+
logoUrl: "https://cdn.simpleicons.org/slack",
|
|
2734
2821
|
tools: [...SLACK_TOOLS],
|
|
2735
2822
|
oauth,
|
|
2736
2823
|
async onInit(_client) {
|
|
@@ -2772,6 +2859,8 @@ function linearIntegration(config = {}) {
|
|
|
2772
2859
|
};
|
|
2773
2860
|
return {
|
|
2774
2861
|
id: "linear",
|
|
2862
|
+
name: "Linear",
|
|
2863
|
+
logoUrl: "https://cdn.simpleicons.org/linear",
|
|
2775
2864
|
tools: [...LINEAR_TOOLS],
|
|
2776
2865
|
oauth,
|
|
2777
2866
|
async onInit(_client) {
|
|
@@ -2813,6 +2902,8 @@ function vercelIntegration(config = {}) {
|
|
|
2813
2902
|
};
|
|
2814
2903
|
return {
|
|
2815
2904
|
id: "vercel",
|
|
2905
|
+
name: "Vercel",
|
|
2906
|
+
logoUrl: "https://cdn.simpleicons.org/vercel",
|
|
2816
2907
|
tools: [...VERCEL_TOOLS],
|
|
2817
2908
|
oauth,
|
|
2818
2909
|
async onInit(_client) {
|
|
@@ -2855,6 +2946,8 @@ function zendeskIntegration(config = {}) {
|
|
|
2855
2946
|
};
|
|
2856
2947
|
return {
|
|
2857
2948
|
id: "zendesk",
|
|
2949
|
+
name: "Zendesk",
|
|
2950
|
+
logoUrl: "https://cdn.simpleicons.org/zendesk",
|
|
2858
2951
|
tools: [...ZENDESK_TOOLS],
|
|
2859
2952
|
oauth,
|
|
2860
2953
|
async onInit(_client) {
|
|
@@ -2896,6 +2989,8 @@ function stripeIntegration(config = {}) {
|
|
|
2896
2989
|
};
|
|
2897
2990
|
return {
|
|
2898
2991
|
id: "stripe",
|
|
2992
|
+
name: "Stripe",
|
|
2993
|
+
logoUrl: "https://cdn.simpleicons.org/stripe",
|
|
2899
2994
|
tools: [...STRIPE_TOOLS],
|
|
2900
2995
|
oauth,
|
|
2901
2996
|
async onInit(_client) {
|
|
@@ -2937,6 +3032,8 @@ function gcalIntegration(config = {}) {
|
|
|
2937
3032
|
};
|
|
2938
3033
|
return {
|
|
2939
3034
|
id: "gcal",
|
|
3035
|
+
name: "Google Calendar",
|
|
3036
|
+
logoUrl: "https://cdn.simpleicons.org/googlecalendar",
|
|
2940
3037
|
tools: [...GCAL_TOOLS],
|
|
2941
3038
|
oauth,
|
|
2942
3039
|
async onInit(_client) {
|
|
@@ -2978,6 +3075,8 @@ function outlookIntegration(config = {}) {
|
|
|
2978
3075
|
};
|
|
2979
3076
|
return {
|
|
2980
3077
|
id: "outlook",
|
|
3078
|
+
name: "Outlook",
|
|
3079
|
+
logoUrl: "https://cdn.simpleicons.org/microsoftoutlook",
|
|
2981
3080
|
tools: [...OUTLOOK_TOOLS],
|
|
2982
3081
|
oauth,
|
|
2983
3082
|
async onInit(_client) {
|
|
@@ -3019,6 +3118,8 @@ function airtableIntegration(config = {}) {
|
|
|
3019
3118
|
};
|
|
3020
3119
|
return {
|
|
3021
3120
|
id: "airtable",
|
|
3121
|
+
name: "Airtable",
|
|
3122
|
+
logoUrl: "https://cdn.simpleicons.org/airtable",
|
|
3022
3123
|
tools: [...AIRTABLE_TOOLS],
|
|
3023
3124
|
oauth,
|
|
3024
3125
|
async onInit(_client) {
|
|
@@ -3060,6 +3161,8 @@ function todoistIntegration(config = {}) {
|
|
|
3060
3161
|
};
|
|
3061
3162
|
return {
|
|
3062
3163
|
id: "todoist",
|
|
3164
|
+
name: "Todoist",
|
|
3165
|
+
logoUrl: "https://cdn.simpleicons.org/todoist",
|
|
3063
3166
|
tools: [...TODOIST_TOOLS],
|
|
3064
3167
|
oauth,
|
|
3065
3168
|
async onInit(_client) {
|
|
@@ -3102,6 +3205,8 @@ function whatsappIntegration(config = {}) {
|
|
|
3102
3205
|
};
|
|
3103
3206
|
return {
|
|
3104
3207
|
id: "whatsapp",
|
|
3208
|
+
name: "WhatsApp Business",
|
|
3209
|
+
logoUrl: "https://cdn.simpleicons.org/whatsapp",
|
|
3105
3210
|
tools: [...WHATSAPP_TOOLS],
|
|
3106
3211
|
oauth,
|
|
3107
3212
|
async onInit(_client) {
|
|
@@ -3143,6 +3248,8 @@ function calcomIntegration(config = {}) {
|
|
|
3143
3248
|
};
|
|
3144
3249
|
return {
|
|
3145
3250
|
id: "calcom",
|
|
3251
|
+
name: "Cal.com",
|
|
3252
|
+
logoUrl: "https://cdn.simpleicons.org/calendly",
|
|
3146
3253
|
tools: [...CALCOM_TOOLS],
|
|
3147
3254
|
oauth,
|
|
3148
3255
|
async onInit(_client) {
|
|
@@ -3185,6 +3292,8 @@ function rampIntegration(config = {}) {
|
|
|
3185
3292
|
};
|
|
3186
3293
|
return {
|
|
3187
3294
|
id: "ramp",
|
|
3295
|
+
name: "Ramp",
|
|
3296
|
+
logoUrl: "https://cdn.simpleicons.org/ramp",
|
|
3188
3297
|
tools: [...RAMP_TOOLS],
|
|
3189
3298
|
oauth,
|
|
3190
3299
|
async onInit(_client) {
|
|
@@ -3226,6 +3335,8 @@ function onedriveIntegration(config = {}) {
|
|
|
3226
3335
|
};
|
|
3227
3336
|
return {
|
|
3228
3337
|
id: "onedrive",
|
|
3338
|
+
name: "OneDrive",
|
|
3339
|
+
logoUrl: "https://cdn.simpleicons.org/onedrive",
|
|
3229
3340
|
tools: [...ONEDRIVE_TOOLS],
|
|
3230
3341
|
oauth,
|
|
3231
3342
|
async onInit(_client) {
|
|
@@ -3275,6 +3386,8 @@ function gworkspaceIntegration(config = {}) {
|
|
|
3275
3386
|
};
|
|
3276
3387
|
return {
|
|
3277
3388
|
id: "gworkspace",
|
|
3389
|
+
name: "Google Workspace",
|
|
3390
|
+
logoUrl: "https://cdn.simpleicons.org/google",
|
|
3278
3391
|
tools: [...GWORKSPACE_TOOLS],
|
|
3279
3392
|
oauth,
|
|
3280
3393
|
async onInit(_client) {
|
|
@@ -3320,6 +3433,8 @@ function polarIntegration(config = {}) {
|
|
|
3320
3433
|
};
|
|
3321
3434
|
return {
|
|
3322
3435
|
id: "polar",
|
|
3436
|
+
name: "Polar",
|
|
3437
|
+
logoUrl: "https://cdn.simpleicons.org/polar",
|
|
3323
3438
|
tools: [...POLAR_TOOLS],
|
|
3324
3439
|
oauth,
|
|
3325
3440
|
async onInit(_client) {
|
|
@@ -3361,6 +3476,8 @@ function figmaIntegration(config = {}) {
|
|
|
3361
3476
|
};
|
|
3362
3477
|
return {
|
|
3363
3478
|
id: "figma",
|
|
3479
|
+
name: "Figma",
|
|
3480
|
+
logoUrl: "https://cdn.simpleicons.org/figma",
|
|
3364
3481
|
tools: [...FIGMA_TOOLS],
|
|
3365
3482
|
oauth,
|
|
3366
3483
|
async onInit(_client) {
|
|
@@ -3402,6 +3519,8 @@ function intercomIntegration(config = {}) {
|
|
|
3402
3519
|
};
|
|
3403
3520
|
return {
|
|
3404
3521
|
id: "intercom",
|
|
3522
|
+
name: "Intercom",
|
|
3523
|
+
logoUrl: "https://cdn.simpleicons.org/intercom",
|
|
3405
3524
|
tools: [...INTERCOM_TOOLS],
|
|
3406
3525
|
oauth,
|
|
3407
3526
|
async onInit(_client) {
|
|
@@ -3451,6 +3570,8 @@ function hubspotIntegration(config = {}) {
|
|
|
3451
3570
|
};
|
|
3452
3571
|
return {
|
|
3453
3572
|
id: "hubspot",
|
|
3573
|
+
name: "HubSpot",
|
|
3574
|
+
logoUrl: "https://cdn.simpleicons.org/hubspot",
|
|
3454
3575
|
tools: [...HUBSPOT_TOOLS],
|
|
3455
3576
|
oauth,
|
|
3456
3577
|
async onInit(_client) {
|
|
@@ -3495,6 +3616,8 @@ function youtubeIntegration(config = {}) {
|
|
|
3495
3616
|
};
|
|
3496
3617
|
return {
|
|
3497
3618
|
id: "youtube",
|
|
3619
|
+
name: "YouTube",
|
|
3620
|
+
logoUrl: "https://cdn.simpleicons.org/youtube",
|
|
3498
3621
|
tools: [...YOUTUBE_TOOLS],
|
|
3499
3622
|
oauth,
|
|
3500
3623
|
async onInit(_client) {
|
|
@@ -3526,6 +3649,8 @@ var init_youtube = __esm(() => {
|
|
|
3526
3649
|
function cursorIntegration(_config = {}) {
|
|
3527
3650
|
return {
|
|
3528
3651
|
id: "cursor",
|
|
3652
|
+
name: "Cursor",
|
|
3653
|
+
logoUrl: "https://cdn.simpleicons.org/cursor",
|
|
3529
3654
|
tools: [...CURSOR_TOOLS],
|
|
3530
3655
|
async onInit(_client) {
|
|
3531
3656
|
logger29.debug("Cursor integration initialized");
|
|
@@ -3566,6 +3691,8 @@ function genericOAuthIntegration(config) {
|
|
|
3566
3691
|
};
|
|
3567
3692
|
return {
|
|
3568
3693
|
id: config.id,
|
|
3694
|
+
name: config.name,
|
|
3695
|
+
logoUrl: config.logoUrl,
|
|
3569
3696
|
tools: config.tools,
|
|
3570
3697
|
oauth,
|
|
3571
3698
|
onInit: config.onInit,
|
|
@@ -9386,7 +9513,6 @@ var init_zodToJsonSchema = __esm(() => {
|
|
|
9386
9513
|
|
|
9387
9514
|
// node_modules/zod-to-json-schema/dist/esm/index.js
|
|
9388
9515
|
var init_esm = __esm(() => {
|
|
9389
|
-
init_zodToJsonSchema();
|
|
9390
9516
|
init_Options();
|
|
9391
9517
|
init_Refs();
|
|
9392
9518
|
init_parseDef();
|
|
@@ -9418,6 +9544,7 @@ var init_esm = __esm(() => {
|
|
|
9418
9544
|
init_unknown();
|
|
9419
9545
|
init_selectParser();
|
|
9420
9546
|
init_zodToJsonSchema();
|
|
9547
|
+
init_zodToJsonSchema();
|
|
9421
9548
|
});
|
|
9422
9549
|
|
|
9423
9550
|
// src/ai/openai.ts
|