integrate-sdk 0.6.3 → 0.6.4
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/README.md +5 -7
- package/dist/index.js +9 -8
- package/dist/server.js +9 -8
- package/dist/src/plugins/generic.d.ts +21 -8
- package/dist/src/plugins/generic.d.ts.map +1 -1
- package/dist/src/plugins/github.d.ts +26 -8
- package/dist/src/plugins/github.d.ts.map +1 -1
- package/dist/src/plugins/gmail.d.ts +26 -8
- package/dist/src/plugins/gmail.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ For production, use: `https://yourdomain.com/api/integrate/oauth/callback`
|
|
|
43
43
|
|
|
44
44
|
### 1. Create Server Config
|
|
45
45
|
|
|
46
|
-
Define your OAuth providers once:
|
|
46
|
+
Define your OAuth providers once. Plugins automatically read credentials from environment variables:
|
|
47
47
|
|
|
48
48
|
```typescript
|
|
49
49
|
// lib/integrate-server.ts (server-side only!)
|
|
@@ -53,16 +53,14 @@ import {
|
|
|
53
53
|
gmailPlugin,
|
|
54
54
|
} from "integrate-sdk/server";
|
|
55
55
|
|
|
56
|
+
// Plugins automatically use GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET,
|
|
57
|
+
// GMAIL_CLIENT_ID, GMAIL_CLIENT_SECRET from environment
|
|
56
58
|
export const { client: serverClient } = createMCPServer({
|
|
57
59
|
plugins: [
|
|
58
60
|
githubPlugin({
|
|
59
|
-
clientId: process.env.GITHUB_CLIENT_ID,
|
|
60
|
-
clientSecret: process.env.GITHUB_CLIENT_SECRET,
|
|
61
61
|
scopes: ["repo", "user"],
|
|
62
62
|
}),
|
|
63
63
|
gmailPlugin({
|
|
64
|
-
clientId: process.env.GMAIL_CLIENT_ID,
|
|
65
|
-
clientSecret: process.env.GMAIL_CLIENT_SECRET,
|
|
66
64
|
scopes: ["gmail.readonly"],
|
|
67
65
|
}),
|
|
68
66
|
],
|
|
@@ -152,6 +150,7 @@ The SDK automatically manages connections for you - no manual `connect()` or `di
|
|
|
152
150
|
|
|
153
151
|
```typescript
|
|
154
152
|
// ✅ Default behavior - automatic connection
|
|
153
|
+
// Plugins automatically use GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET from environment
|
|
155
154
|
const client = createMCPClient({
|
|
156
155
|
plugins: [
|
|
157
156
|
githubPlugin({
|
|
@@ -308,11 +307,10 @@ Use `genericOAuthPlugin` to configure any server-supported integration:
|
|
|
308
307
|
```typescript
|
|
309
308
|
import { genericOAuthPlugin } from "integrate-sdk/server";
|
|
310
309
|
|
|
310
|
+
// Automatically uses SLACK_CLIENT_ID and SLACK_CLIENT_SECRET from environment
|
|
311
311
|
const slackPlugin = genericOAuthPlugin({
|
|
312
312
|
id: "slack",
|
|
313
313
|
provider: "slack",
|
|
314
|
-
clientId: process.env.SLACK_CLIENT_ID,
|
|
315
|
-
clientSecret: process.env.SLACK_CLIENT_SECRET,
|
|
316
314
|
scopes: ["chat:write", "channels:read"],
|
|
317
315
|
tools: ["slack_send_message", "slack_list_channels"],
|
|
318
316
|
});
|
package/dist/index.js
CHANGED
|
@@ -1987,11 +1987,11 @@ var GITHUB_TOOLS = [
|
|
|
1987
1987
|
"github_list_commits",
|
|
1988
1988
|
"github_get_commit"
|
|
1989
1989
|
];
|
|
1990
|
-
function githubPlugin(config) {
|
|
1990
|
+
function githubPlugin(config = {}) {
|
|
1991
1991
|
const oauth = {
|
|
1992
1992
|
provider: "github",
|
|
1993
|
-
clientId: config.clientId,
|
|
1994
|
-
clientSecret: config.clientSecret,
|
|
1993
|
+
clientId: config.clientId ?? process.env.GITHUB_CLIENT_ID,
|
|
1994
|
+
clientSecret: config.clientSecret ?? process.env.GITHUB_CLIENT_SECRET,
|
|
1995
1995
|
scopes: config.scopes || ["repo", "user"],
|
|
1996
1996
|
redirectUri: config.redirectUri,
|
|
1997
1997
|
config: {
|
|
@@ -2018,11 +2018,11 @@ var GMAIL_TOOLS = [
|
|
|
2018
2018
|
"gmail_get_message",
|
|
2019
2019
|
"gmail_search_messages"
|
|
2020
2020
|
];
|
|
2021
|
-
function gmailPlugin(config) {
|
|
2021
|
+
function gmailPlugin(config = {}) {
|
|
2022
2022
|
const oauth = {
|
|
2023
2023
|
provider: "gmail",
|
|
2024
|
-
clientId: config.clientId,
|
|
2025
|
-
clientSecret: config.clientSecret,
|
|
2024
|
+
clientId: config.clientId ?? process.env.GMAIL_CLIENT_ID,
|
|
2025
|
+
clientSecret: config.clientSecret ?? process.env.GMAIL_CLIENT_SECRET,
|
|
2026
2026
|
scopes: config.scopes || [
|
|
2027
2027
|
"https://www.googleapis.com/auth/gmail.send",
|
|
2028
2028
|
"https://www.googleapis.com/auth/gmail.readonly",
|
|
@@ -2046,10 +2046,11 @@ function gmailPlugin(config) {
|
|
|
2046
2046
|
}
|
|
2047
2047
|
// src/plugins/generic.ts
|
|
2048
2048
|
function genericOAuthPlugin(config) {
|
|
2049
|
+
const providerUpper = config.provider.toUpperCase().replace(/[^A-Z0-9]/g, "_");
|
|
2049
2050
|
const oauth = {
|
|
2050
2051
|
provider: config.provider,
|
|
2051
|
-
clientId: config.clientId,
|
|
2052
|
-
clientSecret: config.clientSecret,
|
|
2052
|
+
clientId: config.clientId ?? process.env[`${providerUpper}_CLIENT_ID`],
|
|
2053
|
+
clientSecret: config.clientSecret ?? process.env[`${providerUpper}_CLIENT_SECRET`],
|
|
2053
2054
|
scopes: config.scopes,
|
|
2054
2055
|
redirectUri: config.redirectUri,
|
|
2055
2056
|
config
|
package/dist/server.js
CHANGED
|
@@ -1860,11 +1860,11 @@ var GITHUB_TOOLS = [
|
|
|
1860
1860
|
"github_list_commits",
|
|
1861
1861
|
"github_get_commit"
|
|
1862
1862
|
];
|
|
1863
|
-
function githubPlugin(config) {
|
|
1863
|
+
function githubPlugin(config = {}) {
|
|
1864
1864
|
const oauth = {
|
|
1865
1865
|
provider: "github",
|
|
1866
|
-
clientId: config.clientId,
|
|
1867
|
-
clientSecret: config.clientSecret,
|
|
1866
|
+
clientId: config.clientId ?? process.env.GITHUB_CLIENT_ID,
|
|
1867
|
+
clientSecret: config.clientSecret ?? process.env.GITHUB_CLIENT_SECRET,
|
|
1868
1868
|
scopes: config.scopes || ["repo", "user"],
|
|
1869
1869
|
redirectUri: config.redirectUri,
|
|
1870
1870
|
config: {
|
|
@@ -1891,11 +1891,11 @@ var GMAIL_TOOLS = [
|
|
|
1891
1891
|
"gmail_get_message",
|
|
1892
1892
|
"gmail_search_messages"
|
|
1893
1893
|
];
|
|
1894
|
-
function gmailPlugin(config) {
|
|
1894
|
+
function gmailPlugin(config = {}) {
|
|
1895
1895
|
const oauth = {
|
|
1896
1896
|
provider: "gmail",
|
|
1897
|
-
clientId: config.clientId,
|
|
1898
|
-
clientSecret: config.clientSecret,
|
|
1897
|
+
clientId: config.clientId ?? process.env.GMAIL_CLIENT_ID,
|
|
1898
|
+
clientSecret: config.clientSecret ?? process.env.GMAIL_CLIENT_SECRET,
|
|
1899
1899
|
scopes: config.scopes || [
|
|
1900
1900
|
"https://www.googleapis.com/auth/gmail.send",
|
|
1901
1901
|
"https://www.googleapis.com/auth/gmail.readonly",
|
|
@@ -1919,10 +1919,11 @@ function gmailPlugin(config) {
|
|
|
1919
1919
|
}
|
|
1920
1920
|
// src/plugins/generic.ts
|
|
1921
1921
|
function genericOAuthPlugin(config) {
|
|
1922
|
+
const providerUpper = config.provider.toUpperCase().replace(/[^A-Z0-9]/g, "_");
|
|
1922
1923
|
const oauth = {
|
|
1923
1924
|
provider: config.provider,
|
|
1924
|
-
clientId: config.clientId,
|
|
1925
|
-
clientSecret: config.clientSecret,
|
|
1925
|
+
clientId: config.clientId ?? process.env[`${providerUpper}_CLIENT_ID`],
|
|
1926
|
+
clientSecret: config.clientSecret ?? process.env[`${providerUpper}_CLIENT_SECRET`],
|
|
1926
1927
|
scopes: config.scopes,
|
|
1927
1928
|
redirectUri: config.redirectUri,
|
|
1928
1929
|
config
|
|
@@ -11,10 +11,10 @@ export interface GenericOAuthPluginConfig {
|
|
|
11
11
|
id: string;
|
|
12
12
|
/** OAuth provider name */
|
|
13
13
|
provider: string;
|
|
14
|
-
/** OAuth client ID */
|
|
15
|
-
clientId
|
|
16
|
-
/** OAuth client secret */
|
|
17
|
-
clientSecret
|
|
14
|
+
/** OAuth client ID (defaults to {PROVIDER}_CLIENT_ID env var) */
|
|
15
|
+
clientId?: string;
|
|
16
|
+
/** OAuth client secret (defaults to {PROVIDER}_CLIENT_SECRET env var) */
|
|
17
|
+
clientSecret?: string;
|
|
18
18
|
/** OAuth scopes */
|
|
19
19
|
scopes: string[];
|
|
20
20
|
/** Tool names to enable from the server (must exist on the server) */
|
|
@@ -37,14 +37,15 @@ export interface GenericOAuthPluginConfig {
|
|
|
37
37
|
* Note: This does NOT create new tools - it only configures access to existing server-side tools.
|
|
38
38
|
* All tools must be implemented on the server and exposed via the MCP protocol.
|
|
39
39
|
*
|
|
40
|
-
*
|
|
40
|
+
* By default, reads {PROVIDER}_CLIENT_ID and {PROVIDER}_CLIENT_SECRET from environment variables
|
|
41
|
+
* (e.g., SLACK_CLIENT_ID, SLACK_CLIENT_SECRET). You can override these by providing explicit values.
|
|
42
|
+
*
|
|
43
|
+
* @example Minimal (uses env vars):
|
|
41
44
|
* ```typescript
|
|
42
|
-
* //
|
|
45
|
+
* // Automatically uses SLACK_CLIENT_ID and SLACK_CLIENT_SECRET from env
|
|
43
46
|
* const slackPlugin = genericOAuthPlugin({
|
|
44
47
|
* id: 'slack',
|
|
45
48
|
* provider: 'slack',
|
|
46
|
-
* clientId: process.env.SLACK_CLIENT_ID!,
|
|
47
|
-
* clientSecret: process.env.SLACK_CLIENT_SECRET!,
|
|
48
49
|
* scopes: ['chat:write', 'channels:read'],
|
|
49
50
|
* tools: [
|
|
50
51
|
* 'slack_send_message', // Must exist on server
|
|
@@ -60,6 +61,18 @@ export interface GenericOAuthPluginConfig {
|
|
|
60
61
|
* // Call server tools using _callToolByName
|
|
61
62
|
* await client._callToolByName('slack_send_message', { channel: '#general', text: 'Hello' });
|
|
62
63
|
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example With explicit override:
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const slackPlugin = genericOAuthPlugin({
|
|
68
|
+
* id: 'slack',
|
|
69
|
+
* provider: 'slack',
|
|
70
|
+
* clientId: process.env.CUSTOM_SLACK_ID!,
|
|
71
|
+
* clientSecret: process.env.CUSTOM_SLACK_SECRET!,
|
|
72
|
+
* scopes: ['chat:write', 'channels:read'],
|
|
73
|
+
* tools: ['slack_send_message', 'slack_list_channels'],
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
63
76
|
*/
|
|
64
77
|
export declare function genericOAuthPlugin(config: GenericOAuthPluginConfig): MCPPlugin;
|
|
65
78
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/plugins/generic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/plugins/generic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,sEAAsE;IACtE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,uCAAuC;IACvC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/C,sCAAsC;IACtC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvD,mCAAmC;IACnC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,wBAAwB,GAC/B,SAAS,CAqBX;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/C,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvD,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACtD,GAAG,SAAS,CAQZ"}
|
|
@@ -6,13 +6,14 @@ import type { MCPPlugin } from "./types.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* GitHub plugin configuration
|
|
8
8
|
*
|
|
9
|
-
* SERVER-SIDE:
|
|
9
|
+
* SERVER-SIDE: Automatically reads GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET from environment.
|
|
10
|
+
* You can override by providing explicit clientId and clientSecret values.
|
|
10
11
|
* CLIENT-SIDE: Omit clientId and clientSecret when using createMCPClient()
|
|
11
12
|
*/
|
|
12
13
|
export interface GitHubPluginConfig {
|
|
13
|
-
/** GitHub OAuth client ID (
|
|
14
|
+
/** GitHub OAuth client ID (defaults to GITHUB_CLIENT_ID env var) */
|
|
14
15
|
clientId?: string;
|
|
15
|
-
/** GitHub OAuth client secret (
|
|
16
|
+
/** GitHub OAuth client secret (defaults to GITHUB_CLIENT_SECRET env var) */
|
|
16
17
|
clientSecret?: string;
|
|
17
18
|
/** Additional OAuth scopes (default: ['repo', 'user']) */
|
|
18
19
|
scopes?: string[];
|
|
@@ -29,17 +30,34 @@ declare const GITHUB_TOOLS: readonly ["github_create_issue", "github_list_issues
|
|
|
29
30
|
/**
|
|
30
31
|
* GitHub Plugin
|
|
31
32
|
*
|
|
32
|
-
* Enables GitHub integration with OAuth authentication
|
|
33
|
+
* Enables GitHub integration with OAuth authentication.
|
|
33
34
|
*
|
|
34
|
-
*
|
|
35
|
+
* By default, reads GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET from environment variables.
|
|
36
|
+
* You can override these by providing explicit values in the config.
|
|
37
|
+
*
|
|
38
|
+
* @example Server-side (minimal - uses env vars):
|
|
39
|
+
* ```typescript
|
|
40
|
+
* import { createMCPServer, githubPlugin } from 'integrate-sdk/server';
|
|
41
|
+
*
|
|
42
|
+
* // Automatically uses GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET from env
|
|
43
|
+
* export const { client } = createMCPServer({
|
|
44
|
+
* plugins: [
|
|
45
|
+
* githubPlugin({
|
|
46
|
+
* scopes: ['repo', 'user', 'read:org'],
|
|
47
|
+
* }),
|
|
48
|
+
* ],
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example Server-side (with explicit override):
|
|
35
53
|
* ```typescript
|
|
36
54
|
* import { createMCPServer, githubPlugin } from 'integrate-sdk/server';
|
|
37
55
|
*
|
|
38
56
|
* export const { client } = createMCPServer({
|
|
39
57
|
* plugins: [
|
|
40
58
|
* githubPlugin({
|
|
41
|
-
* clientId: process.env.
|
|
42
|
-
* clientSecret: process.env.
|
|
59
|
+
* clientId: process.env.CUSTOM_GITHUB_ID!,
|
|
60
|
+
* clientSecret: process.env.CUSTOM_GITHUB_SECRET!,
|
|
43
61
|
* scopes: ['repo', 'user', 'read:org'],
|
|
44
62
|
* }),
|
|
45
63
|
* ],
|
|
@@ -59,7 +77,7 @@ declare const GITHUB_TOOLS: readonly ["github_create_issue", "github_list_issues
|
|
|
59
77
|
* });
|
|
60
78
|
* ```
|
|
61
79
|
*/
|
|
62
|
-
export declare function githubPlugin(config
|
|
80
|
+
export declare function githubPlugin(config?: GitHubPluginConfig): MCPPlugin;
|
|
63
81
|
/**
|
|
64
82
|
* Export tool names for type inference
|
|
65
83
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../src/plugins/github.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../src/plugins/github.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,QAAA,MAAM,YAAY,kbAmBR,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,YAAY,CAAC,MAAM,GAAE,kBAAuB,GAAG,SAAS,CA0BvE;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAEtD;;GAEG;AACH,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -6,13 +6,14 @@ import type { MCPPlugin } from "./types.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* Gmail plugin configuration
|
|
8
8
|
*
|
|
9
|
-
* SERVER-SIDE:
|
|
9
|
+
* SERVER-SIDE: Automatically reads GMAIL_CLIENT_ID and GMAIL_CLIENT_SECRET from environment.
|
|
10
|
+
* You can override by providing explicit clientId and clientSecret values.
|
|
10
11
|
* CLIENT-SIDE: Omit clientId and clientSecret when using createMCPClient()
|
|
11
12
|
*/
|
|
12
13
|
export interface GmailPluginConfig {
|
|
13
|
-
/** Google OAuth client ID (
|
|
14
|
+
/** Google OAuth client ID (defaults to GMAIL_CLIENT_ID env var) */
|
|
14
15
|
clientId?: string;
|
|
15
|
-
/** Google OAuth client secret (
|
|
16
|
+
/** Google OAuth client secret (defaults to GMAIL_CLIENT_SECRET env var) */
|
|
16
17
|
clientSecret?: string;
|
|
17
18
|
/** Additional OAuth scopes (default: Gmail API scopes) */
|
|
18
19
|
scopes?: string[];
|
|
@@ -27,17 +28,34 @@ declare const GMAIL_TOOLS: readonly ["gmail_send_message", "gmail_list_messages"
|
|
|
27
28
|
/**
|
|
28
29
|
* Gmail Plugin
|
|
29
30
|
*
|
|
30
|
-
* Enables Gmail integration with OAuth authentication
|
|
31
|
+
* Enables Gmail integration with OAuth authentication.
|
|
31
32
|
*
|
|
32
|
-
*
|
|
33
|
+
* By default, reads GMAIL_CLIENT_ID and GMAIL_CLIENT_SECRET from environment variables.
|
|
34
|
+
* You can override these by providing explicit values in the config.
|
|
35
|
+
*
|
|
36
|
+
* @example Server-side (minimal - uses env vars):
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import { createMCPServer, gmailPlugin } from 'integrate-sdk/server';
|
|
39
|
+
*
|
|
40
|
+
* // Automatically uses GMAIL_CLIENT_ID and GMAIL_CLIENT_SECRET from env
|
|
41
|
+
* export const { client } = createMCPServer({
|
|
42
|
+
* plugins: [
|
|
43
|
+
* gmailPlugin({
|
|
44
|
+
* scopes: ['gmail.send', 'gmail.readonly'],
|
|
45
|
+
* }),
|
|
46
|
+
* ],
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @example Server-side (with explicit override):
|
|
33
51
|
* ```typescript
|
|
34
52
|
* import { createMCPServer, gmailPlugin } from 'integrate-sdk/server';
|
|
35
53
|
*
|
|
36
54
|
* export const { client } = createMCPServer({
|
|
37
55
|
* plugins: [
|
|
38
56
|
* gmailPlugin({
|
|
39
|
-
* clientId: process.env.
|
|
40
|
-
* clientSecret: process.env.
|
|
57
|
+
* clientId: process.env.CUSTOM_GMAIL_ID!,
|
|
58
|
+
* clientSecret: process.env.CUSTOM_GMAIL_SECRET!,
|
|
41
59
|
* scopes: ['gmail.send', 'gmail.readonly'],
|
|
42
60
|
* }),
|
|
43
61
|
* ],
|
|
@@ -57,7 +75,7 @@ declare const GMAIL_TOOLS: readonly ["gmail_send_message", "gmail_list_messages"
|
|
|
57
75
|
* });
|
|
58
76
|
* ```
|
|
59
77
|
*/
|
|
60
|
-
export declare function gmailPlugin(config
|
|
78
|
+
export declare function gmailPlugin(config?: GmailPluginConfig): MCPPlugin;
|
|
61
79
|
/**
|
|
62
80
|
* Export tool names for type inference
|
|
63
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../../src/plugins/gmail.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../../src/plugins/gmail.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,QAAA,MAAM,WAAW,sGAKP,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAE,iBAAsB,GAAG,SAAS,CA4BrE;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAEpD;;GAEG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|