@lovable.dev/mcp-js 2.2.1 → 2.3.0-rc.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.
@@ -8,6 +8,8 @@ type InvocationOutcome = "ok" | "tool_error" | "handler_error" | "transport_erro
8
8
  interface InvocationRecord {
9
9
  /** Tool name for `tools/call`; `null` for list/initialize, transport faults, and `authorize` records. */
10
10
  tool: string | null;
11
+ /** Whether the invoked tool declares `enabled` (caller-dependent visibility). Set on `tools/call` records only. */
12
+ toolConditional?: boolean;
11
13
  /** JSON-RPC method, e.g. `tools/call`; `authorize` for records from the authorization gate. */
12
14
  method: string;
13
15
  outcome: InvocationOutcome;
@@ -8,6 +8,8 @@ type InvocationOutcome = "ok" | "tool_error" | "handler_error" | "transport_erro
8
8
  interface InvocationRecord {
9
9
  /** Tool name for `tools/call`; `null` for list/initialize, transport faults, and `authorize` records. */
10
10
  tool: string | null;
11
+ /** Whether the invoked tool declares `enabled` (caller-dependent visibility). Set on `tools/call` records only. */
12
+ toolConditional?: boolean;
11
13
  /** JSON-RPC method, e.g. `tools/call`; `authorize` for records from the authorization gate. */
12
14
  method: string;
13
15
  outcome: InvocationOutcome;
@@ -4,7 +4,7 @@ const projectRoot = process.argv[2] ?? process.cwd();
4
4
  import("zod/v3").catch((err) => {
5
5
  const message = err instanceof Error ? err.message : String(err);
6
6
  throw new Error(`@lovable.dev/mcp-js requires zod ^3.25 or ^4.0 to extract MCP schemas. Verify the project's zod dependency and package resolution, then try again. Underlying error: ${message}`);
7
- }).then(() => Promise.resolve().then(() => require("../io-DlrcWviC.cjs"))).then(({ runExtract }) => runExtract(projectRoot)).catch((err) => {
7
+ }).then(() => Promise.resolve().then(() => require("../io-DxLf7FOs.cjs"))).then(({ runExtract }) => runExtract(projectRoot)).catch((err) => {
8
8
  console.error(err instanceof Error ? err.message : String(err));
9
9
  process.exit(1);
10
10
  });
@@ -4,7 +4,7 @@ const projectRoot = process.argv[2] ?? process.cwd();
4
4
  import("zod/v3").catch((err) => {
5
5
  const message = err instanceof Error ? err.message : String(err);
6
6
  throw new Error(`@lovable.dev/mcp-js requires zod ^3.25 or ^4.0 to extract MCP schemas. Verify the project's zod dependency and package resolution, then try again. Underlying error: ${message}`);
7
- }).then(() => import("../io-BOWAT0Iz.js")).then(({ runExtract }) => runExtract(projectRoot)).catch((err) => {
7
+ }).then(() => import("../io-UxEAweJm.js")).then(({ runExtract }) => runExtract(projectRoot)).catch((err) => {
8
8
  console.error(err instanceof Error ? err.message : String(err));
9
9
  process.exit(1);
10
10
  });
@@ -1,5 +1,5 @@
1
1
  import { i as log, n as applyLogLevelFromEnv, o as parseSafeUrl, r as describeError, s as trimTrailingSlash, t as LOG_LEVEL_ENV_VAR, u as resolveMetricsConfig } from "./logger-CpLgYbCG.js";
2
- import { t as version } from "./package-CCAqM_QG.js";
2
+ import { t as version } from "./package-BIMX8UD1.js";
3
3
  import "./metadata-path-CAkNcfyY.js";
4
4
  import { createLocalJWKSet, decodeProtectedHeader, errors, jwtVerify } from "jose";
5
5
  //#region src/core/http.ts
@@ -43,6 +43,12 @@ function intAttr(key, value) {
43
43
  value: { intValue: String(Math.round(value)) }
44
44
  };
45
45
  }
46
+ function boolAttr(key, value) {
47
+ return {
48
+ key,
49
+ value: { boolValue: value }
50
+ };
51
+ }
46
52
  function toLogRecord(rec) {
47
53
  const eventName = rec.method === "authorize" ? GATE_EVENT_NAME : TOOL_EVENT_NAME;
48
54
  const attributes = [
@@ -52,6 +58,7 @@ function toLogRecord(rec) {
52
58
  intAttr("mcp.duration_ms", rec.durationMs)
53
59
  ];
54
60
  if (rec.tool !== null) attributes.push(strAttr("mcp.tool", rec.tool));
61
+ if (rec.toolConditional !== void 0) attributes.push(boolAttr("mcp.tool_conditional", rec.toolConditional));
55
62
  if (rec.reqBytes !== void 0) attributes.push(intAttr("mcp.request_size_bytes", rec.reqBytes));
56
63
  if (rec.resBytes !== void 0) attributes.push(intAttr("mcp.response_size_bytes", rec.resBytes));
57
64
  if (rec.httpMethod !== void 0) attributes.push(strAttr("http.request.method", rec.httpMethod));
@@ -1,5 +1,5 @@
1
1
  const require_logger = require("./logger-C-Hdu57K.cjs");
2
- const require_package = require("./package-CqbJU3uS.cjs");
2
+ const require_package = require("./package-B7AqV9_M.cjs");
3
3
  require("./metadata-path-zd7NSNoa.cjs");
4
4
  let jose = require("jose");
5
5
  //#region src/core/http.ts
@@ -43,6 +43,12 @@ function intAttr(key, value) {
43
43
  value: { intValue: String(Math.round(value)) }
44
44
  };
45
45
  }
46
+ function boolAttr(key, value) {
47
+ return {
48
+ key,
49
+ value: { boolValue: value }
50
+ };
51
+ }
46
52
  function toLogRecord(rec) {
47
53
  const eventName = rec.method === "authorize" ? GATE_EVENT_NAME : TOOL_EVENT_NAME;
48
54
  const attributes = [
@@ -52,6 +58,7 @@ function toLogRecord(rec) {
52
58
  intAttr("mcp.duration_ms", rec.durationMs)
53
59
  ];
54
60
  if (rec.tool !== null) attributes.push(strAttr("mcp.tool", rec.tool));
61
+ if (rec.toolConditional !== void 0) attributes.push(boolAttr("mcp.tool_conditional", rec.toolConditional));
55
62
  if (rec.reqBytes !== void 0) attributes.push(intAttr("mcp.request_size_bytes", rec.reqBytes));
56
63
  if (rec.resBytes !== void 0) attributes.push(intAttr("mcp.response_size_bytes", rec.resBytes));
57
64
  if (rec.httpMethod !== void 0) attributes.push(strAttr("http.request.method", rec.httpMethod));
@@ -1,5 +1,5 @@
1
1
  const require_schema = require("./schema-D3vClxb7.cjs");
2
- const require_package = require("./package-CqbJU3uS.cjs");
2
+ const require_package = require("./package-B7AqV9_M.cjs");
3
3
  const require_fs_errors = require("./fs-errors-CWNzOV75.cjs");
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
@@ -1,5 +1,5 @@
1
1
  import { t as jsonSchemaFromDefinition } from "./schema-CW1jKvio.js";
2
- import { t as version } from "./package-CCAqM_QG.js";
2
+ import { t as version } from "./package-BIMX8UD1.js";
3
3
  import { t as isFileMissing } from "./fs-errors-PA2t1TIp.js";
4
4
  import { lstatSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
5
5
  import { dirname, resolve } from "node:path";
@@ -1,7 +1,7 @@
1
1
  import { i as log, r as describeError } from "./logger-CpLgYbCG.js";
2
2
  import { n as schemaFromDefinition, t as jsonSchemaFromDefinition } from "./schema-CW1jKvio.js";
3
3
  import { a as ToolContext, c as toolRequiresAppContext, i as AuthContext, n as errorSummary, r as resolveToolErrorMessage } from "./errors-DGcJ8jPK.js";
4
- import { d as nowMs, i as normalizeHttpMethod, l as emitBeforeResponse, n as createRequestAuthorizer, p as finalizeWireResponse, t as evaluateCors, u as createNoopRecorder } from "./cors-B0M7vKyd.js";
4
+ import { d as nowMs, i as normalizeHttpMethod, l as emitBeforeResponse, n as createRequestAuthorizer, p as finalizeWireResponse, t as evaluateCors, u as createNoopRecorder } from "./cors-B5UCWZP6.js";
5
5
  import { getParseErrorMessage, safeParseAsync } from "@modelcontextprotocol/sdk/server/zod-compat.js";
6
6
  import { CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, McpServer, createMcpHandler } from "@modelcontextprotocol/server";
7
7
  //#region src/core/content.ts
@@ -239,6 +239,7 @@ function toolRequestContext(sdkCtx, protocol) {
239
239
  }
240
240
  async function invokeTool(tool, auth, recorder, args, protocol, sdkCtx, appContext) {
241
241
  const endUserId = auth?.principal.sub;
242
+ const toolConditional = tool.enabled !== void 0;
242
243
  const start = nowMs();
243
244
  let result;
244
245
  try {
@@ -248,6 +249,7 @@ async function invokeTool(tool, auth, recorder, args, protocol, sdkCtx, appConte
248
249
  if (callerMessage === void 0) {
249
250
  await recorder.emit({
250
251
  tool: tool.name,
252
+ toolConditional,
251
253
  method: "tools/call",
252
254
  outcome: "handler_error",
253
255
  durationMs: nowMs() - start,
@@ -274,6 +276,7 @@ async function invokeTool(tool, auth, recorder, args, protocol, sdkCtx, appConte
274
276
  if (result == null) {
275
277
  await recorder.emit({
276
278
  tool: tool.name,
279
+ toolConditional,
277
280
  method: "tools/call",
278
281
  outcome: "handler_error",
279
282
  durationMs: nowMs() - start,
@@ -291,6 +294,7 @@ async function invokeTool(tool, auth, recorder, args, protocol, sdkCtx, appConte
291
294
  result = await finalizeToolResult(tool, result);
292
295
  await recorder.emit({
293
296
  tool: tool.name,
297
+ toolConditional,
294
298
  method: "tools/call",
295
299
  outcome: result.isError ? "tool_error" : "ok",
296
300
  durationMs: nowMs() - start,
@@ -1,7 +1,7 @@
1
1
  const require_logger = require("./logger-C-Hdu57K.cjs");
2
2
  const require_schema = require("./schema-D3vClxb7.cjs");
3
3
  const require_errors = require("./errors-CpTdzogX.cjs");
4
- const require_cors = require("./cors-B7bfc6Vl.cjs");
4
+ const require_cors = require("./cors-CKlBOP47.cjs");
5
5
  let _modelcontextprotocol_sdk_server_zod_compat_js = require("@modelcontextprotocol/sdk/server/zod-compat.js");
6
6
  let _modelcontextprotocol_server = require("@modelcontextprotocol/server");
7
7
  //#region src/core/content.ts
@@ -239,6 +239,7 @@ function toolRequestContext(sdkCtx, protocol) {
239
239
  }
240
240
  async function invokeTool(tool, auth, recorder, args, protocol, sdkCtx, appContext) {
241
241
  const endUserId = auth?.principal.sub;
242
+ const toolConditional = tool.enabled !== void 0;
242
243
  const start = require_cors.nowMs();
243
244
  let result;
244
245
  try {
@@ -248,6 +249,7 @@ async function invokeTool(tool, auth, recorder, args, protocol, sdkCtx, appConte
248
249
  if (callerMessage === void 0) {
249
250
  await recorder.emit({
250
251
  tool: tool.name,
252
+ toolConditional,
251
253
  method: "tools/call",
252
254
  outcome: "handler_error",
253
255
  durationMs: require_cors.nowMs() - start,
@@ -274,6 +276,7 @@ async function invokeTool(tool, auth, recorder, args, protocol, sdkCtx, appConte
274
276
  if (result == null) {
275
277
  await recorder.emit({
276
278
  tool: tool.name,
279
+ toolConditional,
277
280
  method: "tools/call",
278
281
  outcome: "handler_error",
279
282
  durationMs: require_cors.nowMs() - start,
@@ -291,6 +294,7 @@ async function invokeTool(tool, auth, recorder, args, protocol, sdkCtx, appConte
291
294
  result = await finalizeToolResult(tool, result);
292
295
  await recorder.emit({
293
296
  tool: tool.name,
297
+ toolConditional,
294
298
  method: "tools/call",
295
299
  outcome: result.isError ? "tool_error" : "ok",
296
300
  durationMs: require_cors.nowMs() - start,
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "2.2.1";
2
+ var version = "2.3.0-rc.0";
3
3
  //#endregion
4
4
  Object.defineProperty(exports, "version", {
5
5
  enumerable: true,
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "2.2.1";
2
+ var version = "2.3.0-rc.0";
3
3
  //#endregion
4
4
  export { version as t };
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_mcp = require("../../mcp-Bzsp56bG.cjs");
2
+ const require_mcp = require("../../mcp-BbmNNsKS.cjs");
3
3
  exports.createMcpProtocolHandler = require_mcp.createMcpProtocolHandler;
@@ -1,5 +1,5 @@
1
1
  import { m as McpDefinition } from "../../types-BCKyT2wb.cjs";
2
- import { t as MetricsRecorder } from "../../base-Bmw6Wrb-.cjs";
2
+ import { t as MetricsRecorder } from "../../base-DaJKVZG_.cjs";
3
3
  import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-BmYO5_-I.cjs";
4
4
  //#region src/protocols/mcp/protocol.d.ts
5
5
  type McpProtocolHandler = (request: Request, recorder?: MetricsRecorder, scheduleBackground?: ScheduleBackground) => Promise<Response>;
@@ -1,5 +1,5 @@
1
1
  import { m as McpDefinition } from "../../types-BCKyT2wb.js";
2
- import { t as MetricsRecorder } from "../../base-BAxrhVjq.js";
2
+ import { t as MetricsRecorder } from "../../base-BFfwU5co.js";
3
3
  import { n as ScheduleBackground, t as McpRuntimeOptions } from "../../authorize-d9-8n9u3.js";
4
4
  //#region src/protocols/mcp/protocol.d.ts
5
5
  type McpProtocolHandler = (request: Request, recorder?: MetricsRecorder, scheduleBackground?: ScheduleBackground) => Promise<Response>;
@@ -1,2 +1,2 @@
1
- import { t as createMcpProtocolHandler } from "../../mcp-D_3G4xwX.js";
1
+ import { t as createMcpProtocolHandler } from "../../mcp-BDxzJ-ed.js";
2
2
  export { createMcpProtocolHandler };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_logger = require("../logger-C-Hdu57K.cjs");
3
- const require_cors = require("../cors-B7bfc6Vl.cjs");
3
+ const require_cors = require("../cors-CKlBOP47.cjs");
4
4
  //#region src/protocols/oauth-metadata.ts
5
5
  function notFound() {
6
6
  return new Response(JSON.stringify({ error: "not found" }), {
@@ -1,5 +1,5 @@
1
1
  import { m as McpDefinition } from "../types-BCKyT2wb.cjs";
2
- import { t as MetricsRecorder } from "../base-Bmw6Wrb-.cjs";
2
+ import { t as MetricsRecorder } from "../base-DaJKVZG_.cjs";
3
3
  import { n as ScheduleBackground, t as McpRuntimeOptions } from "../authorize-BmYO5_-I.cjs";
4
4
  //#region src/protocols/oauth-metadata.d.ts
5
5
  type OAuthProtectedResourceMetadataHandler = (request: Request, recorder?: MetricsRecorder, scheduleBackground?: ScheduleBackground) => Promise<Response>;
@@ -1,5 +1,5 @@
1
1
  import { m as McpDefinition } from "../types-BCKyT2wb.js";
2
- import { t as MetricsRecorder } from "../base-BAxrhVjq.js";
2
+ import { t as MetricsRecorder } from "../base-BFfwU5co.js";
3
3
  import { n as ScheduleBackground, t as McpRuntimeOptions } from "../authorize-d9-8n9u3.js";
4
4
  //#region src/protocols/oauth-metadata.d.ts
5
5
  type OAuthProtectedResourceMetadataHandler = (request: Request, recorder?: MetricsRecorder, scheduleBackground?: ScheduleBackground) => Promise<Response>;
@@ -1,5 +1,5 @@
1
1
  import { i as log, r as describeError } from "../logger-CpLgYbCG.js";
2
- import { a as oauthConfigurationErrorResponse, f as JSON_HEADERS, i as normalizeHttpMethod, l as emitBeforeResponse, m as methodNotAllowed, p as finalizeWireResponse, r as getOAuthRuntime, s as resolveProtectedResource, t as evaluateCors, u as createNoopRecorder } from "../cors-B0M7vKyd.js";
2
+ import { a as oauthConfigurationErrorResponse, f as JSON_HEADERS, i as normalizeHttpMethod, l as emitBeforeResponse, m as methodNotAllowed, p as finalizeWireResponse, r as getOAuthRuntime, s as resolveProtectedResource, t as evaluateCors, u as createNoopRecorder } from "../cors-B5UCWZP6.js";
3
3
  //#region src/protocols/oauth-metadata.ts
4
4
  function notFound() {
5
5
  return new Response(JSON.stringify({ error: "not found" }), {
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_logger = require("../../logger-C-Hdu57K.cjs");
3
- const require_cors = require("../../cors-B7bfc6Vl.cjs");
3
+ const require_cors = require("../../cors-CKlBOP47.cjs");
4
4
  const require_metadata_path = require("../../metadata-path-zd7NSNoa.cjs");
5
- const require_mcp = require("../../mcp-Bzsp56bG.cjs");
5
+ const require_mcp = require("../../mcp-BbmNNsKS.cjs");
6
6
  const require_protocols_oauth_metadata = require("../../protocols/oauth-metadata.cjs");
7
7
  const require_forwarded = require("../../forwarded-B37IdmMX.cjs");
8
8
  const require_paths = require("../../paths-OP318a6c.cjs");
@@ -1,7 +1,7 @@
1
1
  import { s as trimTrailingSlash } from "../../logger-CpLgYbCG.js";
2
- import { c as createRecorderForRuntime, o as assertResourcePathShape } from "../../cors-B0M7vKyd.js";
2
+ import { c as createRecorderForRuntime, o as assertResourcePathShape } from "../../cors-B5UCWZP6.js";
3
3
  import { t as OAUTH_PROTECTED_RESOURCE_METADATA_PATH } from "../../metadata-path-CAkNcfyY.js";
4
- import { t as createMcpProtocolHandler } from "../../mcp-D_3G4xwX.js";
4
+ import { t as createMcpProtocolHandler } from "../../mcp-BDxzJ-ed.js";
5
5
  import { createOAuthProtectedResourceMetadataHandler } from "../../protocols/oauth-metadata.js";
6
6
  import { t as applyForwardedOrigin } from "../../forwarded-BBXvFeh6.js";
7
7
  import { n as assertFunctionName, t as FUNCTIONS_MOUNT_PREFIX } from "../../paths-IS65L6TA.js";
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_package = require("../../package-CqbJU3uS.cjs");
5
+ const require_package = require("../../package-B7AqV9_M.cjs");
6
6
  const require_fs_errors = require("../../fs-errors-CWNzOV75.cjs");
7
7
  const require_supabase_config = require("../../supabase-config-Dz7dnUv0.cjs");
8
8
  const require_paths = require("../../paths-OP318a6c.cjs");
@@ -1,4 +1,4 @@
1
- import { t as version } from "../../package-CCAqM_QG.js";
1
+ import { t as version } from "../../package-BIMX8UD1.js";
2
2
  import { t as isFileMissing } from "../../fs-errors-PA2t1TIp.js";
3
3
  import { t as readSupabaseProjectRef } from "../../supabase-config-CakTU8YF.js";
4
4
  import { n as assertFunctionName, t as FUNCTIONS_MOUNT_PREFIX } from "../../paths-IS65L6TA.js";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_cors = require("../../cors-B7bfc6Vl.cjs");
3
- const require_mcp = require("../../mcp-Bzsp56bG.cjs");
2
+ const require_cors = require("../../cors-CKlBOP47.cjs");
3
+ const require_mcp = require("../../mcp-BbmNNsKS.cjs");
4
4
  const require_protocols_oauth_metadata = require("../../protocols/oauth-metadata.cjs");
5
5
  const require_forwarded = require("../../forwarded-B37IdmMX.cjs");
6
6
  //#region src/stacks/tanstack/handlers.ts
@@ -1,5 +1,5 @@
1
- import { c as createRecorderForRuntime } from "../../cors-B0M7vKyd.js";
2
- import { t as createMcpProtocolHandler } from "../../mcp-D_3G4xwX.js";
1
+ import { c as createRecorderForRuntime } from "../../cors-B5UCWZP6.js";
2
+ import { t as createMcpProtocolHandler } from "../../mcp-BDxzJ-ed.js";
3
3
  import { createOAuthProtectedResourceMetadataHandler } from "../../protocols/oauth-metadata.js";
4
4
  import { t as applyForwardedOrigin } from "../../forwarded-BBXvFeh6.js";
5
5
  //#region src/stacks/tanstack/handlers.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/mcp-js",
3
- "version": "2.2.1",
3
+ "version": "2.3.0-rc.0",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },
@@ -108,8 +108,8 @@
108
108
  ],
109
109
  "license": "MIT",
110
110
  "dependencies": {
111
- "@modelcontextprotocol/server": "2.0.0",
112
111
  "@modelcontextprotocol/sdk": "1.28.0",
112
+ "@modelcontextprotocol/server": "2.0.0",
113
113
  "esbuild": "^0.27.0",
114
114
  "jose": "^6.2.2"
115
115
  },