integrate-sdk 0.9.27-dev.1 → 0.9.28-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.
Files changed (35) hide show
  1. package/README.md +82 -0
  2. package/dist/adapters/auto-routes.js +177 -8
  3. package/dist/adapters/base-handler.d.ts +4 -2
  4. package/dist/adapters/base-handler.d.ts.map +1 -1
  5. package/dist/adapters/base-handler.js +177 -8
  6. package/dist/adapters/index.js +245 -81
  7. package/dist/adapters/nextjs.js +177 -8
  8. package/dist/adapters/solid-start.js +245 -81
  9. package/dist/adapters/svelte-kit.js +245 -81
  10. package/dist/index.js +422 -109
  11. package/dist/oauth.js +177 -8
  12. package/dist/server.js +449 -138
  13. package/dist/src/adapters/base-handler.d.ts +4 -2
  14. package/dist/src/adapters/base-handler.d.ts.map +1 -1
  15. package/dist/src/client.d.ts +8 -0
  16. package/dist/src/client.d.ts.map +1 -1
  17. package/dist/src/index.d.ts +8 -0
  18. package/dist/src/index.d.ts.map +1 -1
  19. package/dist/src/integrations/dropbox.d.ts +22 -0
  20. package/dist/src/integrations/dropbox.d.ts.map +1 -0
  21. package/dist/src/integrations/granola.d.ts +14 -0
  22. package/dist/src/integrations/granola.d.ts.map +1 -0
  23. package/dist/src/integrations/integration-summary.d.ts +24 -0
  24. package/dist/src/integrations/integration-summary.d.ts.map +1 -0
  25. package/dist/src/integrations/library-metadata.d.ts +26 -0
  26. package/dist/src/integrations/library-metadata.d.ts.map +1 -0
  27. package/dist/src/integrations/mercury.d.ts +14 -0
  28. package/dist/src/integrations/mercury.d.ts.map +1 -0
  29. package/dist/src/integrations/server-client.d.ts +4 -0
  30. package/dist/src/integrations/server-client.d.ts.map +1 -1
  31. package/dist/src/integrations/types.d.ts +12 -0
  32. package/dist/src/integrations/types.d.ts.map +1 -1
  33. package/dist/src/server.d.ts +3 -0
  34. package/dist/src/server.d.ts.map +1 -1
  35. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -800,6 +800,182 @@ var MCPMethod;
800
800
  MCPMethod2["PROMPTS_GET"] = "prompts/get";
801
801
  })(MCPMethod ||= {});
802
802
 
