@lovable.dev/mcp-js 0.10.0 → 0.10.1

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.
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.10.0";
2
+ var version = "0.10.1";
3
3
 
4
4
  export {
5
5
  version
@@ -13,7 +13,7 @@ function isFileMissing(err) {
13
13
  }
14
14
 
15
15
  // package.json
16
- var version = "0.10.0";
16
+ var version = "0.10.1";
17
17
 
18
18
  // src/protocols/rest/list-tools.ts
19
19
  var import_zod_compat = require("@modelcontextprotocol/sdk/server/zod-compat.js");
@@ -7,7 +7,7 @@ import "../chunk-QC3DXQTH.js";
7
7
  import "../chunk-6DXGZZA4.js";
8
8
  import {
9
9
  version
10
- } from "../chunk-4XJ2R3DD.js";
10
+ } from "../chunk-D6KB4Q7R.js";
11
11
  import {
12
12
  isFileMissing
13
13
  } from "../chunk-Y3ZFPEQH.js";
@@ -908,6 +908,16 @@ function dispatchFor(pathname) {
908
908
  }
909
909
  return { kind: "mcp" };
910
910
  }
911
+ function applyForwardedProto(request) {
912
+ const proto = request.headers.get("x-forwarded-proto")?.split(",")[0]?.trim();
913
+ if (!proto)
914
+ return request;
915
+ const url = new URL(request.url);
916
+ if (`${proto}:` === url.protocol)
917
+ return request;
918
+ url.protocol = `${proto}:`;
919
+ return new Request(url.href, request);
920
+ }
911
921
  function createSupabaseHandler(mcp, options = {}) {
912
922
  const resourcePath = deriveResourcePath(options);
913
923
  if (resourcePath !== void 0)
@@ -920,16 +930,17 @@ function createSupabaseHandler(mcp, options = {}) {
920
930
  const invokeToolHandler = createInvokeToolHandler(mcp, runtimeOptions);
921
931
  const metadataHandler = createOAuthProtectedResourceMetadataHandler(mcp, runtimeOptions);
922
932
  return async (request) => {
923
- const target = dispatchFor(new URL(request.url).pathname);
933
+ const req = applyForwardedProto(request);
934
+ const target = dispatchFor(new URL(req.url).pathname);
924
935
  switch (target.kind) {
925
936
  case "metadata":
926
- return metadataHandler(request);
937
+ return metadataHandler(req);
927
938
  case "list-tools":
928
- return listToolsHandler(request);
939
+ return listToolsHandler(req);
929
940
  case "invoke-tool":
930
- return invokeToolHandler(request, target.toolName);
941
+ return invokeToolHandler(req, target.toolName);
931
942
  case "mcp":
932
- return mcpHandler(request);
943
+ return mcpHandler(req);
933
944
  }
934
945
  };
935
946
  }
@@ -54,6 +54,16 @@ function dispatchFor(pathname) {
54
54
  }
55
55
  return { kind: "mcp" };
56
56
  }
57
+ function applyForwardedProto(request) {
58
+ const proto = request.headers.get("x-forwarded-proto")?.split(",")[0]?.trim();
59
+ if (!proto)
60
+ return request;
61
+ const url = new URL(request.url);
62
+ if (`${proto}:` === url.protocol)
63
+ return request;
64
+ url.protocol = `${proto}:`;
65
+ return new Request(url.href, request);
66
+ }
57
67
  function createSupabaseHandler(mcp, options = {}) {
58
68
  const resourcePath = deriveResourcePath(options);
59
69
  if (resourcePath !== void 0)
@@ -66,16 +76,17 @@ function createSupabaseHandler(mcp, options = {}) {
66
76
  const invokeToolHandler = createInvokeToolHandler(mcp, runtimeOptions);
67
77
  const metadataHandler = createOAuthProtectedResourceMetadataHandler(mcp, runtimeOptions);
68
78
  return async (request) => {
69
- const target = dispatchFor(new URL(request.url).pathname);
79
+ const req = applyForwardedProto(request);
80
+ const target = dispatchFor(new URL(req.url).pathname);
70
81
  switch (target.kind) {
71
82
  case "metadata":
72
- return metadataHandler(request);
83
+ return metadataHandler(req);
73
84
  case "list-tools":
74
- return listToolsHandler(request);
85
+ return listToolsHandler(req);
75
86
  case "invoke-tool":
76
- return invokeToolHandler(request, target.toolName);
87
+ return invokeToolHandler(req, target.toolName);
77
88
  case "mcp":
78
- return mcpHandler(request);
89
+ return mcpHandler(req);
79
90
  }
80
91
  };
81
92
  }
@@ -31,7 +31,7 @@ var import_node_fs = require("fs");
31
31
  var import_node_path = require("path");
32
32
 
33
33
  // package.json
34
- var version = "0.10.0";
34
+ var version = "0.10.1";
35
35
 
36
36
  // src/core/fs-errors.ts
37
37
  function isFileMissing(err) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  version
3
- } from "../../chunk-4XJ2R3DD.js";
3
+ } from "../../chunk-D6KB4Q7R.js";
4
4
  import {
5
5
  isFileMissing
6
6
  } from "../../chunk-Y3ZFPEQH.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/mcp-js",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
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": {