integrate-sdk 0.8.39 → 0.8.41-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 (57) hide show
  1. package/dist/adapters/auto-routes.js +1471 -60
  2. package/dist/adapters/index.js +1471 -60
  3. package/dist/adapters/nextjs.js +1471 -60
  4. package/dist/adapters/node.js +1471 -60
  5. package/dist/adapters/svelte-kit.js +1471 -60
  6. package/dist/adapters/tanstack-start.js +1471 -60
  7. package/dist/ai/anthropic.d.ts.map +1 -1
  8. package/dist/ai/anthropic.js +1240 -21
  9. package/dist/ai/google.d.ts.map +1 -1
  10. package/dist/ai/google.js +1292 -18
  11. package/dist/ai/index.js +1300 -60
  12. package/dist/ai/openai.d.ts.map +1 -1
  13. package/dist/ai/openai.js +1240 -21
  14. package/dist/index.js +1471 -60
  15. package/dist/oauth.js +1471 -60
  16. package/dist/server.js +1471 -60
  17. package/dist/src/ai/anthropic.d.ts.map +1 -1
  18. package/dist/src/ai/google.d.ts.map +1 -1
  19. package/dist/src/ai/openai.d.ts.map +1 -1
  20. package/package.json +6 -5
  21. package/dist/adapters/base-handler.js +0 -561
  22. package/dist/ai/cloudflare.d.ts +0 -158
  23. package/dist/ai/cloudflare.d.ts.map +0 -1
  24. package/dist/ai/cloudflare.js +0 -4249
  25. package/dist/ai/langchain.d.ts +0 -139
  26. package/dist/ai/langchain.d.ts.map +0 -1
  27. package/dist/ai/langchain.js +0 -4237
  28. package/dist/ai/llamaindex.d.ts +0 -125
  29. package/dist/ai/llamaindex.d.ts.map +0 -1
  30. package/dist/ai/llamaindex.js +0 -4236
  31. package/dist/ai/mastra.d.ts +0 -138
  32. package/dist/ai/mastra.d.ts.map +0 -1
  33. package/dist/ai/mastra.js +0 -4240
  34. package/dist/src/ai/cloudflare.d.ts +0 -158
  35. package/dist/src/ai/cloudflare.d.ts.map +0 -1
  36. package/dist/src/ai/langchain.d.ts +0 -139
  37. package/dist/src/ai/langchain.d.ts.map +0 -1
  38. package/dist/src/ai/llamaindex.d.ts +0 -125
  39. package/dist/src/ai/llamaindex.d.ts.map +0 -1
  40. package/dist/src/ai/mastra.d.ts +0 -138
  41. package/dist/src/ai/mastra.d.ts.map +0 -1
  42. package/dist/src/integrations/vercel-ai.d.ts +0 -127
  43. package/dist/src/integrations/vercel-ai.d.ts.map +0 -1
  44. package/dist/src/plugins/generic.d.ts +0 -99
  45. package/dist/src/plugins/generic.d.ts.map +0 -1
  46. package/dist/src/plugins/github-client.d.ts +0 -320
  47. package/dist/src/plugins/github-client.d.ts.map +0 -1
  48. package/dist/src/plugins/github.d.ts +0 -89
  49. package/dist/src/plugins/github.d.ts.map +0 -1
  50. package/dist/src/plugins/gmail-client.d.ts +0 -106
  51. package/dist/src/plugins/gmail-client.d.ts.map +0 -1
  52. package/dist/src/plugins/gmail.d.ts +0 -87
  53. package/dist/src/plugins/gmail.d.ts.map +0 -1
  54. package/dist/src/plugins/server-client.d.ts +0 -18
  55. package/dist/src/plugins/server-client.d.ts.map +0 -1
  56. package/dist/src/plugins/types.d.ts +0 -70
  57. package/dist/src/plugins/types.d.ts.map +0 -1
