integrate-sdk 0.4.1 → 0.4.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/dist/index.js CHANGED
@@ -1,21 +1,4 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __moduleCache = /* @__PURE__ */ new WeakMap;
6
- var __toCommonJS = (from) => {
7
- var entry = __moduleCache.get(from), desc;
8
- if (entry)
9
- return entry;
10
- entry = __defProp({}, "__esModule", { value: true });
11
- if (from && typeof from === "object" || typeof from === "function")
12
- __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- }));
16
- __moduleCache.set(from, entry);
17
- return entry;
18
- };
19
2
  var __export = (target, all) => {
20
3
  for (var name in all)
21
4
  __defProp(target, name, {
@@ -165,206 +148,6 @@ var init_errors = __esm(() => {
165
148
  };
166
149
  });
167
150
 
168
- // src/adapters/base-handler.ts
169
- class OAuthHandler {
170
- config;
171
- serverUrl = MCP_SERVER_URL2;
172
- constructor(config) {
173
- this.config = config;
174
- }
175
- async handleAuthorize(request) {
176
- const providerConfig = this.config.providers[request.provider];
177
- if (!providerConfig) {
178
- throw new Error(`Provider ${request.provider} not configured. Add OAuth credentials to your API route configuration.`);
179
- }
180
- if (!providerConfig.clientId || !providerConfig.clientSecret) {
181
- throw new Error(`Missing OAuth credentials for ${request.provider}. Check your environment variables.`);
182
- }
183
- const url = new URL("/oauth/authorize", this.serverUrl);
184
- url.searchParams.set("provider", request.provider);
185
- url.searchParams.set("client_id", providerConfig.clientId);
186
- url.searchParams.set("client_secret", providerConfig.clientSecret);
187
- url.searchParams.set("scope", request.scopes.join(","));
188
- url.searchParams.set("state", request.state);
189
- url.searchParams.set("code_challenge", request.codeChallenge);
190
- url.searchParams.set("code_challenge_method", request.codeChallengeMethod);
191
- const redirectUri = request.redirectUri || providerConfig.redirectUri;
192
- if (redirectUri) {
193
- url.searchParams.set("redirect_uri", redirectUri);
194
- }
195
- const response = await fetch(url.toString(), {
196
- method: "GET"
197
- });
198
- if (!response.ok) {
199
- const error = await response.text();
200
- throw new Error(`MCP server failed to generate authorization URL: ${error}`);
201
- }
202
- const data = await response.json();
203
- return data;
204
- }
205
- async handleCallback(request) {
206
- const url = new URL("/oauth/callback", this.serverUrl);
207
- const response = await fetch(url.toString(), {
208
- method: "POST",
209
- headers: {
210
- "Content-Type": "application/json"
211
- },
212
- body: JSON.stringify({
213
- provider: request.provider,
214
- code: request.code,
215
- code_verifier: request.codeVerifier,
216
- state: request.state
217
- })
218
- });
219
- if (!response.ok) {
220
- const error = await response.text();
221
- throw new Error(`MCP server failed to exchange authorization code: ${error}`);
222
- }
223
- const data = await response.json();
224
- return data;
225
- }
226
- async handleStatus(provider, accessToken) {
227
- const url = new URL("/oauth/status", this.serverUrl);
228
- url.searchParams.set("provider", provider);
229
- const response = await fetch(url.toString(), {
230
- method: "GET",
231
- headers: {
232
- Authorization: `Bearer ${accessToken}`
233
- }
234
- });
235
- if (!response.ok) {
236
- if (response.status === 401) {
237
- return {
238
- authorized: false
239
- };
240
- }
241
- const error = await response.text();
242
- throw new Error(`MCP server failed to check authorization status: ${error}`);
243
- }
244
- const data = await response.json();
245
- return data;
246
- }
247
- async handleDisconnect(request, accessToken) {
248
- if (!accessToken) {
249
- throw new Error("No access token provided. Cannot disconnect provider.");
250
- }
251
- const url = new URL("/oauth/disconnect", this.serverUrl);
252
- const response = await fetch(url.toString(), {
253
- method: "POST",
254
- headers: {
255
- "Content-Type": "application/json",
256
- Authorization: `Bearer ${accessToken}`
257
- },
258
- body: JSON.stringify({
259
- provider: request.provider
260
- })
261
- });
262
- if (!response.ok) {
263
- const error = await response.text();
264
- throw new Error(`MCP server failed to disconnect provider: ${error}`);
265
- }
266
- const data = await response.json();
267
- return data;
268
- }
269
- }
270
- var MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
271
-
272
- // src/adapters/nextjs.ts
273
- var exports_nextjs = {};
274
- __export(exports_nextjs, {
275
- createNextOAuthHandler: () => createNextOAuthHandler
276
- });
277
- function createNextOAuthHandler(config) {
278
- const handler = new OAuthHandler(config);
279
- const handlers = {
280
- async authorize(req) {
281
- try {
282
- const body = await req.json();
283
- const result = await handler.handleAuthorize(body);
284
- return Response.json(result);
285
- } catch (error) {
286
- console.error("[OAuth Authorize] Error:", error);
287
- return Response.json({ error: error.message || "Failed to get authorization URL" }, { status: 500 });
288
- }
289
- },
290
- async callback(req) {
291
- try {
292
- const body = await req.json();
293
- const result = await handler.handleCallback(body);
294
- return Response.json(result);
295
- } catch (error) {
296
- console.error("[OAuth Callback] Error:", error);
297
- return Response.json({ error: error.message || "Failed to exchange authorization code" }, { status: 500 });
298
- }
299
- },
300
- async status(req) {
301
- try {
302
- const provider = req.nextUrl.searchParams.get("provider");
303
- const authHeader = req.headers.get("authorization");
304
- if (!provider) {
305
- return Response.json({ error: "Missing provider query parameter" }, { status: 400 });
306
- }
307
- if (!authHeader || !authHeader.startsWith("Bearer ")) {
308
- return Response.json({ error: "Missing or invalid Authorization header" }, { status: 400 });
309
- }
310
- const accessToken = authHeader.substring(7);
311
- const result = await handler.handleStatus(provider, accessToken);
312
- return Response.json(result);
313
- } catch (error) {
314
- console.error("[OAuth Status] Error:", error);
315
- return Response.json({ error: error.message || "Failed to check authorization status" }, { status: 500 });
316
- }
317
- },
318
- async disconnect(req) {
319
- try {
320
- const authHeader = req.headers.get("authorization");
321
- if (!authHeader || !authHeader.startsWith("Bearer ")) {
322
- return Response.json({ error: "Missing or invalid Authorization header" }, { status: 400 });
323
- }
324
- const accessToken = authHeader.substring(7);
325
- const body = await req.json();
326
- const { provider } = body;
327
- if (!provider) {
328
- return Response.json({ error: "Missing provider in request body" }, { status: 400 });
329
- }
330
- const result = await handler.handleDisconnect({ provider }, accessToken);
331
- return Response.json(result);
332
- } catch (error) {
333
- console.error("[OAuth Disconnect] Error:", error);
334
- return Response.json({ error: error.message || "Failed to disconnect provider" }, { status: 500 });
335
- }
336
- },
337
- createRoutes() {
338
- return {
339
- async POST(req, context) {
340
- const params = context.params instanceof Promise ? await context.params : context.params;
341
- const action = params.action;
342
- if (action === "authorize") {
343
- return handlers.authorize(req);
344
- }
345
- if (action === "callback") {
346
- return handlers.callback(req);
347
- }
348
- if (action === "disconnect") {
349
- return handlers.disconnect(req);
350
- }
351
- return Response.json({ error: `Unknown action: ${action}` }, { status: 404 });
352
- },
353
- async GET(req, context) {
354
- const params = context.params instanceof Promise ? await context.params : context.params;
355
- const action = params.action;
356
- if (action === "status") {
357
- return handlers.status(req);
358
- }
359
- return Response.json({ error: `Unknown action: ${action}` }, { status: 404 });
360
- }
361
- };
362
- }
363
- };
364
- return handlers;
365
- }
366
- var init_nextjs = () => {};
367
-
368
151
  // src/protocol/jsonrpc.ts
369
152
  function parseMessage(message) {
370
153
  try {
@@ -1725,10 +1508,212 @@ async function clearClientCache() {
1725
1508
  }
1726
1509
  }));
1727
1510
  }