803
+ // src/integrations/library-metadata.ts
804
+ var INTEGRATION_CATEGORY_ORDER = [
805
+ "Productivity",
806
+ "Business",
807
+ "Communication",
808
+ "Engineering",
809
+ "Storage",
810
+ "Other"
811
+ ];
812
+ var INTEGRATION_LIBRARY_METADATA = {
813
+ airtable: {
814
+ description: "Manage Airtable bases, tables, and records",
815
+ category: "Business"
816
+ },
817
+ calcom: {
818
+ description: "Manage Cal.com bookings and schedules",
819
+ category: "Productivity"
820
+ },
821
+ cursor: {
822
+ description: "Manage Cursor Cloud Agents and background tasks",
823
+ category: "Engineering"
824
+ },
825
+ figma: {
826
+ description: "Access Figma files, comments, and components",
827
+ category: "Engineering"
828
+ },
829
+ github: {
830
+ description: "Manage GitHub repos, issues, and pull requests",
831
+ category: "Engineering"
832
+ },
833
+ gmail: {
834
+ description: "Send, read, and search Gmail messages",
835
+ category: "Communication"
836
+ },
837
+ gcal: {
838
+ description: "Manage Google Calendar events and schedules",
839
+ category: "Productivity"
840
+ },
841
+ hubspot: {
842
+ description: "Manage HubSpot contacts, deals, and tickets",
843
+ category: "Business"
844
+ },
845
+ intercom: {
846
+ description: "Manage Intercom contacts and conversations",
847
+ category: "Business"
848
+ },
849
+ linear: {
850
+ description: "Manage Linear issues, projects, and cycles",
851
+ category: "Engineering"
852
+ },
853
+ notion: {
854
+ description: "Manage Notion pages and databases",
855
+ category: "Productivity"
856
+ },
857
+ onedrive: {
858
+ description: "Manage OneDrive files, folders, and sharing",
859
+ category: "Storage"
860
+ },
861
+ outlook: {
862
+ description: "Manage Outlook mail, calendars, and contacts",
863
+ category: "Communication"
864
+ },
865
+ polar: {
866
+ description: "Manage Polar products, orders, and subscriptions",
867
+ category: "Business"
868
+ },
869
+ ramp: {
870
+ description: "Manage Ramp corporate cards, bills, and spend",
871
+ category: "Business"
872
+ },
873
+ slack: {
874
+ description: "Send and manage Slack messages and channels",
875
+ category: "Communication"
876
+ },
877
+ stripe: {
878
+ description: "Manage Stripe customers, payments, and subscriptions",
879
+ category: "Business"
880
+ },
881
+ todoist: {
882
+ description: "Manage Todoist tasks, projects, and labels",
883
+ category: "Productivity"
884
+ },
885
+ gslides: {
886
+ description: "Create and update Google Slides presentations",
887
+ category: "Productivity"
888
+ },
889
+ gsheets: {
890
+ description: "Read and update Google Sheets spreadsheets",
891
+ category: "Productivity"
892
+ },
893
+ gdocs: {
894
+ description: "Create and edit Google Docs documents",
895
+ category: "Productivity"
896
+ },
897
+ gdrive: {
898
+ description: "Manage Google Drive files, folders, and sharing",
899
+ category: "Storage"
900
+ },
901
+ vercel: {
902
+ description: "Manage Vercel projects, deployments, and domains",
903
+ category: "Engineering"
904
+ },
905
+ whatsapp: {
906
+ description: "Send WhatsApp messages and templates",
907
+ category: "Communication"
908
+ },
909
+ youtube: {
910
+ description: "Search and access YouTube videos and channels",
911
+ category: "Communication"
912
+ },
913
+ powerpoint: {
914
+ description: "Manage PowerPoint presentations and sharing",
915
+ category: "Productivity"
916
+ },
917
+ excel: {
918
+ description: "Manage Excel workbooks, worksheets, and tables",
919
+ category: "Productivity"
920
+ },
921
+ word: {
922
+ description: "Manage Word documents and sharing",
923
+ category: "Productivity"
924
+ },
925
+ dropbox: {
926
+ description: "Manage Dropbox files, folders, and sharing",
927
+ category: "Storage"
928
+ },
929
+ granola: {
930
+ description: "List and read Granola meeting notes and folders",
931
+ category: "Productivity"
932
+ },
933
+ mercury: {
934
+ description: "Manage Mercury bank accounts, cards, and transactions",
935
+ category: "Business"
936
+ },
937
+ zendesk: {
938
+ description: "Manage Zendesk tickets, users, and help center content",
939
+ category: "Business"
940
+ }
941
+ };
942
+ function integrationLibraryPresentationFields(integration) {
943
+ const id = typeof integration["id"] === "string" ? integration["id"] : String(integration["id"] ?? "");
944
+ const fromCatalog = id ? INTEGRATION_LIBRARY_METADATA[id] : undefined;
945
+ const explicitDescription = integration["description"];
946
+ const explicitCategory = integration["category"];
947
+ const description = typeof explicitDescription === "string" && explicitDescription.trim().length > 0 ? explicitDescription.trim() : fromCatalog?.description;
948
+ const category = typeof explicitCategory === "string" && explicitCategory.trim().length > 0 ? explicitCategory.trim() : fromCatalog?.category;
949
+ const out = {};
950
+ if (description)
951
+ out.description = description;
952
+ if (category)
953
+ out.category = category;
954
+ return out;
955
+ }
956
+
957
+ // src/integrations/integration-summary.ts
958
+ function toConfiguredIntegrationSummary(integration) {
959
+ const row = integration;
960
+ const pres = integrationLibraryPresentationFields(row);
961
+ return {
962
+ id: integration.id,
963
+ name: row.name || integration.id,
964
+ logoUrl: row.logoUrl,
965
+ tools: integration.tools,
966
+ hasOAuth: !!integration.oauth,
967
+ scopes: integration.oauth?.scopes,
968
+ provider: integration.oauth?.provider,
969
+ ...pres
970
+ };
971
+ }
972
+ function toConfiguredIntegrationWithToolMetadata(integration, toolMetadata) {
973
+ return {
974
+ ...toConfiguredIntegrationSummary(integration),
975
+ toolMetadata
976
+ };
977
+ }
978
+
803
979
  // src/client.ts
804
980
  init_errors();
805
981
 
@@ -2238,31 +2414,14 @@ class MCPClientBase {
2238
2414
  const serverConfig = this.__oauthConfig;
2239
2415
  const localIntegrations = serverConfig?.integrations || this.__configuredIntegrations;
2240
2416
  const formatLocalIntegrations = (integrations) => ({
2241
- integrations: integrations.map((integration) => ({
2242
- id: integration.id,
2243
- name: integration.name || integration.id,
2244
- logoUrl: integration.logoUrl,
2245
- tools: integration.tools,
2246
- hasOAuth: !!integration.oauth,
2247
- scopes: integration.oauth?.scopes,
2248
- provider: integration.oauth?.provider
2249
- }))
2417
+ integrations: integrations.map((integration) => toConfiguredIntegrationSummary(integration))
2250
2418
  });
2251
2419
  if (hasApiKey || !this.__useServerConfig) {
2252
2420
  if (options?.includeToolMetadata && hasApiKey) {
2253
2421
  await this.ensureConnected();
2254
2422
  const integrationsWithMetadata = localIntegrations.map((integration) => {
2255
2423
  const toolMetadata = integration.tools.map((toolName) => this.availableTools.get(toolName)).filter((tool) => !!tool);
2256
- return {
2257
- id: integration.id,
2258
- name: integration.name || integration.id,
2259
- logoUrl: integration.logoUrl,
2260
- tools: integration.tools,
2261
- hasOAuth: !!integration.oauth,
2262
- scopes: integration.oauth?.scopes,
2263
- provider: integration.oauth?.provider,
2264
- toolMetadata
2265
- };
2424
+ return toConfiguredIntegrationWithToolMetadata(integration, toolMetadata);
2266
2425
  });
2267
2426
  return { integrations: integrationsWithMetadata };
2268
2427
  }
@@ -2288,28 +2447,10 @@ class MCPClientBase {
2288
2447
  }
2289
2448
  }
2290
2449
  }
