@lovable.dev/mcp-js 0.26.2 → 0.27.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.
- package/dist/{authorize-D3zzoTAG.d.cts → authorize-BcNuNPtP.d.cts} +15 -3
- package/dist/{authorize-Y6Jm8GhR.d.ts → authorize-Cs1yyLrq.d.ts} +15 -3
- package/dist/{cors-DPRJFY-U.cjs → authorize-FZydvyMU.cjs} +36 -35
- package/dist/{cors-DnU41czH.js → authorize-KzrdWb2-.js} +33 -26
- package/dist/cli/extract-manifest.cjs +2 -2
- package/dist/cli/extract-manifest.js +2 -2
- package/dist/{forwarded-Pi8Hs5Ps.cjs → forwarded-Bhwcj22u.cjs} +2 -2
- package/dist/{forwarded--h4efJy-.js → forwarded-BlLF3dfc.js} +2 -2
- package/dist/gate-Blmxv8t2.cjs +24 -0
- package/dist/gate-Cclvf6xn.js +19 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/{io-B-fV6rsM.d.ts → io--MeYrWG7.d.ts} +1 -1
- package/dist/{io-Bd58IeVb.d.cts → io-BzTGjG_c.d.cts} +1 -1
- package/dist/{list-tools-C6u8G4iq.d.ts → list-tools-Bku6XkVc.d.ts} +1 -1
- package/dist/{list-tools-DCs034XG.js → list-tools-CCGzOMpC.js} +8 -13
- package/dist/{list-tools-DOBMd4AE.d.cts → list-tools-Cn7tpE0V.d.cts} +1 -1
- package/dist/{list-tools-ka32VIXt.cjs → list-tools-DDhzQZRL.cjs} +9 -14
- package/dist/{logger-BSKbuM66.cjs → logger-BkMMCFTv.cjs} +3 -0
- package/dist/{logger-3-kwsF-5.js → logger-rGakBvJ1.js} +3 -0
- package/dist/{mcp-C9fh9I8u.cjs → mcp-BLYbUCO5.cjs} +17 -18
- package/dist/{mcp-DlcYgsv9.js → mcp-Di8hVnwC.js} +12 -13
- package/dist/{package-CBvVzH3w.cjs → package-9XZJumh0.cjs} +1 -1
- package/dist/{package-Bbg8XwRW.js → package-BmhaKMyb.js} +1 -1
- package/dist/protocols/mcp/index.cjs +1 -1
- package/dist/protocols/mcp/index.d.cts +1 -1
- package/dist/protocols/mcp/index.d.ts +1 -1
- package/dist/protocols/mcp/index.js +1 -1
- package/dist/protocols/oauth-metadata.cjs +25 -17
- package/dist/protocols/oauth-metadata.d.cts +1 -1
- package/dist/protocols/oauth-metadata.d.ts +1 -1
- package/dist/protocols/oauth-metadata.js +21 -13
- package/dist/protocols/rest/index.cjs +2 -2
- package/dist/protocols/rest/index.d.cts +2 -2
- package/dist/protocols/rest/index.d.ts +2 -2
- package/dist/protocols/rest/index.js +2 -2
- package/dist/{rest-Di-HJGi6.js → rest-DUQqIlzT.js} +11 -11
- package/dist/{rest-BpFG5VRY.cjs → rest-Hr1H57re.cjs} +23 -23
- package/dist/stacks/supabase/index.cjs +16 -15
- package/dist/stacks/supabase/index.js +14 -13
- package/dist/stacks/supabase/vite.cjs +1 -1
- package/dist/stacks/supabase/vite.d.cts +1 -1
- package/dist/stacks/supabase/vite.d.ts +1 -1
- package/dist/stacks/supabase/vite.js +1 -1
- package/dist/stacks/tanstack/index.cjs +9 -12
- package/dist/stacks/tanstack/index.d.cts +1 -1
- package/dist/stacks/tanstack/index.d.ts +1 -1
- package/dist/stacks/tanstack/index.js +9 -12
- package/dist/stacks/tanstack/vite.cjs +6 -2
- package/dist/stacks/tanstack/vite.d.cts +1 -1
- package/dist/stacks/tanstack/vite.d.ts +1 -1
- package/dist/stacks/tanstack/vite.js +6 -2
- package/package.json +1 -1
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_mcp = require("../../mcp-
|
|
2
|
+
const require_authorize = require("../../authorize-FZydvyMU.cjs");
|
|
3
|
+
const require_mcp = require("../../mcp-BLYbUCO5.cjs");
|
|
4
4
|
const require_protocols_oauth_metadata = require("../../protocols/oauth-metadata.cjs");
|
|
5
|
-
const require_list_tools = require("../../list-tools-
|
|
6
|
-
const require_rest = require("../../rest-
|
|
7
|
-
const require_forwarded = require("../../forwarded-
|
|
5
|
+
const require_list_tools = require("../../list-tools-DDhzQZRL.cjs");
|
|
6
|
+
const require_rest = require("../../rest-Hr1H57re.cjs");
|
|
7
|
+
const require_forwarded = require("../../forwarded-Bhwcj22u.cjs");
|
|
8
8
|
//#region src/stacks/tanstack/handlers.ts
|
|
9
9
|
const STACK = "tanstack";
|
|
10
|
-
function forwarded(request, options) {
|
|
11
|
-
return require_forwarded.applyForwardedOrigin(request, { trustForwardedHost: options.trustForwardedHost });
|
|
12
|
-
}
|
|
13
10
|
/**
|
|
14
11
|
* Build a TanStack Start handler for the MCP protocol endpoint
|
|
15
12
|
* (`POST /mcp`). Assignable directly to a route's `ANY` handler.
|
|
16
13
|
*/
|
|
17
14
|
function createTanStackMcpHandler(mcp, options = {}) {
|
|
18
15
|
const handler = require_mcp.createMcpProtocolHandler(mcp, options);
|
|
19
|
-
return ({ request }) => handler(
|
|
16
|
+
return ({ request }) => handler(require_forwarded.applyForwardedOrigin(request, options), require_authorize.createRecorderForRuntime(mcp, { stack: STACK }));
|
|
20
17
|
}
|
|
21
18
|
/**
|
|
22
19
|
* Build a TanStack Start handler for `GET /.mcp/list-tools`. Returns the
|
|
@@ -24,7 +21,7 @@ function createTanStackMcpHandler(mcp, options = {}) {
|
|
|
24
21
|
*/
|
|
25
22
|
function createTanStackListToolsHandler(mcp, options = {}) {
|
|
26
23
|
const handler = require_list_tools.createListToolsHandler(mcp, options);
|
|
27
|
-
return ({ request }) => handler(
|
|
24
|
+
return ({ request }) => handler(require_forwarded.applyForwardedOrigin(request, options), require_authorize.createRecorderForRuntime(mcp, { stack: STACK }));
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
27
|
* Build a TanStack Start handler for `POST /.mcp/invoke-tool/$tool`.
|
|
@@ -33,7 +30,7 @@ function createTanStackListToolsHandler(mcp, options = {}) {
|
|
|
33
30
|
*/
|
|
34
31
|
function createTanStackInvokeToolHandler(mcp, options = {}) {
|
|
35
32
|
const handler = require_rest.createInvokeToolHandler(mcp, options);
|
|
36
|
-
return ({ request, params }) => handler(
|
|
33
|
+
return ({ request, params }) => handler(require_forwarded.applyForwardedOrigin(request, options), params.tool, require_authorize.createRecorderForRuntime(mcp, { stack: STACK }));
|
|
37
34
|
}
|
|
38
35
|
/**
|
|
39
36
|
* Build a TanStack Start handler for `GET /.well-known/oauth-protected-resource`.
|
|
@@ -41,7 +38,7 @@ function createTanStackInvokeToolHandler(mcp, options = {}) {
|
|
|
41
38
|
*/
|
|
42
39
|
function createTanStackOAuthProtectedResourceMetadataHandler(mcp, options = {}) {
|
|
43
40
|
const handler = require_protocols_oauth_metadata.createOAuthProtectedResourceMetadataHandler(mcp, options);
|
|
44
|
-
return ({ request }) => handler(
|
|
41
|
+
return ({ request }) => handler(require_forwarded.applyForwardedOrigin(request, options));
|
|
45
42
|
}
|
|
46
43
|
//#endregion
|
|
47
44
|
exports.createTanStackInvokeToolHandler = createTanStackInvokeToolHandler;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as McpDefinition } from "../../types-C0Wgm9zp.cjs";
|
|
2
|
-
import { t as McpRuntimeOptions } from "../../authorize-
|
|
2
|
+
import { t as McpRuntimeOptions } from "../../authorize-BcNuNPtP.cjs";
|
|
3
3
|
//#region src/stacks/tanstack/handlers.d.ts
|
|
4
4
|
interface TanStackRouteCtx {
|
|
5
5
|
request: Request;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as McpDefinition } from "../../types-C0Wgm9zp.js";
|
|
2
|
-
import { t as McpRuntimeOptions } from "../../authorize-
|
|
2
|
+
import { t as McpRuntimeOptions } from "../../authorize-Cs1yyLrq.js";
|
|
3
3
|
//#region src/stacks/tanstack/handlers.d.ts
|
|
4
4
|
interface TanStackRouteCtx {
|
|
5
5
|
request: Request;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createMcpProtocolHandler } from "../../mcp-
|
|
1
|
+
import { s as createRecorderForRuntime } from "../../authorize-KzrdWb2-.js";
|
|
2
|
+
import { t as createMcpProtocolHandler } from "../../mcp-Di8hVnwC.js";
|
|
3
3
|
import { createOAuthProtectedResourceMetadataHandler } from "../../protocols/oauth-metadata.js";
|
|
4
|
-
import { n as createListToolsHandler } from "../../list-tools-
|
|
5
|
-
import { t as createInvokeToolHandler } from "../../rest-
|
|
6
|
-
import { t as applyForwardedOrigin } from "../../forwarded
|
|
4
|
+
import { n as createListToolsHandler } from "../../list-tools-CCGzOMpC.js";
|
|
5
|
+
import { t as createInvokeToolHandler } from "../../rest-DUQqIlzT.js";
|
|
6
|
+
import { t as applyForwardedOrigin } from "../../forwarded-BlLF3dfc.js";
|
|
7
7
|
//#region src/stacks/tanstack/handlers.ts
|
|
8
8
|
const STACK = "tanstack";
|
|
9
|
-
function forwarded(request, options) {
|
|
10
|
-
return applyForwardedOrigin(request, { trustForwardedHost: options.trustForwardedHost });
|
|
11
|
-
}
|
|
12
9
|
/**
|
|
13
10
|
* Build a TanStack Start handler for the MCP protocol endpoint
|
|
14
11
|
* (`POST /mcp`). Assignable directly to a route's `ANY` handler.
|
|
15
12
|
*/
|
|
16
13
|
function createTanStackMcpHandler(mcp, options = {}) {
|
|
17
14
|
const handler = createMcpProtocolHandler(mcp, options);
|
|
18
|
-
return ({ request }) => handler(
|
|
15
|
+
return ({ request }) => handler(applyForwardedOrigin(request, options), createRecorderForRuntime(mcp, { stack: STACK }));
|
|
19
16
|
}
|
|
20
17
|
/**
|
|
21
18
|
* Build a TanStack Start handler for `GET /.mcp/list-tools`. Returns the
|
|
@@ -23,7 +20,7 @@ function createTanStackMcpHandler(mcp, options = {}) {
|
|
|
23
20
|
*/
|
|
24
21
|
function createTanStackListToolsHandler(mcp, options = {}) {
|
|
25
22
|
const handler = createListToolsHandler(mcp, options);
|
|
26
|
-
return ({ request }) => handler(
|
|
23
|
+
return ({ request }) => handler(applyForwardedOrigin(request, options), createRecorderForRuntime(mcp, { stack: STACK }));
|
|
27
24
|
}
|
|
28
25
|
/**
|
|
29
26
|
* Build a TanStack Start handler for `POST /.mcp/invoke-tool/$tool`.
|
|
@@ -32,7 +29,7 @@ function createTanStackListToolsHandler(mcp, options = {}) {
|
|
|
32
29
|
*/
|
|
33
30
|
function createTanStackInvokeToolHandler(mcp, options = {}) {
|
|
34
31
|
const handler = createInvokeToolHandler(mcp, options);
|
|
35
|
-
return ({ request, params }) => handler(
|
|
32
|
+
return ({ request, params }) => handler(applyForwardedOrigin(request, options), params.tool, createRecorderForRuntime(mcp, { stack: STACK }));
|
|
36
33
|
}
|
|
37
34
|
/**
|
|
38
35
|
* Build a TanStack Start handler for `GET /.well-known/oauth-protected-resource`.
|
|
@@ -40,7 +37,7 @@ function createTanStackInvokeToolHandler(mcp, options = {}) {
|
|
|
40
37
|
*/
|
|
41
38
|
function createTanStackOAuthProtectedResourceMetadataHandler(mcp, options = {}) {
|
|
42
39
|
const handler = createOAuthProtectedResourceMetadataHandler(mcp, options);
|
|
43
|
-
return ({ request }) => handler(
|
|
40
|
+
return ({ request }) => handler(applyForwardedOrigin(request, options));
|
|
44
41
|
}
|
|
45
42
|
//#endregion
|
|
46
43
|
export { createTanStackInvokeToolHandler, createTanStackListToolsHandler, createTanStackMcpHandler, createTanStackOAuthProtectedResourceMetadataHandler };
|
|
@@ -84,7 +84,10 @@ function buildRouteSource(route, resourcePath, metadataPath, trustForwardedHost,
|
|
|
84
84
|
const note = route.spaFallbackNote ? " // ANY: TanStack returns SPA HTML for methods not in `handlers`; the SDK 405s instead.\n" : "";
|
|
85
85
|
const optionEntries = [`resourcePath: "${resourcePath}"`];
|
|
86
86
|
if (metadataPath !== void 0) optionEntries.push(`metadataPath: "${metadataPath}"`);
|
|
87
|
-
if (trustForwardedHost)
|
|
87
|
+
if (trustForwardedHost) {
|
|
88
|
+
optionEntries.push("trustForwardedHost: true");
|
|
89
|
+
if (route.attestsForwardedHost) optionEntries.push("forwardedHostTrustedByPlatform: true");
|
|
90
|
+
}
|
|
88
91
|
const runtimeOptions = `{ ${optionEntries.join(", ")} }`;
|
|
89
92
|
return `${GENERATED_BANNER}
|
|
90
93
|
// route: ${route.routeLiteral}
|
|
@@ -210,7 +213,8 @@ function mcpPlugin(options = {}) {
|
|
|
210
213
|
if (emitProtectedResourceMetadataRoute) routes.push({
|
|
211
214
|
file: metadataRouteFile,
|
|
212
215
|
routeLiteral: metadataUrlPath,
|
|
213
|
-
handlerFactory: "createTanStackOAuthProtectedResourceMetadataHandler"
|
|
216
|
+
handlerFactory: "createTanStackOAuthProtectedResourceMetadataHandler",
|
|
217
|
+
attestsForwardedHost: true
|
|
214
218
|
});
|
|
215
219
|
if (emitRestRoutes) routes.push({
|
|
216
220
|
file: listToolsRouteFile,
|
|
@@ -80,7 +80,10 @@ function buildRouteSource(route, resourcePath, metadataPath, trustForwardedHost,
|
|
|
80
80
|
const note = route.spaFallbackNote ? " // ANY: TanStack returns SPA HTML for methods not in `handlers`; the SDK 405s instead.\n" : "";
|
|
81
81
|
const optionEntries = [`resourcePath: "${resourcePath}"`];
|
|
82
82
|
if (metadataPath !== void 0) optionEntries.push(`metadataPath: "${metadataPath}"`);
|
|
83
|
-
if (trustForwardedHost)
|
|
83
|
+
if (trustForwardedHost) {
|
|
84
|
+
optionEntries.push("trustForwardedHost: true");
|
|
85
|
+
if (route.attestsForwardedHost) optionEntries.push("forwardedHostTrustedByPlatform: true");
|
|
86
|
+
}
|
|
84
87
|
const runtimeOptions = `{ ${optionEntries.join(", ")} }`;
|
|
85
88
|
return `${GENERATED_BANNER}
|
|
86
89
|
// route: ${route.routeLiteral}
|
|
@@ -206,7 +209,8 @@ function mcpPlugin(options = {}) {
|
|
|
206
209
|
if (emitProtectedResourceMetadataRoute) routes.push({
|
|
207
210
|
file: metadataRouteFile,
|
|
208
211
|
routeLiteral: metadataUrlPath,
|
|
209
|
-
handlerFactory: "createTanStackOAuthProtectedResourceMetadataHandler"
|
|
212
|
+
handlerFactory: "createTanStackOAuthProtectedResourceMetadataHandler",
|
|
213
|
+
attestsForwardedHost: true
|
|
210
214
|
});
|
|
211
215
|
if (emitRestRoutes) routes.push({
|
|
212
216
|
file: listToolsRouteFile,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovable.dev/mcp-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Author MCP servers for Lovable apps. Declare tools with defineTool, register them in defineMcp, and a framework adapter (TanStack or Supabase Edge Functions) emits the route(s) at build time.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|