1511
+ // src/adapters/base-handler.ts
1512
+ var MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
1728
1513
 
1729
- // src/index.ts
1730
- init_nextjs();
1731
-
1514
+ class OAuthHandler {
1515
+ config;
1516
+ serverUrl = MCP_SERVER_URL2;
1517
+ constructor(config) {
1518
+ this.config = config;
1519
+ if (!config || !config.providers) {
1520
+ throw new Error("OAuthHandler requires a valid config with providers");
1521
+ }
1522
+ }
1523
+ async handleAuthorize(request) {
1524
+ const providerConfig = this.config.providers[request.provider];
1525
+ if (!providerConfig) {
1526
+ throw new Error(`Provider ${request.provider} not configured. Add OAuth credentials to your API route configuration.`);
1527
+ }
1528
+ if (!providerConfig.clientId || !providerConfig.clientSecret) {
1529
+ throw new Error(`Missing OAuth credentials for ${request.provider}. Check your environment variables.`);
1530
+ }
1531
+ const url = new URL("/oauth/authorize", this.serverUrl);
1532
+ url.searchParams.set("provider", request.provider);
1533
+ url.searchParams.set("client_id", providerConfig.clientId);
1534
+ url.searchParams.set("client_secret", providerConfig.clientSecret);
1535
+ url.searchParams.set("scope", request.scopes.join(","));
1536
+ url.searchParams.set("state", request.state);
1537
+ url.searchParams.set("code_challenge", request.codeChallenge);
1538
+ url.searchParams.set("code_challenge_method", request.codeChallengeMethod);
1539
+ const redirectUri = request.redirectUri || providerConfig.redirectUri;
1540
+ if (redirectUri) {
1541
+ url.searchParams.set("redirect_uri", redirectUri);
1542
+ }
1543
+ const response = await fetch(url.toString(), {
1544
+ method: "GET"
1545
+ });
1546
+ if (!response.ok) {
1547
+ const error = await response.text();
1548
+ throw new Error(`MCP server failed to generate authorization URL: ${error}`);
1549
+ }
1550
+ const data = await response.json();
1551
+ return data;
1552
+ }
1553
+ async handleCallback(request) {
1554
+ const providerConfig = this.config.providers[request.provider];
1555
+ if (!providerConfig) {
1556
+ throw new Error(`Provider ${request.provider} not configured. Add OAuth credentials to your API route configuration.`);
1557
+ }
1558
+ if (!providerConfig.clientId || !providerConfig.clientSecret) {
1559
+ throw new Error(`Missing OAuth credentials for ${request.provider}. Check your environment variables.`);
1560
+ }
1561
+ const url = new URL("/oauth/callback", this.serverUrl);
1562
+ const response = await fetch(url.toString(), {
1563
+ method: "POST",
1564
+ headers: {
1565
+ "Content-Type": "application/json"
1566
+ },
1567
+ body: JSON.stringify({
1568
+ provider: request.provider,
1569
+ code: request.code,
1570
+ code_verifier: request.codeVerifier,
1571
+ state: request.state,
1572
+ client_id: providerConfig.clientId,
1573
+ client_secret: providerConfig.clientSecret
1574
+ })
1575
+ });
1576
+ if (!response.ok) {
1577
+ const error = await response.text();
1578
+ throw new Error(`MCP server failed to exchange authorization code: ${error}`);
1579
+ }
1580
+ const data = await response.json();
1581
+ return data;
1582
+ }
1583
+ async handleStatus(provider, accessToken) {
1584
+ const url = new URL("/oauth/status", this.serverUrl);
1585
+ url.searchParams.set("provider", provider);
1586
+ const response = await fetch(url.toString(), {
1587
+ method: "GET",
1588
+ headers: {
1589
+ Authorization: `Bearer ${accessToken}`
1590
+ }
1591
+ });
1592
+ if (!response.ok) {
1593
+ if (response.status === 401) {
1594
+ return {
1595
+ authorized: false
1596
+ };
1597
+ }
1598
+ const error = await response.text();
1599
+ throw new Error(`MCP server failed to check authorization status: ${error}`);
1600
+ }
1601
+ const data = await response.json();
1602
+ return data;
1603
+ }
1604
+ async handleDisconnect(request, accessToken) {
1605
+ if (!accessToken) {
1606
+ throw new Error("No access token provided. Cannot disconnect provider.");
1607
+ }
1608
+ const url = new URL("/oauth/disconnect", this.serverUrl);
1609
+ const response = await fetch(url.toString(), {
1610
+ method: "POST",
1611
+ headers: {
1612
+ "Content-Type": "application/json",
1613
+ Authorization: `Bearer ${accessToken}`
1614
+ },
1615
+ body: JSON.stringify({
1616
+ provider: request.provider
1617
+ })
1618
+ });
1619
+ if (!response.ok) {
1620
+ const error = await response.text();
1621
+ throw new Error(`MCP server failed to disconnect provider: ${error}`);
1622
+ }
1623
+ const data = await response.json();
1624
+ return data;
1625
+ }
1626
+ }
1627
+ // src/adapters/nextjs.ts
1628
+ function createNextOAuthHandler(config) {
1629
+ const handler = new OAuthHandler(config);
1630
+ const handlers = {
1631
+ async authorize(req) {
1632
+ try {
1633
+ const body = await req.json();
1634
+ const result = await handler.handleAuthorize(body);
1635
+ return Response.json(result);
1636
+ } catch (error) {
1637
+ console.error("[OAuth Authorize] Error:", error);
1638
+ return Response.json({ error: error.message || "Failed to get authorization URL" }, { status: 500 });
1639
+ }
1640
+ },
1641
+ async callback(req) {
1642
+ try {
1643
+ const body = await req.json();
1644
+ const result = await handler.handleCallback(body);
1645
+ return Response.json(result);
1646
+ } catch (error) {
1647
+ console.error("[OAuth Callback] Error:", error);
1648
+ return Response.json({ error: error.message || "Failed to exchange authorization code" }, { status: 500 });
1649
+ }
1650
+ },
1651
+ async status(req) {
1652
+ try {
1653
+ const provider = req.nextUrl.searchParams.get("provider");
1654
+ const authHeader = req.headers.get("authorization");
1655
+ if (!provider) {
1656
+ return Response.json({ error: "Missing provider query parameter" }, { status: 400 });
1657
+ }
1658
+ if (!authHeader || !authHeader.startsWith("Bearer ")) {
1659
+ return Response.json({ error: "Missing or invalid Authorization header" }, { status: 400 });
1660
+ }
1661
+ const accessToken = authHeader.substring(7);
1662
+ const result = await handler.handleStatus(provider, accessToken);
1663
+ return Response.json(result);
1664
+ } catch (error) {
1665
+ console.error("[OAuth Status] Error:", error);
1666
+ return Response.json({ error: error.message || "Failed to check authorization status" }, { status: 500 });
1667
+ }
1668
+ },
1669
+ async disconnect(req) {
1670
+ try {
1671
+ const authHeader = req.headers.get("authorization");
1672
+ if (!authHeader || !authHeader.startsWith("Bearer ")) {
1673
+ return Response.json({ error: "Missing or invalid Authorization header" }, { status: 400 });
1674
+ }
1675
+ const accessToken = authHeader.substring(7);
1676
+ const body = await req.json();
1677
+ const { provider } = body;
1678
+ if (!provider) {
1679
+ return Response.json({ error: "Missing provider in request body" }, { status: 400 });
1680
+ }
1681
+ const result = await handler.handleDisconnect({ provider }, accessToken);
1682
+ return Response.json(result);
1683
+ } catch (error) {
1684
+ console.error("[OAuth Disconnect] Error:", error);
1685
+ return Response.json({ error: error.message || "Failed to disconnect provider" }, { status: 500 });
1686
+ }
1687
+ },
1688
+ createRoutes() {
1689
+ return {
1690
+ async POST(req, context) {
1691
+ const params = context.params instanceof Promise ? await context.params : context.params;
1692
+ const action = params.action;
1693
+ if (action === "authorize") {
1694
+ return handlers.authorize(req);
1695
+ }
1696
+ if (action === "callback") {
1697
+ return handlers.callback(req);
1698
+ }
1699
+ if (action === "disconnect") {
1700
+ return handlers.disconnect(req);
1701
+ }
1702
+ return Response.json({ error: `Unknown action: ${action}` }, { status: 404 });
1703
+ },
1704
+ async GET(req, context) {
1705
+ const params = context.params instanceof Promise ? await context.params : context.params;
1706
+ const action = params.action;
1707
+ if (action === "status") {
1708
+ return handlers.status(req);
1709
+ }
1710
+ return Response.json({ error: `Unknown action: ${action}` }, { status: 404 });
1711
+ }
1712
+ };
1713
+ }
1714
+ };
1715
+ return handlers;
1716
+ }
1732
1717
  // src/adapters/nextjs-oauth-redirect.ts