@@ -1,127 +0,0 @@
1
- /**
2
- * Vercel AI SDK Integration
3
- *
4
- * Helper functions to convert MCP tools to Vercel AI SDK v5 format
5
- */
6
- import { z } from "zod";
7
- import type { MCPClient } from "../client.js";
8
- import type { MCPTool } from "../protocol/messages.js";
9
- /**
10
- * Tool definition compatible with Vercel AI SDK v5
11
- * This matches the CoreTool interface from 'ai' package v5
12
- */
13
- export interface VercelAITool {
14
- description?: string;
15
- inputSchema: z.ZodType<any>;
16
- execute: (args: any, options?: any) => Promise<any>;
17
- }
18
- /**
19
- * Options for converting MCP tools to Vercel AI SDK format
20
- */
21
- export interface VercelAIToolsOptions {
22
- /**
23
- * Provider tokens for server-side usage
24
- * Maps provider names (e.g., 'github', 'gmail') to their access tokens
25
- *
26
- * @example
27
- * ```typescript
28
- * const tools = getVercelAITools(serverClient, {
29
- * providerTokens: {
30
- * github: 'ghp_...',
31
- * gmail: 'ya29...'
32
- * }
33
- * });
34
- * ```
35
- */
36
- providerTokens?: Record<string, string>;
37
- }
38
- /**
39
- * Convert a single MCP tool to Vercel AI SDK format
40
- *
41
- * @param mcpTool - The MCP tool definition
42
- * @param client - The MCP client instance (used for executing the tool)
43
- * @param options - Optional configuration including provider tokens
44
- * @returns Vercel AI SDK compatible tool definition
45
- */
46
- export declare function convertMCPToolToVercelAI(mcpTool: MCPTool, client: MCPClient<any>, options?: VercelAIToolsOptions): VercelAITool;
47
- /**
48
- * Convert all enabled MCP tools to Vercel AI SDK v5 format
49
- *
50
- * @param client - The MCP client instance (must be connected)
51
- * @param options - Optional configuration including provider tokens for server-side usage
52
- * @returns Object mapping tool names to Vercel AI SDK v5 tool definitions (compatible with CoreTool from 'ai' package v5)
53
- *
54
- * @example
55
- * ```typescript
56
- * // Client-side usage
57
- * import { createMCPClient, githubPlugin } from 'integrate-sdk';
58
- * import { convertMCPToolsToVercelAI } from 'integrate-sdk/vercel-ai';
59
- * import { generateText } from 'ai';
60
- *
61
- * const mcpClient = createMCPClient({
62
- * plugins: [githubPlugin({ clientId: '...', clientSecret: '...' })],
63
- * });
64
- *
65
- * await mcpClient.connect();
66
- *
67
- * const tools = convertMCPToolsToVercelAI(mcpClient);
68
- *
69
- * const result = await generateText({
70
- * model: openai('gpt-5'),
71
- * prompt: 'Create a GitHub issue in my repo',
72
- * tools,
73
- * });
74
- * ```
75
- *
76
- * @example
77
- * ```typescript
78
- * // Server-side usage with token passing
79
- * import { createMCPServer, githubPlugin } from 'integrate-sdk/server';
80
- * import { convertMCPToolsToVercelAI } from 'integrate-sdk/vercel-ai';
81
- *
82
- * const { client: serverClient } = createMCPServer({
83
- * plugins: [githubPlugin({ clientId: '...', clientSecret: '...' })],
84
- * });
85
- *
86
- * // In your API route handler
87
- * export async function POST(req: Request) {
88
- * const providerTokens = JSON.parse(req.headers.get('x-integrate-tokens') || '{}');
89
- *
90
- * const tools = convertMCPToolsToVercelAI(serverClient, { providerTokens });
91
- *
92
- * const result = await generateText({
93
- * model: openai('gpt-4'),
94
- * prompt: 'Create a GitHub issue',
95
- * tools,
96
- * });
97
- *
98
- * return Response.json(result);
99
- * }
100
- * ```
101
- */
102
- export declare function convertMCPToolsToVercelAI(client: MCPClient<any>, options?: VercelAIToolsOptions): Record<string, any>;
103
- /**
104
- * Get tools in a format compatible with Vercel AI SDK v5's tools parameter
105
- *
106
- * This returns the tools in the exact format expected by ai.generateText() and ai.streamText()
107
- * Automatically connects the client if not already connected.
108
- *
109
- * @param client - The MCP client instance
110
- * @param options - Optional configuration including provider tokens for server-side usage
111
- * @returns Tools object ready to pass to generateText({ tools: ... }) or streamText({ tools: ... })
112
- *
113
- * @example
114
- * ```typescript
115
- * // Client-side usage
116
- * const tools = await getVercelAITools(mcpClient);
117
- * ```
118
- *
119
- * @example
120
- * ```typescript
121
- * // Server-side usage with tokens from client
122
- * const providerTokens = JSON.parse(req.headers.get('x-integrate-tokens') || '{}');
123
- * const tools = await getVercelAITools(serverClient, { providerTokens });
124
- * ```
125
- */
126
- export declare function getVercelAITools(client: MCPClient<any>, options?: VercelAIToolsOptions): Promise<Record<string, any>>;
127
- //# sourceMappingURL=vercel-ai.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai.d.ts","sourceRoot":"","sources":["../../../src/integrations/vercel-ai.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAmKD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,YAAY,CAsCd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CASrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,oBAAoB,gCAQ/B"}
@@ -1,99 +0,0 @@
1
- /**
2
- * Generic OAuth Plugin
3
- * Configure OAuth and enable tools for any integration supported by the server
4
- */
5
- import type { MCPPlugin } from "./types.js";
6
- /**
7
- * Generic OAuth plugin configuration
8
- */
9
- export interface GenericOAuthPluginConfig {
10
- /** Plugin unique identifier (must match the integration ID on the server) */
11
- id: string;
12
- /** OAuth provider name */
13
- provider: string;
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
- /** OAuth scopes */
19
- scopes: string[];
20
- /** Tool names to enable from the server (must exist on the server) */
21
- tools: string[];
22
- /** OAuth redirect URI */
23
- redirectUri?: string;
24
- /** Additional provider-specific configuration */
25
- config?: Record<string, unknown>;
26
- /** Optional initialization callback */
27
- onInit?: (client: any) => Promise<void> | void;
28
- /** Optional after connect callback */
29
- onAfterConnect?: (client: any) => Promise<void> | void;
30
- /** Optional disconnect callback */
31
- onDisconnect?: (client: any) => Promise<void> | void;
32
- }
33
- /**
34
- * Generic OAuth Plugin
35
- *
36
- * Configure OAuth and enable tools for any integration supported by the Integrate MCP server.
37
- * Note: This does NOT create new tools - it only configures access to existing server-side tools.
38
- * All tools must be implemented on the server and exposed via the MCP protocol.
39
- *
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):
44
- * ```typescript
45
- * // Automatically uses SLACK_CLIENT_ID and SLACK_CLIENT_SECRET from env
46
- * const slackPlugin = genericOAuthPlugin({
47
- * id: 'slack',
48
- * provider: 'slack',
49
- * scopes: ['chat:write', 'channels:read'],
50
- * tools: [
51
- * 'slack_send_message', // Must exist on server
52
- * 'slack_list_channels', // Must exist on server
53
- * ],
54
- * });
55
- *
56
- * const client = createMCPClient({
57
- * plugins: [slackPlugin],
58
- * });
59
- *
60
- * await client.connect();
61
- * // Call server tools using _callToolByName
62
- * await client._callToolByName('slack_send_message', { channel: '#general', text: 'Hello' });
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
- * ```
76
- */
77
- export declare function genericOAuthPlugin(config: GenericOAuthPluginConfig): MCPPlugin;
78
- /**
79
- * Create a simple plugin without OAuth
80
- * Enable server-provided tools that don't require authentication
81
- * Note: Tools must exist on the server - this does not create new tools
82
- *
83
- * @example
84
- * ```typescript
85
- * // Enable server-provided math tools (if they exist on the server)
86
- * const mathPlugin = createSimplePlugin({
87
- * id: 'math',
88
- * tools: ['math_add', 'math_subtract', 'math_multiply', 'math_divide'],
89
- * });
90
- * ```
91
- */
92
- export declare function createSimplePlugin(config: {
93
- id: string;
94
- tools: string[];
95
- onInit?: (client: any) => Promise<void> | void;
96
- onAfterConnect?: (client: any) => Promise<void> | void;
97
- onDisconnect?: (client: any) => Promise<void> | void;
98
- }): MCPPlugin;
99
- //# sourceMappingURL=generic.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,320 +0,0 @@
1
- /**
2
- * GitHub Plugin Client Types
3
- * Fully typed interface for GitHub plugin methods
4
- */
5
- import type { MCPToolCallResponse } from "../protocol/messages.js";
6
- /**
7
- * GitHub Issue
8
- */
9
- export interface GitHubIssue {
10
- number: number;
11
- title: string;
12
- body?: string;
13
- state: "open" | "closed";
14
- html_url: string;
15
- user?: {
16
- login: string;
17
- avatar_url: string;
18
- };
19
- created_at: string;
20
- updated_at: string;
21
- closed_at?: string;
22
- labels?: Array<{
23
- name: string;
24
- color: string;
25
- }>;
26
- }
27
- /**
28
- * GitHub Pull Request
29
- */
30
- export interface GitHubPullRequest {
31
- number: number;
32
- title: string;
33
- body?: string;
34
- state: "open" | "closed" | "merged";
35
- html_url: string;
36
- user?: {
37
- login: string;
38
- avatar_url: string;
39
- };
40
- created_at: string;
41
- updated_at: string;
42
- merged_at?: string;
43
- head: {
44
- ref: string;
45
- sha: string;
46
- };
47
- base: {
48
- ref: string;
49
- sha: string;
50
- };
51
- }
52
- /**
53
- * GitHub Repository
54
- */
55
- export interface GitHubRepository {
56
- id: number;
57
- name: string;
58
- full_name: string;
59
- description?: string;
60
- html_url: string;
61
- private: boolean;
62
- owner: {
63
- login: string;
64
- avatar_url: string;
65
- };
66
- created_at: string;
67
- updated_at: string;
68
- pushed_at: string;
69
- stargazers_count: number;
70
- watchers_count: number;
71
- forks_count: number;
72
- language?: string;
73
- default_branch: string;
74
- }
75
- /**
76
- * GitHub Branch
77
- */
78
- export interface GitHubBranch {
79
- name: string;
80
- commit: {
81
- sha: string;
82
- url: string;
83
- };
84
- protected: boolean;
85
- }
86
- /**
87
- * GitHub User
88
- */
89
- export interface GitHubUser {
90
- login: string;
91
- id: number;
92
- avatar_url: string;
93
- html_url: string;
94
- name?: string;
95
- email?: string;
96
- bio?: string;
97
- public_repos: number;
98
- followers: number;
99
- following: number;
100
- created_at: string;
101
- }
102
- /**
103
- * GitHub Commit
104
- */
105
- export interface GitHubCommit {
106
- sha: string;
107
- commit: {
108
- message: string;
109
- author: {
110
- name: string;
111
- email: string;
112
- date: string;
113
- };
114
- committer: {
115
- name: string;
116
- email: string;
117
- date: string;
118
- };
119
- };
120
- html_url: string;
121
- author?: {
122
- login: string;
123
- avatar_url: string;
124
- };
125
- committer?: {
126
- login: string;
127
- avatar_url: string;
128
- };
129
- }
130
- /**
131
- * GitHub Plugin Client Interface
132
- * Provides type-safe methods for all GitHub operations
133
- */
134
- export interface GitHubPluginClient {
135
- /**
136
- * Create a new issue in a repository
137
- */
138
- createIssue(params: {
139
- owner: string;
140
- repo: string;
141
- title: string;
142
- body?: string;
143
- labels?: string[];
144
- assignees?: string[];
145
- }): Promise<MCPToolCallResponse>;
146
- /**
147
- * List issues in a repository
148
- */
149
- listIssues(params: {
150
- owner: string;
151
- repo: string;
152
- state?: "open" | "closed" | "all";
153
- labels?: string[];
154
- sort?: "created" | "updated" | "comments";
155
- direction?: "asc" | "desc";
156
- per_page?: number;
157
- page?: number;
158
- }): Promise<MCPToolCallResponse>;
159
- /**
160
- * Get a specific issue
161
- */
162
- getIssue(params: {
163
- owner: string;
164
- repo: string;
165
- issue_number: number;
166
- }): Promise<MCPToolCallResponse>;
167
- /**
168
- * Update an existing issue
169
- */
170
- updateIssue(params: {
171
- owner: string;
172
- repo: string;
173
- issue_number: number;
174
- title?: string;
175
- body?: string;
176
- state?: "open" | "closed";
177
- labels?: string[];
178
- assignees?: string[];
179
- }): Promise<MCPToolCallResponse>;
180
- /**
181
- * Close an issue
182
- */
183
- closeIssue(params: {
184
- owner: string;
185
- repo: string;
186
- issue_number: number;
187
- }): Promise<MCPToolCallResponse>;
188
- /**
189
- * Create a pull request
190
- */
191
- createPullRequest(params: {
192
- owner: string;
193
- repo: string;
194
- title: string;
195
- head: string;
196
- base: string;
197
- body?: string;
198
- draft?: boolean;
199
- }): Promise<MCPToolCallResponse>;
200
- /**
201
- * List pull requests in a repository
202
- */
203
- listPullRequests(params: {
204
- owner: string;
205
- repo: string;
206
- state?: "open" | "closed" | "all";
207
- sort?: "created" | "updated" | "popularity" | "long-running";
208
- direction?: "asc" | "desc";
209
- per_page?: number;
210
- page?: number;
211
- }): Promise<MCPToolCallResponse>;
212
- /**
213
- * Get a specific pull request
214
- */
215
- getPullRequest(params: {
216
- owner: string;
217
- repo: string;
218
- pull_number: number;
219
- }): Promise<MCPToolCallResponse>;
220
- /**
221
- * Merge a pull request
222
- */
223
- mergePullRequest(params: {
224
- owner: string;
225
- repo: string;
226
- pull_number: number;
227
- commit_title?: string;
228
- commit_message?: string;
229
- merge_method?: "merge" | "squash" | "rebase";
230
- }): Promise<MCPToolCallResponse>;
231
- /**
232
- * List repositories (for a user or organization)
233
- */
234
- listRepos(params: {
235
- owner: string;
236
- type?: "all" | "owner" | "member";
237
- sort?: "created" | "updated" | "pushed" | "full_name";
238
- direction?: "asc" | "desc";
239
- per_page?: number;
240
- page?: number;
241
- }): Promise<MCPToolCallResponse>;
242
- /**
243
- * List repositories for the authenticated user
244
- */
245
- listOwnRepos(params?: {
246
- visibility?: "all" | "public" | "private";
247
- affiliation?: string;
248
- type?: "all" | "owner" | "public" | "private" | "member";
249
- sort?: "created" | "updated" | "pushed" | "full_name";
250
- direction?: "asc" | "desc";
251
- per_page?: number;
252
- page?: number;
253
- }): Promise<MCPToolCallResponse>;
254
- /**
255
- * Get a specific repository
256
- */
257
- getRepo(params: {
258
- owner: string;
259
- repo: string;
260
- }): Promise<MCPToolCallResponse>;
261
- /**
262
- * Create a new repository
263
- */
264
- createRepo(params: {
265
- name: string;
266
- description?: string;
267
- private?: boolean;
268
- auto_init?: boolean;
269
- gitignore_template?: string;
270
- license_template?: string;
271
- }): Promise<MCPToolCallResponse>;
272
- /**
273
- * List branches in a repository
274
- */
275
- listBranches(params: {
276
- owner: string;
277
- repo: string;
278
- protected?: boolean;
279
- per_page?: number;
280
- page?: number;
281
- }): Promise<MCPToolCallResponse>;
282
- /**
283
- * Create a new branch
284
- */
285
- createBranch(params: {
286
- owner: string;
287
- repo: string;
288
- branch: string;
289
- from_branch?: string;
290
- }): Promise<MCPToolCallResponse>;
291
- /**
292
- * Get information about a user
293
- */
294
- getUser(params: {
295
- username: string;
296
- }): Promise<MCPToolCallResponse>;
297
- /**
298
- * List commits in a repository
299
- */
300
- listCommits(params: {
301
- owner: string;
302
- repo: string;
303
- sha?: string;
304
- path?: string;
305
- author?: string;
306
- since?: string;
307
- until?: string;
308
- per_page?: number;
309
- page?: number;
310
- }): Promise<MCPToolCallResponse>;
311
- /**
312
- * Get a specific commit
313
- */
314
- getCommit(params: {
315
- owner: string;
316
- repo: string;
317
- ref: string;
318
- }): Promise<MCPToolCallResponse>;
319
- }
320
- //# sourceMappingURL=github-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"github-client.d.ts","sourceRoot":"","sources":["../../../src/plugins/github-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EA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OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAClC"}
@@ -1,89 +0,0 @@
1
- /**
2
- * GitHub Plugin
3
- * Enables GitHub tools with OAuth configuration
4
- */
5
- import type { MCPPlugin } from "./types.js";
6
- /**
7
- * GitHub plugin configuration
8
- *
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.
11
- * CLIENT-SIDE: Omit clientId and clientSecret when using createMCPClient()
12
- */
13
- export interface GitHubPluginConfig {
14
- /** GitHub OAuth client ID (defaults to GITHUB_CLIENT_ID env var) */
15
- clientId?: string;
16
- /** GitHub OAuth client secret (defaults to GITHUB_CLIENT_SECRET env var) */
17
- clientSecret?: string;
18
- /** Additional OAuth scopes (default: ['repo', 'user']) */
19
- scopes?: string[];
20
- /** OAuth redirect URI */
21
- redirectUri?: string;
22
- /** GitHub API base URL (default: https://api.github.com) */
23
- apiBaseUrl?: string;
24
- }
25
- /**
26
- * Default GitHub tools that this plugin enables
27
- * These should match the tool names exposed by your MCP server
28
- */
29
- 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"];
30
- /**
31
- * GitHub Plugin
32
- *
33
- * Enables GitHub integration with OAuth authentication.
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):
53
- * ```typescript
54
- * import { createMCPServer, githubPlugin } from 'integrate-sdk/server';
55
- *
56
- * export const { client } = createMCPServer({
57
- * plugins: [
58
- * githubPlugin({
59
- * clientId: process.env.CUSTOM_GITHUB_ID!,
60
- * clientSecret: process.env.CUSTOM_GITHUB_SECRET!,
61
- * scopes: ['repo', 'user', 'read:org'],
62
- * }),
63
- * ],
64
- * });
65
- * ```
66
- *
67
- * @example Client-side (without secrets):
68
- * ```typescript
69
- * import { createMCPClient, githubPlugin } from 'integrate-sdk';
70
- *
71
- * const client = createMCPClient({
72
- * plugins: [
73
- * githubPlugin({
74
- * scopes: ['repo', 'user', 'read:org'],
75
- * }),
76
- * ],
77
- * });
78
- * ```
79
- */
80
- export declare function githubPlugin(config?: GitHubPluginConfig): MCPPlugin;
81
- /**
82
- * Export tool names for type inference
83
- */
84
- export type GitHubTools = typeof GITHUB_TOOLS[number];
85
- /**
86
- * Export GitHub client types
87
- */
88
- export type { GitHubPluginClient } from "./github-client.js";
89
- //# sourceMappingURL=github.d.ts.map
@@ -1 +0,0 @@
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"}