2291
- return {
2292
- id: integration.id,
2293
- name: integration.name || integration.id,
2294
- logoUrl: integration.logoUrl,
2295
- tools: integration.tools,
2296
- hasOAuth: !!integration.oauth,
2297
- scopes: integration.oauth?.scopes,
2298
- provider: integration.oauth?.provider,
2299
- toolMetadata
2300
- };
2450
+ return toConfiguredIntegrationWithToolMetadata(integration, toolMetadata);
2301
2451
  } catch (error) {
2302
2452
  logger5.error(`Failed to fetch tool metadata for ${integration.id}:`, error);
2303
- return {
2304
- id: integration.id,
2305
- name: integration.name || integration.id,
2306
- logoUrl: integration.logoUrl,
2307
- tools: integration.tools,
2308
- hasOAuth: !!integration.oauth,
2309
- scopes: integration.oauth?.scopes,
2310
- provider: integration.oauth?.provider,
2311
- toolMetadata: []
2312
- };
2453
+ return toConfiguredIntegrationWithToolMetadata(integration, []);
2313
2454
  }
2314
2455
  }, 3);
2315
2456
  return { integrations: integrationsWithMetadata };
@@ -2329,6 +2470,12 @@ class MCPClientBase {
2329
2470
  return formatLocalIntegrations(localIntegrations);
2330
2471
  }
2331
2472
  const result = await response.json();