1733
1718
  function createOAuthRedirectHandler(config) {
1734
1719
  const redirectUrl = config?.redirectUrl || "/";
package/dist/oauth.js CHANGED
@@ -1,21 +1,4 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __moduleCache = /* @__PURE__ */ new WeakMap;
6
- var __toCommonJS = (from) => {
7
- var entry = __moduleCache.get(from), desc;
8
- if (entry)
9
- return entry;
10
- entry = __defProp({}, "__esModule", { value: true });
11
- if (from && typeof from === "object" || typeof from === "function")
12
- __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- }));
16
- __moduleCache.set(from, entry);
17
- return entry;
18
- };
19
2
  var __export = (target, all) => {
20
3
  for (var name in all)
21
4
  __defProp(target, name, {
@@ -28,11 +11,16 @@ var __export = (target, all) => {
28
11
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
29
12
 
30
13
  // src/adapters/base-handler.ts
14
+ var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp";
15
+
31
16
  class OAuthHandler {
32
17
  config;
33
18
  serverUrl = MCP_SERVER_URL;
34
19
  constructor(config) {
35
20
  this.config = config;
21
+ if (!config || !config.providers) {
22
+ throw new Error("OAuthHandler requires a valid config with providers");
23
+ }
36
24
  }
37
25
  async handleAuthorize(request) {
38
26
  const providerConfig = this.config.providers[request.provider];
@@ -65,6 +53,13 @@ class OAuthHandler {
65
53
  return data;
66
54
  }
67
55
  async handleCallback(request) {
56
+ const providerConfig = this.config.providers[request.provider];
57
+ if (!providerConfig) {
58
+ throw new Error(`Provider ${request.provider} not configured. Add OAuth credentials to your API route configuration.`);
59
+ }
60
+ if (!providerConfig.clientId || !providerConfig.clientSecret) {
61
+ throw new Error(`Missing OAuth credentials for ${request.provider}. Check your environment variables.`);
62
+ }
68
63
  const url = new URL("/oauth/callback", this.serverUrl);
69
64
  const response = await fetch(url.toString(), {
70
65
  method: "POST",
@@ -75,7 +70,9 @@ class OAuthHandler {
75
70
  provider: request.provider,
76
71
  code: request.code,
77
72
  code_verifier: request.codeVerifier,
78
- state: request.state
73
+ state: request.state,
74
+ client_id: providerConfig.clientId,
75
+ client_secret: providerConfig.clientSecret
79
76
  })
80
77
  });
81
78
  if (!response.ok) {
@@ -129,7 +126,6 @@ class OAuthHandler {
129
126
  return data;
130
127
  }
131
128
  }
132
- var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp";
133
129
 
134
130
  // src/adapters/auto-routes.ts
135
131
  var globalOAuthConfig = null;
package/dist/server.js CHANGED
@@ -1,21 +1,4 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __moduleCache = /* @__PURE__ */ new WeakMap;
6
- var __toCommonJS = (from) => {
7
- var entry = __moduleCache.get(from), desc;
8
- if (entry)
9
- return entry;
10
- entry = __defProp({}, "__esModule", { value: true });
11
- if (from && typeof from === "object" || typeof from === "function")
12
- __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- }));
16
- __moduleCache.set(from, entry);
17
- return entry;
18
- };
19
2
  var __export = (target, all) => {
20
3
  for (var name in all)
21
4
  __defProp(target, name, {
@@ -165,206 +148,6 @@ var init_errors = __esm(() => {
165
148
  };
166
149
  });
167
150
 
168
- // src/adapters/base-handler.ts
169
- class OAuthHandler {
170
- config;
171
- serverUrl = MCP_SERVER_URL2;
172
- constructor(config) {
173
- this.config = config;
174
- }
175
- async handleAuthorize(request) {
176
- const providerConfig = this.config.providers[request.provider];
177
- if (!providerConfig) {
178
- throw new Error(`Provider ${request.provider} not configured. Add OAuth credentials to your API route configuration.`);
179
- }
180
- if (!providerConfig.clientId || !providerConfig.clientSecret) {
181
- throw new Error(`Missing OAuth credentials for ${request.provider}. Check your environment variables.`);
182
- }
183
- const url = new URL("/oauth/authorize", this.serverUrl);
184
- url.searchParams.set("provider", request.provider);
185
- url.searchParams.set("client_id", providerConfig.clientId);
186
- url.searchParams.set("client_secret", providerConfig.clientSecret);
187
- url.searchParams.set("scope", request.scopes.join(","));
188
- url.searchParams.set("state", request.state);
189
- url.searchParams.set("code_challenge", request.codeChallenge);
190
- url.searchParams.set("code_challenge_method", request.codeChallengeMethod);
191
- const redirectUri = request.redirectUri || providerConfig.redirectUri;
192
- if (redirectUri) {
193
- url.searchParams.set("redirect_uri", redirectUri);
194
- }
195
- const response = await fetch(url.toString(), {
196
- method: "GET"
197
- });
198
- if (!response.ok) {
199
- const error = await response.text();
200
- throw new Error(`MCP server failed to generate authorization URL: ${error}`);
201
- }
202
- const data = await response.json();
203
- return data;
204
- }
205
- async handleCallback(request) {
206
- const url = new URL("/oauth/callback", this.serverUrl);
207
- const response = await fetch(url.toString(), {
208
- method: "POST",
209
- headers: {
210
- "Content-Type": "application/json"
211
- },
212
- body: JSON.stringify({
213
- provider: request.provider,
214
- code: request.code,
215
- code_verifier: request.codeVerifier,
216
- state: request.state
217
- })
218
- });
219
- if (!response.ok) {
220
- const error = await response.text();
221
- throw new Error(`MCP server failed to exchange authorization code: ${error}`);
222
- }
223
- const data = await response.json();
224
- return data;
225
- }
226
- async handleStatus(provider, accessToken) {
227
- const url = new URL("/oauth/status", this.serverUrl);
228
- url.searchParams.set("provider", provider);
229
- const response = await fetch(url.toString(), {
230
- method: "GET",
231
- headers: {
232
- Authorization: `Bearer ${accessToken}`
233
- }
234
- });
235
- if (!response.ok) {
236
- if (response.status === 401) {
237
- return {
238
- authorized: false
239
- };
240
- }
241
- const error = await response.text();
242
- throw new Error(`MCP server failed to check authorization status: ${error}`);
243
- }
244
- const data = await response.json();
245
- return data;
246
- }
247
- async handleDisconnect(request, accessToken) {
248
- if (!accessToken) {
249
- throw new Error("No access token provided. Cannot disconnect provider.");
250
- }
251
- const url = new URL("/oauth/disconnect", this.serverUrl);
252
- const response = await fetch(url.toString(), {
253
- method: "POST",
254
- headers: {
255
- "Content-Type": "application/json",
256
- Authorization: `Bearer ${accessToken}`
257
- },
258
- body: JSON.stringify({
259
- provider: request.provider
260
- })
261
- });
262
- if (!response.ok) {
263
- const error = await response.text();
264
- throw new Error(`MCP server failed to disconnect provider: ${error}`);
265
- }
266
- const data = await response.json();
267
- return data;
268
- }
269
- }
270
- var MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
271
-
272
- // src/adapters/nextjs.ts
273
- var exports_nextjs = {};
274
- __export(exports_nextjs, {
275
- createNextOAuthHandler: () => createNextOAuthHandler
276
- });
277
- function createNextOAuthHandler(config) {
278
- const handler = new OAuthHandler(config);
279
- const handlers = {
280
- async authorize(req) {
281
- try {
282
- const body = await req.json();
283
- const result = await handler.handleAuthorize(body);
284
- return Response.json(result);
285
- } catch (error) {
286
- console.error("[OAuth Authorize] Error:", error);
287
- return Response.json({ error: error.message || "Failed to get authorization URL" }, { status: 500 });
288
- }
289
- },
290
- async callback(req) {
291
- try {
292
- const body = await req.json();
293
- const result = await handler.handleCallback(body);
294
- return Response.json(result);
295
- } catch (error) {
296
- console.error("[OAuth Callback] Error:", error);
297
- return Response.json({ error: error.message || "Failed to exchange authorization code" }, { status: 500 });
298
- }
299
- },
300
- async status(req) {
301
- try {
302
- const provider = req.nextUrl.searchParams.get("provider");
303
- const authHeader = req.headers.get("authorization");
304
- if (!provider) {
305
- return Response.json({ error: "Missing provider query parameter" }, { status: 400 });
306
- }
307
- if (!authHeader || !authHeader.startsWith("Bearer ")) {
308
- return Response.json({ error: "Missing or invalid Authorization header" }, { status: 400 });
309
- }
310
- const accessToken = authHeader.substring(7);
311
- const result = await handler.handleStatus(provider, accessToken);
312
- return Response.json(result);
313
- } catch (error) {
314
- console.error("[OAuth Status] Error:", error);
315
- return Response.json({ error: error.message || "Failed to check authorization status" }, { status: 500 });
316
- }
317
- },
318
- async disconnect(req) {
319
- try {
320
- const authHeader = req.headers.get("authorization");
321
- if (!authHeader || !authHeader.startsWith("Bearer ")) {
322
- return Response.json({ error: "Missing or invalid Authorization header" }, { status: 400 });
323
- }
324
- const accessToken = authHeader.substring(7);
325
- const body = await req.json();
326
- const { provider } = body;
327
- if (!provider) {
328
- return Response.json({ error: "Missing provider in request body" }, { status: 400 });
329
- }
330
- const result = await handler.handleDisconnect({ provider }, accessToken);
331
- return Response.json(result);
332
- } catch (error) {
333
- console.error("[OAuth Disconnect] Error:", error);
334
- return Response.json({ error: error.message || "Failed to disconnect provider" }, { status: 500 });
335
- }
336
- },
337
- createRoutes() {
338
- return {
339
- async POST(req, context) {
340
- const params = context.params instanceof Promise ? await context.params : context.params;
341
- const action = params.action;
342
- if (action === "authorize") {
343
- return handlers.authorize(req);
344
- }
345
- if (action === "callback") {
346
- return handlers.callback(req);
347
- }
348
- if (action === "disconnect") {
349
- return handlers.disconnect(req);
350
- }
351
- return Response.json({ error: `Unknown action: ${action}` }, { status: 404 });
352
- },
353
- async GET(req, context) {
354
- const params = context.params instanceof Promise ? await context.params : context.params;
355
- const action = params.action;
356
- if (action === "status") {
357
- return handlers.status(req);
358
- }
359
- return Response.json({ error: `Unknown action: ${action}` }, { status: 404 });
360
- }
361
- };
362
- }
363
- };
364
- return handlers;
365
- }
366
- var init_nextjs = () => {};
367
-
368
151
  // src/protocol/jsonrpc.ts
369
152
  function parseMessage(message) {
370
153
  try {
@@ -1726,6 +1509,214 @@ async function clearClientCache() {
1726
1509
  }));
1727
1510
  }
1728
1511
 
1512
+ // src/adapters/base-handler.ts
1513
+ var MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
1514
+
1515
+ class OAuthHandler {
1516
+ config;
1517
+ serverUrl = MCP_SERVER_URL2;
1518
+ constructor(config) {
1519
+ this.config = config;
1520
+ if (!config || !config.providers) {
1521
+ throw new Error("OAuthHandler requires a valid config with providers");
1522
+ }
1523
+ }
1524
+ async handleAuthorize(request) {
1525
+ const providerConfig = this.config.providers[request.provider];
1526
+ if (!providerConfig) {
1527
+ throw new Error(`Provider ${request.provider} not configured. Add OAuth credentials to your API route configuration.`);
1528
+ }
1529
+ if (!providerConfig.clientId || !providerConfig.clientSecret) {
1530
+ throw new Error(`Missing OAuth credentials for ${request.provider}. Check your environment variables.`);
1531
+ }
1532
+ const url = new URL("/oauth/authorize", this.serverUrl);
1533
+ url.searchParams.set("provider", request.provider);
1534
+ url.searchParams.set("client_id", providerConfig.clientId);
1535
+ url.searchParams.set("client_secret", providerConfig.clientSecret);
1536
+ url.searchParams.set("scope", request.scopes.join(","));
1537
+ url.searchParams.set("state", request.state);
1538
+ url.searchParams.set("code_challenge", request.codeChallenge);
1539
+ url.searchParams.set("code_challenge_method", request.codeChallengeMethod);
1540
+ const redirectUri = request.redirectUri || providerConfig.redirectUri;
1541
+ if (redirectUri) {
1542
+ url.searchParams.set("redirect_uri", redirectUri);
1543
+ }
1544
+ const response = await fetch(url.toString(), {
1545
+ method: "GET"
1546
+ });
1547
+ if (!response.ok) {
1548
+ const error = await response.text();
1549
+ throw new Error(`MCP server failed to generate authorization URL: ${error}`);
1550
+ }
1551
+ const data = await response.json();
1552
+ return data;
1553
+ }
1554
+ async handleCallback(request) {
1555
+ const providerConfig = this.config.providers[request.provider];
1556
+ if (!providerConfig) {
1557
+ throw new Error(`Provider ${request.provider} not configured. Add OAuth credentials to your API route configuration.`);
1558
+ }
1559
+ if (!providerConfig.clientId || !providerConfig.clientSecret) {
1560
+ throw new Error(`Missing OAuth credentials for ${request.provider}. Check your environment variables.`);
1561
+ }
1562
+ const url = new URL("/oauth/callback", this.serverUrl);
1563
+ const response = await fetch(url.toString(), {
1564
+ method: "POST",
1565
+ headers: {
1566
+ "Content-Type": "application/json"
1567
+ },
1568
+ body: JSON.stringify({
1569
+ provider: request.provider,
1570
+ code: request.code,
1571
+ code_verifier: request.codeVerifier,
1572
+ state: request.state,
1573
+ client_id: providerConfig.clientId,
1574
+ client_secret: providerConfig.clientSecret
1575
+ })
1576
+ });
1577
+ if (!response.ok) {
1578
+ const error = await response.text();
1579
+ throw new Error(`MCP server failed to exchange authorization code: ${error}`);
1580
+ }
1581
+ const data = await response.json();
1582
+ return data;
1583
+ }
1584
+ async handleStatus(provider, accessToken) {
1585
+ const url = new URL("/oauth/status", this.serverUrl);
1586
+ url.searchParams.set("provider", provider);
1587
+ const response = await fetch(url.toString(), {
1588
+ method: "GET",
1589
+ headers: {
1590
+ Authorization: `Bearer ${accessToken}`
1591
+ }
1592
+ });
1593
+ if (!response.ok) {
1594
+ if (response.status === 401) {
1595
+ return {
1596
+ authorized: false
1597
+ };
1598
+ }
1599
+ const error = await response.text();
1600
+ throw new Error(`MCP server failed to check authorization status: ${error}`);
1601
+ }
1602
+ const data = await response.json();
1603
+ return data;
1604
+ }
1605
+ async handleDisconnect(request, accessToken) {
1606
+ if (!accessToken) {
1607
+ throw new Error("No access token provided. Cannot disconnect provider.");
1608
+ }
1609
+ const url = new URL("/oauth/disconnect", this.serverUrl);
1610
+ const response = await fetch(url.toString(), {
1611
+ method: "POST",
1612
+ headers: {
1613
+ "Content-Type": "application/json",
1614
+ Authorization: `Bearer ${accessToken}`
1615
+ },
1616
+ body: JSON.stringify({
1617
+ provider: request.provider
1618
+ })
1619
+ });
1620
+ if (!response.ok) {
1621
+ const error = await response.text();
1622
+ throw new Error(`MCP server failed to disconnect provider: ${error}`);
1623
+ }
1624
+ const data = await response.json();
1625
+ return data;
1626
+ }
1627
+ }
1628
+
1629
+ // src/adapters/nextjs.ts
1630
+ function createNextOAuthHandler(config) {
1631
+ const handler = new OAuthHandler(config);
1632
+ const handlers = {
1633
+ async authorize(req) {
1634
+ try {
1635
+ const body = await req.json();
1636
+ const result = await handler.handleAuthorize(body);
1637
+ return Response.json(result);
1638
+ } catch (error) {
1639
+ console.error("[OAuth Authorize] Error:", error);
1640
+ return Response.json({ error: error.message || "Failed to get authorization URL" }, { status: 500 });
1641
+ }
1642
+ },
1643
+ async callback(req) {
1644
+ try {
1645
+ const body = await req.json();
1646
+ const result = await handler.handleCallback(body);
1647
+ return Response.json(result);
1648
+ } catch (error) {
1649
+ console.error("[OAuth Callback] Error:", error);
1650
+ return Response.json({ error: error.message || "Failed to exchange authorization code" }, { status: 500 });
1651
+ }
1652
+ },
1653
+ async status(req) {
1654
+ try {
1655
+ const provider = req.nextUrl.searchParams.get("provider");
1656
+ const authHeader = req.headers.get("authorization");
1657
+ if (!provider) {
1658
+ return Response.json({ error: "Missing provider query parameter" }, { status: 400 });
1659
+ }
1660
+ if (!authHeader || !authHeader.startsWith("Bearer ")) {
1661
+ return Response.json({ error: "Missing or invalid Authorization header" }, { status: 400 });
1662
+ }
1663
+ const accessToken = authHeader.substring(7);
1664
+ const result = await handler.handleStatus(provider, accessToken);
1665
+ return Response.json(result);
1666
+ } catch (error) {
1667
+ console.error("[OAuth Status] Error:", error);
1668
+ return Response.json({ error: error.message || "Failed to check authorization status" }, { status: 500 });
1669
+ }
1670
+ },
1671
+ async disconnect(req) {
1672
+ try {
1673
+ const authHeader = req.headers.get("authorization");
1674
+ if (!authHeader || !authHeader.startsWith("Bearer ")) {
1675
+ return Response.json({ error: "Missing or invalid Authorization header" }, { status: 400 });
1676
+ }
1677
+ const accessToken = authHeader.substring(7);
1678
+ const body = await req.json();
1679
+ const { provider } = body;
1680
+ if (!provider) {
1681
+ return Response.json({ error: "Missing provider in request body" }, { status: 400 });
1682
+ }
1683
+ const result = await handler.handleDisconnect({ provider }, accessToken);
1684
+ return Response.json(result);
1685
+ } catch (error) {
1686
+ console.error("[OAuth Disconnect] Error:", error);
1687
+ return Response.json({ error: error.message || "Failed to disconnect provider" }, { status: 500 });
1688
+ }
1689
+ },
1690
+ createRoutes() {
1691
+ return {
1692
+ async POST(req, context) {
1693
+ const params = context.params instanceof Promise ? await context.params : context.params;
1694
+ const action = params.action;
1695
+ if (action === "authorize") {
1696
+ return handlers.authorize(req);
1697
+ }
1698
+ if (action === "callback") {
1699
+ return handlers.callback(req);
1700
+ }
1701
+ if (action === "disconnect") {
1702
+ return handlers.disconnect(req);
1703
+ }
1704
+ return Response.json({ error: `Unknown action: ${action}` }, { status: 404 });
1705
+ },
1706
+ async GET(req, context) {
1707
+ const params = context.params instanceof Promise ? await context.params : context.params;
1708
+ const action = params.action;
1709
+ if (action === "status") {
1710
+ return handlers.status(req);
1711
+ }
1712
+ return Response.json({ error: `Unknown action: ${action}` }, { status: 404 });
1713
+ }
1714
+ };
1715
+ }
1716
+ };
1717
+ return handlers;
1718
+ }
1719
+
1729
1720
  // src/plugins/github.ts
1730
1721
  var GITHUB_TOOLS = [
1731
1722
  "github_create_issue",
@@ -1862,8 +1853,7 @@ function createMCPServer(config) {
1862
1853
  };
1863
1854
  }
1864
1855
  function createOAuthRouteHandlers(config) {
1865
- const { createNextOAuthHandler: createNextOAuthHandler2 } = (init_nextjs(), __toCommonJS(exports_nextjs));
1866
- const handler = createNextOAuthHandler2(config);
1856
+ const handler = createNextOAuthHandler(config);
1867
1857
  return handler.createRoutes();
1868
1858
  }
1869
1859
  export {
@@ -97,11 +97,12 @@ export declare class OAuthHandler {
97
97
  handleAuthorize(request: AuthorizeRequest): Promise<AuthorizeResponse>;
98
98
  /**
99
99
  * Handle OAuth callback
100
- * Exchanges authorization code for session token
100
+ * Exchanges authorization code for access token
101
101
  *
102
102
  * @param request - Callback request with authorization code
103
- * @returns Session token and authorization details
103
+ * @returns Access token and authorization details
104
104
  *
105
+ * @throws Error if provider is not configured
105
106
  * @throws Error if MCP server request fails
106
107
  */
107
108
  handleCallback(request: CallbackRequest): Promise<CallbackResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"base-handler.d.ts","sourceRoot":"","sources":["../../../src/adapters/base-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;QACxB,iDAAiD;QACjD,QAAQ,EAAE,MAAM,CAAC;QACjB,qDAAqD;QACrD,YAAY,EAAE,MAAM,CAAC;QACrB,qCAAqC;QACrC,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,qBAAa,YAAY;IAGX,OAAO,CAAC,MAAM;IAF1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;gBAExB,MAAM,EAAE,kBAAkB;IAE9C;;;;;;;;;OASG;IACG,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA0C5E;;;;;;;;OAQG;IACG,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0BzE;;;;;;;;;OASG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA4BlF;;;;;;;;;;OAUG;IACG,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2BrG"}
1
+ {"version":3,"file":"base-handler.d.ts","sourceRoot":"","sources":["../../../src/adapters/base-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;QACxB,iDAAiD;QACjD,QAAQ,EAAE,MAAM,CAAC;QACjB,qDAAqD;QACrD,YAAY,EAAE,MAAM,CAAC;QACrB,qCAAqC;QACrC,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,qBAAa,YAAY;IAGX,OAAO,CAAC,MAAM;IAF1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;gBAExB,MAAM,EAAE,kBAAkB;IAO9C;;;;;;;;;OASG;IACG,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA0C5E;;;;;;;;;OASG;IACG,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0CzE;;;;;;;;;OASG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA4BlF;;;;;;;;;;OAUG;IACG,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2BrG"}
@@ -42,9 +42,21 @@ export declare function createMCPServer<TPlugins extends readonly MCPPlugin[]>(c
42
42
  /** Server-side MCP client instance */
43
43
  client: MCPClient<TPlugins>;
44
44
  /** OAuth POST handler - export this from your route file */
45
- POST: any;
45
+ POST: (req: any, context: {
46
+ params: {
47
+ action: string;
48
+ } | Promise<{
49
+ action: string;
50
+ }>;
51
+ }) => Promise<any>;
46
52
  /** OAuth GET handler - export this from your route file */
47
- GET: any;
53
+ GET: (req: any, context: {
54
+ params: {
55
+ action: string;
56
+ } | Promise<{
57
+ action: string;
58
+ }>;
59
+ }) => Promise<any>;
48
60
  };
49
61
  export type { MCPPlugin } from './plugins/types.js';
50
62
  export type { MCPClientConfig } from './config/types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EACnE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC;IA4C/B,sCAAsC;;IAGtC,4DAA4D;;IAG5D,2DAA2D;;EAG9D;AAaD,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EACnE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC;IA4C/B,sCAAsC;;IAGtC,4DAA4D;;;;;;;;IAG5D,2DAA2D;;;;;;;;EAG9D;AAYD,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integrate-sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Type-safe TypeScript SDK for MCP Client with plugin-based OAuth provider configuration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,8 +43,7 @@
43
43
  "test:watch": "bun test --watch tests/",
44
44
  "test:unit": "bun test tests/protocol tests/plugins tests/client tests/integrations tests/oauth tests/transport tests/utils tests/errors",
45
45
  "test:integration": "bun test tests/integration/simple-integration.test.ts",
46
- "test:coverage": "bun test --coverage tests/",
47
- "prepare": "simple-git-hooks"
46
+ "test:coverage": "bun test --coverage tests/"
48
47
  },
49
48
  "keywords": [
50
49
  "mcp",