integrate-sdk 0.1.1 → 0.1.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/README.md +85 -69
- package/dist/client.d.ts +3 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/config/types.d.ts +0 -2
- package/dist/config/types.d.ts.map +1 -1
- package/dist/index.js +37 -34
- package/dist/plugins/generic.d.ts +1 -1
- package/dist/plugins/generic.d.ts.map +1 -1
- package/dist/plugins/github.d.ts +2 -2
- package/dist/plugins/github.d.ts.map +1 -1
- package/dist/plugins/gmail.d.ts +2 -2
- package/dist/plugins/gmail.d.ts.map +1 -1
- package/dist/plugins/types.d.ts +4 -4
- package/dist/plugins/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,19 +1,50 @@
|
|
|
1
1
|
# Integrate SDK
|
|
2
2
|
|
|
3
|
-
A type-safe TypeScript SDK for
|
|
3
|
+
A type-safe TypeScript SDK for connecting to the Integrate MCP (Model Context Protocol) server. Access GitHub, Gmail, Notion, and other integrations through a simple, plugin-based API.
|
|
4
|
+
|
|
5
|
+
**Server:** `https://mcp.integrate.dev/api/v1/mcp`
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [What is this SDK?](#what-is-this-sdk)
|
|
10
|
+
- [Features](#features)
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Quick Start](#quick-start)
|
|
13
|
+
- [Built-in Plugins](#built-in-plugins)
|
|
14
|
+
- [GitHub Plugin](#github-plugin)
|
|
15
|
+
- [Gmail Plugin](#gmail-plugin)
|
|
16
|
+
- [Creating Custom Plugins](#creating-custom-plugins)
|
|
17
|
+
- [Advanced Usage](#advanced-usage)
|
|
18
|
+
- [API Reference](#api-reference)
|
|
19
|
+
- [Architecture](#architecture)
|
|
20
|
+
- [How It Works](#how-it-works)
|
|
21
|
+
|
|
22
|
+
## What is this SDK?
|
|
23
|
+
|
|
24
|
+
This SDK is a **client library** that connects to the Integrate MCP server to access various third-party integrations.
|
|
25
|
+
|
|
26
|
+
**Key concepts:**
|
|
27
|
+
1. **Connect to the Integrate MCP server** - The SDK connects to `https://mcp.integrate.dev/api/v1/mcp`
|
|
28
|
+
2. **Configure OAuth credentials** - You provide your own OAuth app credentials for each integration (GitHub, Gmail, etc.)
|
|
29
|
+
3. **Call tools** - Execute actions like creating GitHub issues, sending emails, searching Notion pages
|
|
30
|
+
4. **OAuth flow happens server-side** - The SDK sends your OAuth config to the server, which handles the actual authentication flow
|
|
31
|
+
|
|
32
|
+
**Important:** You need to create your own OAuth apps (e.g., GitHub OAuth app, Google OAuth app) and provide the credentials to the SDK. The SDK does not provide OAuth credentials.
|
|
4
33
|
|
|
5
34
|
## Features
|
|
6
35
|
|
|
7
|
-
- 🔌 **Plugin-Based Architecture** - Enable only the
|
|
8
|
-
- 🔒 **Type-Safe
|
|
9
|
-
- 🌊 **
|
|
10
|
-
- 🔐 **OAuth
|
|
11
|
-
- 🛠️ **Extensible** -
|
|
12
|
-
- 📦 **Zero Dependencies** - Lightweight
|
|
36
|
+
- 🔌 **Plugin-Based Architecture** - Enable only the integrations you need
|
|
37
|
+
- 🔒 **Type-Safe** - Full TypeScript support with IntelliSense
|
|
38
|
+
- 🌊 **Real-time Communication** - HTTP streaming with NDJSON
|
|
39
|
+
- 🔐 **OAuth Ready** - Configure OAuth credentials for each provider
|
|
40
|
+
- 🛠️ **Extensible** - Create custom plugins for new integrations
|
|
41
|
+
- 📦 **Zero Dependencies** - Lightweight implementation
|
|
13
42
|
|
|
14
43
|
## Installation
|
|
15
44
|
|
|
16
45
|
```bash
|
|
46
|
+
npm install integrate-sdk
|
|
47
|
+
# or
|
|
17
48
|
bun add integrate-sdk
|
|
18
49
|
```
|
|
19
50
|
|
|
@@ -24,7 +55,6 @@ import { createMCPClient, githubPlugin, gmailPlugin } from 'integrate-sdk';
|
|
|
24
55
|
|
|
25
56
|
// Create a client with plugins
|
|
26
57
|
const client = createMCPClient({
|
|
27
|
-
serverUrl: 'http://localhost:3000/mcp',
|
|
28
58
|
plugins: [
|
|
29
59
|
githubPlugin({
|
|
30
60
|
clientId: process.env.GITHUB_CLIENT_ID!,
|
|
@@ -42,7 +72,7 @@ const client = createMCPClient({
|
|
|
42
72
|
await client.connect();
|
|
43
73
|
|
|
44
74
|
// Call tools
|
|
45
|
-
const result = await client.callTool('
|
|
75
|
+
const result = await client.callTool('github_create_issue', {
|
|
46
76
|
repo: 'owner/repo',
|
|
47
77
|
title: 'Bug report',
|
|
48
78
|
body: 'Description of the bug',
|
|
@@ -62,7 +92,6 @@ await client.disconnect();
|
|
|
62
92
|
import { createMCPClient, githubPlugin } from 'integrate-sdk';
|
|
63
93
|
|
|
64
94
|
const client = createMCPClient({
|
|
65
|
-
serverUrl: 'http://localhost:3000/mcp',
|
|
66
95
|
plugins: [
|
|
67
96
|
githubPlugin({
|
|
68
97
|
clientId: process.env.GITHUB_CLIENT_ID!,
|
|
@@ -75,18 +104,19 @@ const client = createMCPClient({
|
|
|
75
104
|
```
|
|
76
105
|
|
|
77
106
|
**Available Tools:**
|
|
78
|
-
- `
|
|
79
|
-
- `
|
|
80
|
-
- `
|
|
81
|
-
- `
|
|
82
|
-
- `
|
|
83
|
-
- `
|
|
84
|
-
- `
|
|
85
|
-
- `
|
|
86
|
-
- `
|
|
87
|
-
- `
|
|
88
|
-
- `
|
|
89
|
-
- `
|
|
107
|
+
- `github_create_issue`
|
|
108
|
+
- `github_list_issues`
|
|
109
|
+
- `github_get_issue`
|
|
110
|
+
- `github_update_issue`
|
|
111
|
+
- `github_close_issue`
|
|
112
|
+
- `github_create_pull_request`
|
|
113
|
+
- `github_list_pull_requests`
|
|
114
|
+
- `github_get_pull_request`
|
|
115
|
+
- `github_merge_pull_request`
|
|
116
|
+
- `github_list_repos`
|
|
117
|
+
- `github_list_own_repos`
|
|
118
|
+
- `github_get_repo`
|
|
119
|
+
- `github_create_repo`
|
|
90
120
|
- And more...
|
|
91
121
|
|
|
92
122
|
### Gmail Plugin
|
|
@@ -95,7 +125,6 @@ const client = createMCPClient({
|
|
|
95
125
|
import { createMCPClient, gmailPlugin } from 'integrate-sdk';
|
|
96
126
|
|
|
97
127
|
const client = createMCPClient({
|
|
98
|
-
serverUrl: 'http://localhost:3000/mcp',
|
|
99
128
|
plugins: [
|
|
100
129
|
gmailPlugin({
|
|
101
130
|
clientId: process.env.GMAIL_CLIENT_ID!,
|
|
@@ -110,15 +139,15 @@ const client = createMCPClient({
|
|
|
110
139
|
```
|
|
111
140
|
|
|
112
141
|
**Available Tools:**
|
|
113
|
-
- `
|
|
114
|
-
- `
|
|
115
|
-
- `
|
|
116
|
-
- `
|
|
117
|
-
- `
|
|
118
|
-
- `
|
|
119
|
-
- `
|
|
120
|
-
- `
|
|
121
|
-
- `
|
|
142
|
+
- `gmail_send_email`
|
|
143
|
+
- `gmail_list_emails`
|
|
144
|
+
- `gmail_get_email`
|
|
145
|
+
- `gmail_delete_email`
|
|
146
|
+
- `gmail_search_emails`
|
|
147
|
+
- `gmail_mark_as_read`
|
|
148
|
+
- `gmail_mark_as_unread`
|
|
149
|
+
- `gmail_list_labels`
|
|
150
|
+
- `gmail_create_label`
|
|
122
151
|
- And more...
|
|
123
152
|
|
|
124
153
|
## Creating Custom Plugins
|
|
@@ -135,16 +164,15 @@ const slackPlugin = genericOAuthPlugin({
|
|
|
135
164
|
clientSecret: process.env.SLACK_CLIENT_SECRET!,
|
|
136
165
|
scopes: ['chat:write', 'channels:read', 'users:read'],
|
|
137
166
|
tools: [
|
|
138
|
-
'
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
'
|
|
167
|
+
'slack_send_message',
|
|
168
|
+
'slack_list_channels',
|
|
169
|
+
'slack_get_channel',
|
|
170
|
+
'slack_invite_user',
|
|
142
171
|
],
|
|
143
|
-
redirectUri: '
|
|
172
|
+
redirectUri: 'https://your-app.com/callback',
|
|
144
173
|
});
|
|
145
174
|
|
|
146
175
|
const client = createMCPClient({
|
|
147
|
-
serverUrl: 'http://localhost:3000/mcp',
|
|
148
176
|
plugins: [slackPlugin],
|
|
149
177
|
});
|
|
150
178
|
```
|
|
@@ -158,7 +186,7 @@ import { createSimplePlugin } from 'integrate-sdk';
|
|
|
158
186
|
|
|
159
187
|
const mathPlugin = createSimplePlugin({
|
|
160
188
|
id: 'math',
|
|
161
|
-
tools: ['
|
|
189
|
+
tools: ['math_add', 'math_subtract', 'math_multiply', 'math_divide'],
|
|
162
190
|
onInit: async (client) => {
|
|
163
191
|
console.log('Math plugin initialized');
|
|
164
192
|
},
|
|
@@ -173,7 +201,7 @@ import type { MCPPlugin } from 'integrate-sdk';
|
|
|
173
201
|
export function customPlugin(config: CustomConfig): MCPPlugin {
|
|
174
202
|
return {
|
|
175
203
|
id: 'custom',
|
|
176
|
-
tools: ['
|
|
204
|
+
tools: ['custom_tool1', 'custom_tool2'],
|
|
177
205
|
oauth: {
|
|
178
206
|
provider: 'custom-provider',
|
|
179
207
|
clientId: config.clientId,
|
|
@@ -231,7 +259,7 @@ const allTools = client.getAvailableTools();
|
|
|
231
259
|
console.log('All tools:', allTools.map(t => t.name));
|
|
232
260
|
|
|
233
261
|
// Get a specific tool
|
|
234
|
-
const tool = client.getTool('
|
|
262
|
+
const tool = client.getTool('github_create_issue');
|
|
235
263
|
console.log('Tool schema:', tool?.inputSchema);
|
|
236
264
|
```
|
|
237
265
|
|
|
@@ -252,7 +280,7 @@ unsubscribe();
|
|
|
252
280
|
```typescript
|
|
253
281
|
try {
|
|
254
282
|
await client.connect();
|
|
255
|
-
const result = await client.callTool('
|
|
283
|
+
const result = await client.callTool('github_create_issue', {
|
|
256
284
|
repo: 'owner/repo',
|
|
257
285
|
title: 'Bug report',
|
|
258
286
|
});
|
|
@@ -271,7 +299,6 @@ try {
|
|
|
271
299
|
|
|
272
300
|
```typescript
|
|
273
301
|
const client = createMCPClient({
|
|
274
|
-
serverUrl: 'http://localhost:3000/mcp',
|
|
275
302
|
plugins: [/* ... */],
|
|
276
303
|
|
|
277
304
|
// Custom headers
|
|
@@ -298,7 +325,6 @@ const client = createMCPClient({
|
|
|
298
325
|
Creates a new MCP client instance.
|
|
299
326
|
|
|
300
327
|
**Parameters:**
|
|
301
|
-
- `config.serverUrl` (string): URL of the MCP server
|
|
302
328
|
- `config.plugins` (MCPPlugin[]): Array of plugins to enable
|
|
303
329
|
- `config.headers` (object, optional): Custom HTTP headers
|
|
304
330
|
- `config.timeout` (number, optional): Request timeout in milliseconds
|
|
@@ -350,29 +376,21 @@ The SDK uses HTTP streaming with newline-delimited JSON (NDJSON) for bidirection
|
|
|
350
376
|
- Automatic heartbeat to keep connection alive
|
|
351
377
|
- Compatible with MCP's `StreamableHTTPServer`
|
|
352
378
|
|
|
353
|
-
##
|
|
379
|
+
## How It Works
|
|
354
380
|
|
|
355
|
-
|
|
381
|
+
1. **Client Configuration**: You configure the SDK with plugins for the integrations you want to use (GitHub, Gmail, etc.)
|
|
382
|
+
2. **Connection**: The SDK connects to `https://mcp.integrate.dev/api/v1/mcp` using HTTP streaming (NDJSON)
|
|
383
|
+
3. **Tool Discovery**: The SDK fetches available tools from the server and filters them based on your enabled plugins
|
|
384
|
+
4. **OAuth Configuration**: Your OAuth credentials are stored in the client configuration (not sent to the server yet)
|
|
385
|
+
5. **Tool Calls**: When you call a tool, the SDK sends a JSON-RPC request to the server
|
|
386
|
+
6. **OAuth Flow**: The server uses your OAuth configuration to authenticate and execute the tool
|
|
356
387
|
|
|
357
|
-
|
|
358
|
-
- Accepts HTTP POST with streaming request body (NDJSON format)
|
|
359
|
-
- Returns streaming response body (NDJSON format)
|
|
360
|
-
- Supports bidirectional communication over a single persistent connection
|
|
361
|
-
- Messages are newline-delimited JSON (one JSON object per line)
|
|
388
|
+
## Server Information
|
|
362
389
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
**Example Go server setup:**
|
|
369
|
-
```go
|
|
370
|
-
httpServer := server.NewStreamableHTTPServer(s,
|
|
371
|
-
server.WithEndpointPath("/api/v1/mcp"),
|
|
372
|
-
server.WithHeartbeatInterval(30*time.Second),
|
|
373
|
-
server.WithStateLess(false),
|
|
374
|
-
)
|
|
375
|
-
```
|
|
390
|
+
**Endpoint:** `https://mcp.integrate.dev/api/v1/mcp`
|
|
391
|
+
**Protocol:** MCP (Model Context Protocol) over HTTP streaming
|
|
392
|
+
**Format:** Newline-delimited JSON (NDJSON)
|
|
393
|
+
**Methods:** `initialize`, `tools/list`, `tools/call`
|
|
376
394
|
|
|
377
395
|
## TypeScript Support
|
|
378
396
|
|
|
@@ -383,7 +401,6 @@ import { createMCPClient, githubPlugin } from 'integrate-sdk';
|
|
|
383
401
|
import type { MCPToolCallResponse } from 'integrate-sdk';
|
|
384
402
|
|
|
385
403
|
const client = createMCPClient({
|
|
386
|
-
serverUrl: 'http://localhost:3000/mcp',
|
|
387
404
|
plugins: [
|
|
388
405
|
githubPlugin({
|
|
389
406
|
clientId: process.env.GITHUB_CLIENT_ID!,
|
|
@@ -394,15 +411,15 @@ const client = createMCPClient({
|
|
|
394
411
|
|
|
395
412
|
// Full type inference and IntelliSense support
|
|
396
413
|
await client.connect();
|
|
397
|
-
const result: MCPToolCallResponse = await client.callTool('
|
|
414
|
+
const result: MCPToolCallResponse = await client.callTool('github_create_issue', {
|
|
398
415
|
repo: 'owner/repo',
|
|
399
416
|
title: 'Bug report',
|
|
400
417
|
});
|
|
401
418
|
```
|
|
402
419
|
|
|
403
|
-
|
|
420
|
+
## Contributing
|
|
404
421
|
|
|
405
|
-
|
|
422
|
+
Contributions are welcome! Please see the tests in the `tests/` directory for examples of how to test new features.
|
|
406
423
|
|
|
407
424
|
## Test Structure
|
|
408
425
|
|
|
@@ -554,7 +571,6 @@ describe("Integration Test", () => {
|
|
|
554
571
|
|
|
555
572
|
test("connects and calls tool", async () => {
|
|
556
573
|
const client = createMCPClient({
|
|
557
|
-
serverUrl: server.getUrl(),
|
|
558
574
|
plugins: [/* ... */],
|
|
559
575
|
});
|
|
560
576
|
|
package/dist/client.d.ts
CHANGED
|
@@ -87,10 +87,11 @@ export declare class MCPClient<TPlugins extends readonly MCPPlugin[] = readonly
|
|
|
87
87
|
/**
|
|
88
88
|
* Create a new MCP Client instance
|
|
89
89
|
*
|
|
90
|
+
* Connects to the Integrate MCP server at https://mcp.integrate.dev/api/v1/mcp
|
|
91
|
+
*
|
|
90
92
|
* @example
|
|
91
93
|
* ```typescript
|
|
92
94
|
* const client = createMCPClient({
|
|
93
|
-
* serverUrl: 'http://localhost:3000/mcp',
|
|
94
95
|
* plugins: [
|
|
95
96
|
* githubPlugin({ clientId: '...', clientSecret: '...' }),
|
|
96
97
|
* gmailPlugin({ clientId: '...', clientSecret: '...' }),
|
|
@@ -98,7 +99,7 @@ export declare class MCPClient<TPlugins extends readonly MCPPlugin[] = readonly
|
|
|
98
99
|
* });
|
|
99
100
|
*
|
|
100
101
|
* await client.connect();
|
|
101
|
-
* const result = await client.callTool('
|
|
102
|
+
* const result = await client.callTool('github_create_issue', {
|
|
102
103
|
* repo: 'owner/repo',
|
|
103
104
|
* title: 'Bug report',
|
|
104
105
|
* });
|
package/dist/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,EAIpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,OAAO,EAEP,mBAAmB,EAIpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAA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AAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAClC,MAAM,IAAI;IAIb;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAYjC;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,aAAa,IAAI,OAAO;CAGzB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EACnE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,GAChC,SAAS,CAAC,QAAQ,CAAC,CAErB"}
|
package/dist/config/types.d.ts
CHANGED
|
@@ -7,8 +7,6 @@ import type { MCPPlugin } from "../plugins/types.js";
|
|
|
7
7
|
* Main client configuration
|
|
8
8
|
*/
|
|
9
9
|
export interface MCPClientConfig<TPlugins extends readonly MCPPlugin[]> {
|
|
10
|
-
/** URL of the MCP server */
|
|
11
|
-
serverUrl: string;
|
|
12
10
|
/** Array of plugins to enable */
|
|
13
11
|
plugins: TPlugins;
|
|
14
12
|
/** Optional HTTP headers to include in requests */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE;IACpE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE;IACpE,iCAAiC;IACjC,OAAO,EAAE,QAAQ,CAAC;IAElB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,yBAAyB;IACzB,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,IACjE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,IAAI;KACnE,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;CAC/C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -184,6 +184,8 @@ var MCPMethod;
|
|
|
184
184
|
})(MCPMethod ||= {});
|
|
185
185
|
|
|
186
186
|
// src/client.ts
|
|
187
|
+
var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp";
|
|
188
|
+
|
|
187
189
|
class MCPClient {
|
|
188
190
|
transport;
|
|
189
191
|
plugins;
|
|
@@ -193,7 +195,7 @@ class MCPClient {
|
|
|
193
195
|
clientInfo;
|
|
194
196
|
constructor(config) {
|
|
195
197
|
this.transport = new HttpSessionTransport({
|
|
196
|
-
url:
|
|
198
|
+
url: MCP_SERVER_URL,
|
|
197
199
|
headers: config.headers,
|
|
198
200
|
timeout: config.timeout
|
|
199
201
|
});
|
|
@@ -313,23 +315,24 @@ function createMCPClient(config) {
|
|
|
313
315
|
}
|
|
314
316
|
// src/plugins/github.ts
|
|
315
317
|
var GITHUB_TOOLS = [
|
|
316
|
-
"
|
|
317
|
-
"
|
|
318
|
-
"
|
|
319
|
-
"
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
"
|
|
324
|
-
"
|
|
325
|
-
"
|
|
326
|
-
"
|
|
327
|
-
"
|
|
328
|
-
"
|
|
329
|
-
"
|
|
330
|
-
"
|
|
331
|
-
"
|
|
332
|
-
"
|
|
318
|
+
"github_create_issue",
|
|
319
|
+
"github_list_issues",
|
|
320
|
+
"github_get_issue",
|
|
321
|
+
"github_update_issue",
|
|
322
|
+
"github_close_issue",
|
|
323
|
+
"github_create_pull_request",
|
|
324
|
+
"github_list_pull_requests",
|
|
325
|
+
"github_get_pull_request",
|
|
326
|
+
"github_merge_pull_request",
|
|
327
|
+
"github_list_repos",
|
|
328
|
+
"github_list_own_repos",
|
|
329
|
+
"github_get_repo",
|
|
330
|
+
"github_create_repo",
|
|
331
|
+
"github_list_branches",
|
|
332
|
+
"github_create_branch",
|
|
333
|
+
"github_get_user",
|
|
334
|
+
"github_list_commits",
|
|
335
|
+
"github_get_commit"
|
|
333
336
|
];
|
|
334
337
|
function githubPlugin(config) {
|
|
335
338
|
const oauth = {
|
|
@@ -357,22 +360,22 @@ function githubPlugin(config) {
|
|
|
357
360
|
}
|
|
358
361
|
// src/plugins/gmail.ts
|
|
359
362
|
var GMAIL_TOOLS = [
|
|
360
|
-
"
|
|
361
|
-
"
|
|
362
|
-
"
|
|
363
|
-
"
|
|
364
|
-
"
|
|
365
|
-
"
|
|
366
|
-
"
|
|
367
|
-
"
|
|
368
|
-
"
|
|
369
|
-
"
|
|
370
|
-
"
|
|
371
|
-
"
|
|
372
|
-
"
|
|
373
|
-
"
|
|
374
|
-
"
|
|
375
|
-
"
|
|
363
|
+
"gmail_send_email",
|
|
364
|
+
"gmail_list_emails",
|
|
365
|
+
"gmail_get_email",
|
|
366
|
+
"gmail_delete_email",
|
|
367
|
+
"gmail_search_emails",
|
|
368
|
+
"gmail_mark_as_read",
|
|
369
|
+
"gmail_mark_as_unread",
|
|
370
|
+
"gmail_add_label",
|
|
371
|
+
"gmail_remove_label",
|
|
372
|
+
"gmail_list_labels",
|
|
373
|
+
"gmail_create_label",
|
|
374
|
+
"gmail_get_draft",
|
|
375
|
+
"gmail_create_draft",
|
|
376
|
+
"gmail_update_draft",
|
|
377
|
+
"gmail_delete_draft",
|
|
378
|
+
"gmail_send_draft"
|
|
376
379
|
];
|
|
377
380
|
function gmailPlugin(config) {
|
|
378
381
|
const oauth = {
|
|
@@ -56,7 +56,7 @@ export interface GenericOAuthPluginConfig {
|
|
|
56
56
|
* });
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
|
-
export declare function genericOAuthPlugin(config: GenericOAuthPluginConfig): MCPPlugin
|
|
59
|
+
export declare function genericOAuthPlugin(config: GenericOAuthPluginConfig): MCPPlugin;
|
|
60
60
|
/**
|
|
61
61
|
* Create a simple plugin without OAuth
|
|
62
62
|
* Useful for plugins that just enable certain tools without authentication
|
|
@@ -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,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,2BAA2B;IAC3B,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,I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,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,wBAAwB,GAC/B,SAAS,CAmBX;AAED;;;;;;;;;;;GAWG;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"}
|
package/dist/plugins/github.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface GitHubPluginConfig {
|
|
|
22
22
|
* Default GitHub tools that this plugin enables
|
|
23
23
|
* These should match the tool names exposed by your MCP server
|
|
24
24
|
*/
|
|
25
|
-
declare const GITHUB_TOOLS: readonly ["
|
|
25
|
+
declare const GITHUB_TOOLS: readonly ["github_create_issue", "github_list_issues", "github_get_issue", "github_update_issue", "github_close_issue", "github_create_pull_request", "github_list_pull_requests", "github_get_pull_request", "github_merge_pull_request", "github_list_repos", "github_list_own_repos", "github_get_repo", "github_create_repo", "github_list_branches", "github_create_branch", "github_get_user", "github_list_commits", "github_get_commit"];
|
|
26
26
|
/**
|
|
27
27
|
* GitHub Plugin
|
|
28
28
|
*
|
|
@@ -42,7 +42,7 @@ declare const GITHUB_TOOLS: readonly ["github/createIssue", "github/listIssues",
|
|
|
42
42
|
* });
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
export declare function githubPlugin(config: GitHubPluginConfig): MCPPlugin
|
|
45
|
+
export declare function githubPlugin(config: GitHubPluginConfig): MCPPlugin;
|
|
46
46
|
/**
|
|
47
47
|
* Export tool names for type inference
|
|
48
48
|
*/
|
|
@@ -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;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,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,
|
|
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;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,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;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,CA0BlE;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/plugins/gmail.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface GmailPluginConfig {
|
|
|
20
20
|
* Default Gmail tools that this plugin enables
|
|
21
21
|
* These should match the tool names exposed by your MCP server
|
|
22
22
|
*/
|
|
23
|
-
declare const GMAIL_TOOLS: readonly ["
|
|
23
|
+
declare const GMAIL_TOOLS: readonly ["gmail_send_email", "gmail_list_emails", "gmail_get_email", "gmail_delete_email", "gmail_search_emails", "gmail_mark_as_read", "gmail_mark_as_unread", "gmail_add_label", "gmail_remove_label", "gmail_list_labels", "gmail_create_label", "gmail_get_draft", "gmail_create_draft", "gmail_update_draft", "gmail_delete_draft", "gmail_send_draft"];
|
|
24
24
|
/**
|
|
25
25
|
* Gmail Plugin
|
|
26
26
|
*
|
|
@@ -39,7 +39,7 @@ declare const GMAIL_TOOLS: readonly ["gmail/sendEmail", "gmail/listEmails", "gma
|
|
|
39
39
|
* });
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
export declare function gmailPlugin(config: GmailPluginConfig): MCPPlugin
|
|
42
|
+
export declare function gmailPlugin(config: GmailPluginConfig): MCPPlugin;
|
|
43
43
|
/**
|
|
44
44
|
* Export tool names for type inference
|
|
45
45
|
*/
|
|
@@ -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;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,QAAA,MAAM,WAAW,
|
|
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;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,QAAA,MAAM,WAAW,+VAiBP,CAAC;AAEX;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,CA4BhE;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/plugins/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { MCPClient } from "../client.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* OAuth Configuration for a plugin
|
|
8
8
|
*/
|
|
9
|
-
export interface OAuthConfig
|
|
9
|
+
export interface OAuthConfig {
|
|
10
10
|
/** OAuth provider identifier (e.g., 'github', 'google') */
|
|
11
11
|
provider: string;
|
|
12
12
|
/** OAuth client ID */
|
|
@@ -18,20 +18,20 @@ export interface OAuthConfig<TConfig = Record<string, unknown>> {
|
|
|
18
18
|
/** Redirect URI for OAuth flow */
|
|
19
19
|
redirectUri?: string;
|
|
20
20
|
/** Provider-specific configuration */
|
|
21
|
-
config?:
|
|
21
|
+
config?: unknown;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* MCP Plugin Interface
|
|
25
25
|
*
|
|
26
26
|
* Plugins enable specific tools and configure OAuth providers
|
|
27
27
|
*/
|
|
28
|
-
export interface MCPPlugin
|
|
28
|
+
export interface MCPPlugin {
|
|
29
29
|
/** Unique plugin identifier */
|
|
30
30
|
id: string;
|
|
31
31
|
/** List of tool names this plugin enables */
|
|
32
32
|
tools: string[];
|
|
33
33
|
/** OAuth configuration for this plugin */
|
|
34
|
-
oauth?: OAuthConfig
|
|
34
|
+
oauth?: OAuthConfig;
|
|
35
35
|
/** Called when the plugin is initialized with the client */
|
|
36
36
|
onInit?: (client: MCPClient) => Promise<void> | void;
|
|
37
37
|
/** Called before the client connects to the server */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,WAAW
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IAEX,6CAA6C;IAC7C,KAAK,EAAE,MAAM,EAAE,CAAC;IAEhB,0CAA0C;IAC1C,KAAK,CAAC,EAA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