2473
+ if (result.integrations && Array.isArray(result.integrations)) {
2474
+ result.integrations = result.integrations.map((row) => ({
2475
+ ...row,
2476
+ ...integrationLibraryPresentationFields(row)
2477
+ }));
2478
+ }
2332
2479
  if (options?.includeToolMetadata && result.integrations) {
2333
2480
  const { parallelWithLimit: parallelWithLimit2 } = await Promise.resolve().then(() => exports_concurrency);
2334
2481
  const integrationsWithMetadata = await parallelWithLimit2(result.integrations, async (integration) => {
@@ -2353,12 +2500,14 @@ class MCPClientBase {
2353
2500
  }
2354
2501
  return {
2355
2502
  ...integration,
2503
+ ...integrationLibraryPresentationFields(integration),
2356
2504
  toolMetadata
2357
2505
  };
2358
2506
  } catch (error) {
2359
2507
  logger5.error(`Failed to fetch tool metadata for ${integration.id}:`, error);
2360
2508
  return {
2361
2509
  ...integration,
2510
+ ...integrationLibraryPresentationFields(integration),
2362
2511
  toolMetadata: []
2363
2512
  };
2364
2513
  }
@@ -2451,6 +2600,9 @@ class MCPClientBase {
2451
2600
  async _callToolByName(name, args, options) {
2452
2601
  return await this.callToolWithRetry(name, args, 0, options);
2453
2602
  }
2603
+ async callTool(name, args, options) {
2604
+ return await this.callToolWithRetry(name, args, 0, options);
2605
+ }
2454
2606
  async callServerTool(name, args) {
2455
2607
  try {
2456
2608
  const response = await this.callToolThroughHandler(name, args);
@@ -2461,35 +2613,38 @@ class MCPClientBase {
2461
2613
  }
2462
2614
  }
2463
2615
  async callToolThroughHandler(name, args, provider, options) {
2616
+ const integrationHeaders = this.getHeadersForTool(name);
2464
2617
  const transportHeaders = this.transport.headers || {};
2465
2618
  const hasApiKey = !!transportHeaders["X-API-KEY"];
2466
2619
  if (hasApiKey) {
2467
2620
  await this.ensureConnected();
2621
+ const temporaryHeaders = { ...integrationHeaders };
2468
2622
  if (provider) {
2469
2623
  const tokenData = await this.oauthManager.getProviderToken(provider, undefined, options?.context);
2470
- if (tokenData && this.transport.setHeader) {
2471
- const previousAuthHeader = transportHeaders["Authorization"];
2472
- try {
2473
- this.transport.setHeader("Authorization", `Bearer ${tokenData.accessToken}`);
2474
- const result3 = await this.transport.sendRequest("tools/call", {
2475
- name,
2476
- arguments: args || {}
2477
- });
2478
- return result3;
2479
- } finally {
2480
- if (previousAuthHeader && this.transport.setHeader) {
2481
- this.transport.setHeader("Authorization", previousAuthHeader);
2482
- } else if (this.transport.removeHeader) {
2483
- this.transport.removeHeader("Authorization");
2484
- }
2624
+ if (tokenData) {
2625
+ temporaryHeaders["Authorization"] = `Bearer ${tokenData.accessToken}`;
2626
+ }
2627
+ }
2628
+ const previousHeaders = new Map;
2629
+ for (const [key, value] of Object.entries(temporaryHeaders)) {
2630
+ previousHeaders.set(key, transportHeaders[key]);
2631
+ this.transport.setHeader(key, value);
2632
+ }
2633
+ try {
2634
+ const result2 = await this.transport.sendRequest("tools/call", {
2635
+ name,
2636
+ arguments: args || {}
2637
+ });
2638
+ return result2;
2639
+ } finally {
2640
+ for (const [key, previousValue] of previousHeaders.entries()) {
2641
+ if (previousValue !== undefined) {
2642
+ this.transport.setHeader(key, previousValue);
2643
+ } else {
2644
+ this.transport.removeHeader(key);
2485
2645
  }
2486
2646
  }
2487
2647
  }
2488
- const result2 = await this.transport.sendRequest("tools/call", {
2489
- name,
2490
- arguments: args || {}
2491
- });
2492
- return result2;
2493
2648
  }
2494
2649
  const url = this.apiBaseUrl ? `${this.apiBaseUrl}${this.apiRouteBase}/mcp` : `${this.apiRouteBase}/mcp`;
2495
2650
  const headers = {
@@ -2499,6 +2654,7 @@ class MCPClientBase {
2499
2654
  if (integrationsHeader) {
2500
2655
  headers["X-Integrations"] = integrationsHeader;
2501
2656
  }
2657
+ Object.assign(headers, integrationHeaders);
2502
2658
  if (provider) {
2503
2659
  const tokenData = await this.oauthManager.getProviderToken(provider, undefined, options?.context);
2504
2660
  if (tokenData) {
@@ -2588,6 +2744,14 @@ class MCPClientBase {
2588
2744
  }
2589
2745
  return;
2590
2746
  }
2747
+ getHeadersForTool(toolName) {
2748
+ for (const integration of this.integrations) {
2749
+ if (integration.tools.includes(toolName) && integration.getHeaders) {
2750
+ return integration.getHeaders();
2751
+ }
2752
+ }
2753
+ return {};
2754
+ }
2591
2755
  getTool(name) {
2592
2756
  return this.availableTools.get(name);
2593
2757
  }
@@ -3088,14 +3252,8 @@ class OAuthHandler {
3088
3252
  const integrations = this.config.integrations || [];
3089
3253
  return {
3090
3254
  integrations: integrations.map((integration) => ({
3091
- id: integration.id,
3092
- name: integration.name || integration.id,
3093
- logoUrl: integration.logoUrl,
3094
- tools: integration.tools,
3095
- hasOAuth: !!integration.oauth,
3096
- scopes: integration.oauth?.scopes,
3097
- optionalScopes: integration.oauth?.optionalScopes,
3098
- provider: integration.oauth?.provider
3255
+ ...toConfiguredIntegrationSummary(integration),
3256
+ optionalScopes: integration.oauth?.optionalScopes
3099
3257
  }))
3100
3258
  };
3101
3259
  }
@@ -4757,8 +4915,55 @@ function onedriveIntegration(config = {}) {
4757
4915
  }
4758
4916
  };
4759
4917
  }
4918
+ // src/integrations/dropbox.ts
4919
+ var logger25 = createLogger("Dropbox");
4920
+ var DROPBOX_TOOLS = [
4921
+ "dropbox_get_current_account",
4922
+ "dropbox_get_space_usage",
4923
+ "dropbox_list_folder",
4924
+ "dropbox_list_folder_continue",
4925
+ "dropbox_get_metadata",
4926
+ "dropbox_search_files",
4927
+ "dropbox_create_folder",
4928
+ "dropbox_delete_path",
4929
+ "dropbox_move_path",
4930
+ "dropbox_copy_path",
4931
+ "dropbox_upload_text_file",
4932
+ "dropbox_download_file",
4933
+ "dropbox_get_temporary_link",
4934
+ "dropbox_create_shared_link",
4935
+ "dropbox_list_shared_links",
4936
+ "dropbox_revoke_shared_link"
4937
+ ];
4938
+ function dropboxIntegration(options = {}) {
4939
+ if (options.scopes !== undefined && (!Array.isArray(options.scopes) || options.scopes.some((scope) => typeof scope !== "string"))) {
4940
+ throw new Error("dropboxIntegration scopes must be an array of strings");
4941
+ }
4942
+ const oauth = {
4943
+ provider: "dropbox",
4944
+ clientId: options.clientId ?? getEnv("DROPBOX_CLIENT_ID"),
4945
+ clientSecret: options.clientSecret ?? getEnv("DROPBOX_CLIENT_SECRET"),
4946
+ scopes: options.scopes,
4947
+ optionalScopes: options.optionalScopes,
4948
+ redirectUri: options.redirectUri,
4949
+ config: options
4950
+ };
4951
+ return {
4952
+ id: "dropbox",
4953
+ name: "Dropbox",
4954
+ tools: [...DROPBOX_TOOLS],
4955
+ authType: "oauth",
4956
+ oauth,
4957
+ async onInit(_client) {
4958
+ logger25.debug("Dropbox integration initialized");
4959
+ },
4960
+ async onAfterConnect(_client) {
4961
+ logger25.debug("Dropbox integration connected");
4962
+ }
4963
+ };
4964
+ }
4760
4965
  // src/integrations/gdocs.ts
4761
- var logger25 = createLogger("Google Docs");
4966
+ var logger26 = createLogger("Google Docs");
4762
4967
  var GDOCS_TOOLS = [
4763
4968
  "gdocs_list",
4764
4969
  "gdocs_get",
@@ -4783,15 +4988,15 @@ function gdocsIntegration(config = {}) {
4783
4988
  tools: [...GDOCS_TOOLS],
4784
4989
  oauth,
4785
4990
  async onInit(_client) {
4786
- logger25.debug("Google Docs integration initialized");
4991
+ logger26.debug("Google Docs integration initialized");
4787
4992
  },
4788
4993
  async onAfterConnect(_client) {
4789
- logger25.debug("Google Docs integration connected");
4994
+ logger26.debug("Google Docs integration connected");
4790
4995
  }
4791
4996
  };
4792
4997
  }
4793
4998
  // src/integrations/gsheets.ts
4794
- var logger26 = createLogger("Google Sheets");
4999
+ var logger27 = createLogger("Google Sheets");
4795
5000
  var GSHEETS_TOOLS = [
4796
5001
  "gsheets_list",
4797
5002
  "gsheets_get",
@@ -4819,15 +5024,15 @@ function gsheetsIntegration(config = {}) {
4819
5024
  tools: [...GSHEETS_TOOLS],
4820
5025
  oauth,
4821
5026
  async onInit(_client) {
4822
- logger26.debug("Google Sheets integration initialized");
5027
+ logger27.debug("Google Sheets integration initialized");
4823
5028
  },
4824
5029
  async onAfterConnect(_client) {
4825
- logger26.debug("Google Sheets integration connected");
5030
+ logger27.debug("Google Sheets integration connected");
4826
5031
  }
4827
5032
  };
4828
5033
  }
4829
5034
  // src/integrations/gslides.ts
4830
- var logger27 = createLogger("Google Slides");
5035
+ var logger28 = createLogger("Google Slides");
4831
5036
  var GSLIDES_TOOLS = [
4832
5037
  "gslides_list",
4833
5038
  "gslides_get",
@@ -4854,15 +5059,15 @@ function gslidesIntegration(config = {}) {
4854
5059
  tools: [...GSLIDES_TOOLS],
4855
5060
  oauth,
4856
5061
  async onInit(_client) {
4857
- logger27.debug("Google Slides integration initialized");
5062
+ logger28.debug("Google Slides integration initialized");
4858
5063
  },
4859
5064
  async onAfterConnect(_client) {
4860
- logger27.debug("Google Slides integration connected");
5065
+ logger28.debug("Google Slides integration connected");
4861
5066
  }
4862
5067
  };
4863
5068
  }
4864
5069
  // src/integrations/polar.ts
4865
- var logger28 = createLogger("Polar");
5070
+ var logger29 = createLogger("Polar");
4866
5071
  var POLAR_TOOLS = [
4867
5072
  "polar_list_products",
4868
5073
  "polar_get_product",
@@ -4919,15 +5124,15 @@ function polarIntegration(config = {}) {
4919
5124
  tools: [...POLAR_TOOLS],
4920
5125
  oauth,
4921
5126
  async onInit(_client) {
4922
- logger28.debug("Polar integration initialized");
5127
+ logger29.debug("Polar integration initialized");
4923
5128
  },
4924
5129
  async onAfterConnect(_client) {
4925
- logger28.debug("Polar integration connected");
5130
+ logger29.debug("Polar integration connected");
4926
5131
  }
4927
5132
  };
4928
5133
  }
4929
5134
  // src/integrations/figma.ts
4930
- var logger29 = createLogger("Figma");
5135
+ var logger30 = createLogger("Figma");
4931
5136
  var FIGMA_TOOLS = [
4932
5137
  "figma_get_file",
4933
5138
  "figma_get_file_nodes",
@@ -4993,15 +5198,15 @@ function figmaIntegration(config = {}) {
4993
5198
  tools: [...FIGMA_TOOLS],
4994
5199
  oauth,
4995
5200
  async onInit(_client) {
4996
- logger29.debug("Figma integration initialized");
5201
+ logger30.debug("Figma integration initialized");
4997
5202
  },
4998
5203
  async onAfterConnect(_client) {
4999
- logger29.debug("Figma integration connected");
5204
+ logger30.debug("Figma integration connected");
5000
5205
  }
5001
5206
  };
5002
5207
  }
5003
5208
  // src/integrations/intercom.ts
5004
- var logger30 = createLogger("Intercom");
5209
+ var logger31 = createLogger("Intercom");
5005
5210
  var INTERCOM_TOOLS = [
5006
5211
  "intercom_list_contacts",
5007
5212
  "intercom_get_contact",
@@ -5032,15 +5237,15 @@ function intercomIntegration(config = {}) {
5032
5237
  tools: [...INTERCOM_TOOLS],
5033
5238
  oauth,
5034
5239
  async onInit(_client) {
5035
- logger30.debug("Intercom integration initialized");
5240
+ logger31.debug("Intercom integration initialized");
5036
5241
  },
5037
5242
  async onAfterConnect(_client) {
5038
- logger30.debug("Intercom integration connected");
5243
+ logger31.debug("Intercom integration connected");
5039
5244
  }
5040
5245
  };
5041
5246
  }
5042
5247
  // src/integrations/hubspot.ts
5043
- var logger31 = createLogger("HubSpot");
5248
+ var logger32 = createLogger("HubSpot");
5044
5249
  var HUBSPOT_TOOLS = [
5045
5250
  "hubspot_list_contacts",
5046
5251
  "hubspot_get_contact",
@@ -5090,15 +5295,15 @@ function hubspotIntegration(config = {}) {
5090
5295
  tools: [...HUBSPOT_TOOLS],
5091
5296
  oauth,
5092
5297
  async onInit(_client) {
5093
- logger31.debug("HubSpot integration initialized");
5298
+ logger32.debug("HubSpot integration initialized");
5094
5299
  },
5095
5300
  async onAfterConnect(_client) {
5096
- logger31.debug("HubSpot integration connected");
5301
+ logger32.debug("HubSpot integration connected");
5097
5302
  }
5098
5303
  };
5099
5304
  }
5100
5305
  // src/integrations/youtube.ts
5101
- var logger32 = createLogger("YouTube");
5306
+ var logger33 = createLogger("YouTube");
5102
5307
  var YOUTUBE_TOOLS = [
5103
5308
  "youtube_search",
5104
5309
  "youtube_get_video",
@@ -5144,15 +5349,15 @@ function youtubeIntegration(config = {}) {
5144
5349
  tools: [...YOUTUBE_TOOLS],
5145
5350
  oauth,
5146
5351
  async onInit(_client) {
5147
- logger32.debug("YouTube integration initialized");
5352
+ logger33.debug("YouTube integration initialized");
5148
5353
  },
5149
5354
  async onAfterConnect(_client) {
5150
- logger32.debug("YouTube integration connected");
5355
+ logger33.debug("YouTube integration connected");
5151
5356
  }
5152
5357
  };
5153
5358
  }
5154
5359
  // src/integrations/cursor.ts
5155
- var logger33 = createLogger("Cursor");
5360
+ var logger34 = createLogger("Cursor");
5156
5361
  var CURSOR_TOOLS = [
5157
5362
  "cursor_list_agents",
5158
5363
  "cursor_get_agent",
@@ -5172,10 +5377,114 @@ function cursorIntegration(_config = {}) {
5172
5377
  logoUrl: "https://wdvtnli2jn3texa6.public.blob.vercel-storage.com/cursor.jpeg",
5173
5378
  tools: [...CURSOR_TOOLS],
5174
5379
  async onInit(_client) {
5175
- logger33.debug("Cursor integration initialized");
5380
+ logger34.debug("Cursor integration initialized");
5176
5381
  },
5177
5382
  async onAfterConnect(_client) {
5178
- logger33.debug("Cursor integration connected");
5383
+ logger34.debug("Cursor integration connected");
5384
+ }
5385
+ };
5386
+ }
5387
+ // src/integrations/granola.ts
5388
+ var GRANOLA_TOOLS = [
5389
+ "granola_list_notes",
5390
+ "granola_get_note",
5391
+ "granola_list_folders"
5392
+ ];
5393
+ function granolaIntegration(options) {
5394
+ if (!options.apiKey) {
5395
+ throw new Error("granolaIntegration requires an apiKey");
5396
+ }
5397
+ return {
5398
+ id: "granola",
5399
+ name: "Granola",
5400
+ tools: [...GRANOLA_TOOLS],
5401
+ authType: "apiKey",
5402
+ getHeaders() {
5403
+ return {
5404
+ Authorization: `Bearer ${options.apiKey}`
5405
+ };
5406
+ }
5407
+ };
5408
+ }
5409
+ // src/integrations/mercury.ts
5410
+ var MERCURY_TOOLS = [
5411
+ "mercury_get_organization",
5412
+ "mercury_list_accounts",
5413
+ "mercury_get_account",
5414
+ "mercury_get_account_cards",
5415
+ "mercury_list_account_transactions",
5416
+ "mercury_get_account_transaction",
5417
+ "mercury_list_account_statements",
5418
+ "mercury_download_statement_pdf",
5419
+ "mercury_list_transactions",
5420
+ "mercury_get_transaction",
5421
+ "mercury_update_transaction",
5422
+ "mercury_upload_transaction_attachment",
5423
+ "mercury_list_cards",
5424
+ "mercury_get_card",
5425
+ "mercury_create_card",
5426
+ "mercury_update_card",
5427
+ "mercury_freeze_card",
5428
+ "mercury_unfreeze_card",
5429
+ "mercury_cancel_card",
5430
+ "mercury_list_categories",
5431
+ "mercury_create_category",
5432
+ "mercury_update_category",
5433
+ "mercury_list_credit_accounts",
5434
+ "mercury_list_users",
5435
+ "mercury_get_user",
5436
+ "mercury_list_recipients",
5437
+ "mercury_get_recipient",
5438
+ "mercury_create_recipient",
5439
+ "mercury_update_recipient",
5440
+ "mercury_list_recipient_attachments",
5441
+ "mercury_upload_recipient_attachment",
5442
+ "mercury_list_customers",
5443
+ "mercury_get_customer",
5444
+ "mercury_create_customer",
5445
+ "mercury_update_customer",
5446
+ "mercury_delete_customer",
5447
+ "mercury_list_invoices",
5448
+ "mercury_get_invoice",
5449
+ "mercury_create_invoice",
5450
+ "mercury_update_invoice",
5451
+ "mercury_cancel_invoice",
5452
+ "mercury_list_invoice_attachments",
5453
+ "mercury_get_attachment",
5454
+ "mercury_download_invoice_pdf",
5455
+ "mercury_list_treasury_accounts",
5456
+ "mercury_list_treasury_transactions",
5457
+ "mercury_list_treasury_statements",
5458
+ "mercury_list_events",
5459
+ "mercury_get_event",
5460
+ "mercury_list_send_money_requests",
5461
+ "mercury_get_send_money_request",
5462
+ "mercury_list_safe_requests",
5463
+ "mercury_get_safe_request",
5464
+ "mercury_download_safe_request_document",
5465
+ "mercury_list_webhooks",
5466
+ "mercury_get_webhook",
5467
+ "mercury_create_webhook",
5468
+ "mercury_update_webhook",
5469
+ "mercury_delete_webhook",
5470
+ "mercury_verify_webhook",
5471
+ "mercury_create_internal_transfer",
5472
+ "mercury_send_money",
5473
+ "mercury_request_send_money"
5474
+ ];
5475
+ function mercuryIntegration(options) {
5476
+ if (!options.apiKey) {
5477
+ throw new Error("mercuryIntegration requires an apiKey");
5478
+ }
5479
+ return {
5480
+ id: "mercury",
5481
+ name: "Mercury",
5482
+ tools: [...MERCURY_TOOLS],
5483
+ authType: "apiKey",
5484
+ getHeaders() {
5485
+ return {
5486
+ Authorization: `Bearer ${options.apiKey}`
5487
+ };
5179
5488
  }
5180
5489
  };
5181
5490
  }
@@ -5193,7 +5502,7 @@ function validateStepLimit(stepIndex, maxSteps) {
5193
5502
  return { valid: true };
5194
5503
  }
5195
5504
  // src/triggers/webhooks.ts
5196
- var logger34 = createLogger("Webhooks", "server");
5505
+ var logger35 = createLogger("Webhooks", "server");
5197
5506
  async function signPayload(payload, secret) {
5198
5507
  const encoder = new TextEncoder;
5199
5508
  const data = encoder.encode(JSON.stringify(payload));
@@ -5219,7 +5528,7 @@ async function deliverWebhook(webhook, payload, timeoutMs) {
5219
5528
  signal: controller.signal
5220
5529
  });
5221
5530
  if (!response.ok) {
5222
- logger34.warn(`Webhook delivery to ${webhook.url} returned ${response.status}`);
5531
+ logger35.warn(`Webhook delivery to ${webhook.url} returned ${response.status}`);
5223
5532
  }
5224
5533
  } finally {
5225
5534
  clearTimeout(timeout);
@@ -5232,7 +5541,7 @@ async function deliverWebhooks(webhooks, payload, timeoutMs) {
5232
5541
  for (let i = 0;i < results.length; i++) {
5233
5542
  const result = results[i];
5234
5543
  if (result.status === "rejected") {
5235
- logger34.warn(`Webhook delivery to ${webhooks[i].url} failed:`, result.reason);
5544
+ logger35.warn(`Webhook delivery to ${webhooks[i].url} failed:`, result.reason);
5236
5545
  }
5237
5546
  }
5238
5547
  }
@@ -5269,7 +5578,7 @@ function createSimpleIntegration(config) {
5269
5578
  };
5270
5579
  }
5271
5580
  // src/integrations/word.ts
5272
- var logger35 = createLogger("Word");
5581
+ var logger36 = createLogger("Word");
5273
5582
  var WORD_TOOLS = [
5274
5583
  "word_list",
5275
5584
  "word_get",
@@ -5295,16 +5604,16 @@ function wordIntegration(config = {}) {
5295
5604
  tools: [...WORD_TOOLS],
5296
5605
  oauth,
5297
5606
  async onInit(_client) {
5298
- logger35.debug("Word integration initialized");
5607
+ logger36.debug("Word integration initialized");
5299
5608
  },
5300
5609
  async onAfterConnect(_client) {
5301
- logger35.debug("Word integration connected");
5610
+ logger36.debug("Word integration connected");
5302
5611
  }
5303
5612
  };
5304
5613
  }
5305
5614
 
5306
5615
  // src/integrations/excel.ts
5307
- var logger36 = createLogger("Excel");
5616
+ var logger37 = createLogger("Excel");
5308
5617
  var EXCEL_TOOLS = [
5309
5618
  "excel_list",
5310
5619
  "excel_get",
@@ -5340,16 +5649,16 @@ function excelIntegration(config = {}) {
5340
5649
  tools: [...EXCEL_TOOLS],
5341
5650
  oauth,
5342
5651
  async onInit(_client) {
5343
- logger36.debug("Excel integration initialized");
5652
+ logger37.debug("Excel integration initialized");
5344
5653
  },
5345
5654
  async onAfterConnect(_client) {
5346
- logger36.debug("Excel integration connected");
5655
+ logger37.debug("Excel integration connected");
5347
5656
  }
5348
5657
  };
5349
5658
  }
5350
5659
 
5351
5660
  // src/integrations/powerpoint.ts
5352
- var logger37 = createLogger("PowerPoint");
5661
+ var logger38 = createLogger("PowerPoint");
5353
5662
  var POWERPOINT_TOOLS = [
5354
5663
  "powerpoint_list",
5355
5664
  "powerpoint_get",
@@ -5375,16 +5684,16 @@ function powerpointIntegration(config = {}) {
5375
5684
  tools: [...POWERPOINT_TOOLS],
5376
5685
  oauth,
5377
5686
  async onInit(_client) {
5378
- logger37.debug("PowerPoint integration initialized");
5687
+ logger38.debug("PowerPoint integration initialized");
5379
5688
  },
5380
5689
  async onAfterConnect(_client) {
5381
- logger37.debug("PowerPoint integration connected");
5690
+ logger38.debug("PowerPoint integration connected");
5382
5691
  }
5383
5692
  };
5384
5693
  }
5385
5694
 
5386
5695
  // src/integrations/gdrive.ts
5387
- var logger38 = createLogger("Google Drive");
5696
+ var logger39 = createLogger("Google Drive");
5388
5697
  var GDRIVE_TOOLS = [
5389
5698
  "gdrive_list_files",
5390
5699
  "gdrive_get_file",
@@ -5418,10 +5727,10 @@ function gdriveIntegration(config = {}) {
5418
5727
  tools: [...GDRIVE_TOOLS],
5419
5728
  oauth,
5420
5729
  async onInit(_client) {
5421
- logger38.debug("Google Drive integration initialized");
5730
+ logger39.debug("Google Drive integration initialized");
5422
5731
  },
5423
5732
  async onAfterConnect(_client) {
5424
- logger38.debug("Google Drive integration connected");
5733
+ logger39.debug("Google Drive integration connected");
5425
5734
  }
5426
5735
  };
5427
5736
  }
@@ -5480,6 +5789,7 @@ export {
5480
5789
  outlookIntegration,
5481
5790
  onedriveIntegration,
5482
5791
  notionIntegration,
5792
+ mercuryIntegration,
5483
5793
  linearIntegration,
5484
5794
  isTokenExpiredError,
5485
5795
  isAuthorizationError,
@@ -5488,6 +5798,7 @@ export {
5488
5798
  hubspotIntegration,
5489
5799
  gslidesIntegration,
5490
5800
  gsheetsIntegration,
5801
+ granolaIntegration,
5491
5802
  gmailIntegration,
5492
5803
  githubIntegration,
5493
5804
  genericOAuthIntegration,
@@ -5499,6 +5810,7 @@ export {
5499
5810
  gcalIntegration,
5500
5811
  fromNodeHeaders,
5501
5812
  figmaIntegration,
5813
+ dropboxIntegration,
5502
5814
  deliverWebhooks,
5503
5815
  cursorIntegration,
5504
5816
  createTanStackOAuthHandler,
@@ -5521,6 +5833,7 @@ export {
5521
5833
  MCPClientBase,
5522
5834
  MAX_TRIGGER_STEPS,
5523
5835
  IntegrateSDKError,
5836
+ INTEGRATION_CATEGORY_ORDER,
5524
5837
  HttpSessionTransport,
5525
5838
  ConnectionError,
5526
5839
  AuthorizationError,