@insforge/mcp 1.2.4-deployment.0 → 1.2.4-deployment.10

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.
@@ -7,6 +7,7 @@ import { promises as fs } from "fs";
7
7
  import { exec } from "child_process";
8
8
  import { promisify } from "util";
9
9
  import { tmpdir } from "os";
10
+ import archiver from "archiver";
10
11
 
11
12
  // src/shared/response-handler.ts
12
13
  async function handleApiResponse(response) {
@@ -744,9 +745,7 @@ var realtimePermissionsResponseSchema = z8.object({
744
745
  });
745
746
 
746
747
  // node_modules/@insforge/shared-schemas/dist/metadata.schema.js
747
- var authMetadataSchema = z9.object({
748
- oauths: z9.array(oAuthConfigSchema)
749
- });
748
+ var authMetadataSchema = getPublicAuthConfigResponseSchema;
750
749
  var databaseMetadataSchema = z9.object({
751
750
  tables: z9.array(z9.object({
752
751
  tableName: z9.string(),
@@ -1079,23 +1078,27 @@ var cloudEventSchema = z16.discriminatedUnion("type", [
1079
1078
  import { z as z17 } from "zod";
1080
1079
  var docTypeSchema = z17.enum([
1081
1080
  "instructions",
1081
+ "auth-sdk",
1082
1082
  "db-sdk",
1083
1083
  "storage-sdk",
1084
1084
  "functions-sdk",
1085
1085
  "ai-integration-sdk",
1086
1086
  "auth-components-react",
1087
1087
  "auth-components-nextjs",
1088
- "real-time"
1088
+ "real-time",
1089
+ "deployment"
1089
1090
  ]).describe(`
1090
- Documentation type:
1091
+ Documentation type:
1091
1092
  "instructions" (essential backend setup - use FIRST),
1092
1093
  "db-sdk" (database operations),
1093
1094
  "storage-sdk" (file storage),
1094
1095
  "functions-sdk" (edge functions),
1096
+ "auth-sdk" (direct SDK methods for custom auth flows),
1095
1097
  "auth-components-react" (authentication components for React+Vite applications),
1096
1098
  "auth-components-nextjs" (authentication components for Next.js applications),
1097
1099
  "ai-integration-sdk" (AI features),
1098
- "real-time" (real-time pub/sub through WebSockets)
1100
+ "real-time" (real-time pub/sub through WebSockets),
1101
+ "deployment" (deploy frontend applications via MCP tool)
1099
1102
  `);
1100
1103
 
1101
1104
  // node_modules/@insforge/shared-schemas/dist/email-api.schema.js
@@ -1117,11 +1120,28 @@ var sendEmailResponseSchema = z18.object({});
1117
1120
 
1118
1121
  // node_modules/@insforge/shared-schemas/dist/deployments.schema.js
1119
1122
  import { z as z19 } from "zod";
1123
+ var deploymentStatusSchema = z19.enum([
1124
+ "WAITING",
1125
+ // Record created, waiting for client to upload zip to S3
1126
+ "UPLOADING",
1127
+ // Server is downloading from S3 and uploading to Vercel
1128
+ "QUEUED",
1129
+ // Vercel: deployment queued
1130
+ "BUILDING",
1131
+ // Vercel: deployment building
1132
+ "READY",
1133
+ // Vercel: deployment ready
1134
+ "ERROR",
1135
+ // Vercel: deployment failed
1136
+ "CANCELED"
1137
+ // Vercel: deployment canceled
1138
+ ]);
1120
1139
  var deploymentSchema = z19.object({
1121
1140
  id: z19.string().uuid(),
1122
- deploymentId: z19.string(),
1141
+ providerDeploymentId: z19.string().nullable(),
1142
+ // Provider's deployment ID, null until deployment starts
1123
1143
  provider: z19.string(),
1124
- status: z19.string(),
1144
+ status: deploymentStatusSchema,
1125
1145
  url: z19.string().nullable(),
1126
1146
  metadata: z19.record(z19.unknown()).nullable(),
1127
1147
  createdAt: z19.string(),
@@ -1137,20 +1157,20 @@ var projectSettingsSchema = z20.object({
1137
1157
  devCommand: z20.string().nullable().optional(),
1138
1158
  rootDirectory: z20.string().nullable().optional()
1139
1159
  });
1140
- var deploymentFileSchema = z20.object({
1141
- file: z20.string(),
1142
- data: z20.string()
1143
- });
1144
1160
  var envVarSchema = z20.object({
1145
1161
  key: z20.string(),
1146
1162
  value: z20.string()
1147
1163
  });
1148
- var createDeploymentRequestSchema = z20.object({
1149
- name: z20.string().optional(),
1150
- files: z20.array(deploymentFileSchema).optional(),
1164
+ var createDeploymentResponseSchema = z20.object({
1165
+ id: z20.string().uuid(),
1166
+ uploadUrl: z20.string().url(),
1167
+ uploadFields: z20.record(z20.string())
1168
+ // Required for S3 presigned POST (policy, signature, key, etc.)
1169
+ });
1170
+ var startDeploymentRequestSchema = z20.object({
1151
1171
  projectSettings: projectSettingsSchema.optional(),
1152
- meta: z20.record(z20.string()).optional(),
1153
- envVars: z20.array(envVarSchema).optional()
1172
+ envVars: z20.array(envVarSchema).optional(),
1173
+ meta: z20.record(z20.string()).optional()
1154
1174
  });
1155
1175
  var listDeploymentsResponseSchema = z20.object({
1156
1176
  deployments: z20.array(deploymentSchema)
@@ -1160,75 +1180,74 @@ var listDeploymentsResponseSchema = z20.object({
1160
1180
  import FormData from "form-data";
1161
1181
  var execAsync = promisify(exec);
1162
1182
  var TOOL_VERSION_REQUIREMENTS = {
1163
- "upsert-schedule": "1.1.1",
1164
- // 'get-schedules': '1.1.1',
1165
- // 'get-schedule-logs': '1.1.1',
1166
- "delete-schedule": "1.1.1"
1183
+ // Schedule tools - require backend v1.1.1+
1184
+ "upsert-schedule": { minVersion: "1.1.1" },
1185
+ "delete-schedule": { minVersion: "1.1.1" },
1186
+ // 'get-schedules': { minVersion: '1.1.1' },
1187
+ // 'get-schedule-logs': { minVersion: '1.1.1' },
1188
+ "create-deployment": { minVersion: "1.4.7" }
1189
+ // Example of a deprecated tool (uncomment when needed):
1190
+ // 'legacy-tool': { minVersion: '1.0.0', maxVersion: '1.5.0' },
1167
1191
  };
1168
- function registerInsforgeTools(server, config = {}) {
1169
- const GLOBAL_API_KEY = config.apiKey || process.env.API_KEY || "";
1170
- const API_BASE_URL = config.apiBaseUrl || process.env.API_BASE_URL || "http://localhost:7130";
1171
- const usageTracker = new UsageTracker(API_BASE_URL, GLOBAL_API_KEY);
1172
- let versionCache = null;
1173
- const VERSION_CACHE_TTL = 5 * 60 * 1e3;
1174
- async function getBackendVersion() {
1175
- const now = Date.now();
1176
- if (versionCache && now - versionCache.timestamp < VERSION_CACHE_TTL) {
1177
- return versionCache.version;
1178
- }
1179
- try {
1180
- const response = await fetch2(`${API_BASE_URL}/api/health`, {
1181
- method: "GET",
1182
- headers: {
1183
- "Content-Type": "application/json"
1184
- }
1185
- });
1186
- if (!response.ok) {
1187
- throw new Error(`Health check failed with status ${response.status}`);
1188
- }
1189
- const health = await response.json();
1190
- versionCache = {
1191
- version: health.version,
1192
- timestamp: now
1193
- };
1194
- return health.version;
1195
- } catch (error) {
1196
- const errMsg = error instanceof Error ? error.message : "Unknown error";
1197
- throw new Error(`Failed to fetch backend version: ${errMsg}`);
1198
- }
1192
+ function compareVersions(v1, v2) {
1193
+ const clean1 = v1.replace(/^v/, "").split("-")[0];
1194
+ const clean2 = v2.replace(/^v/, "").split("-")[0];
1195
+ const parts1 = clean1.split(".").map(Number);
1196
+ const parts2 = clean2.split(".").map(Number);
1197
+ for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
1198
+ const part1 = parts1[i] || 0;
1199
+ const part2 = parts2[i] || 0;
1200
+ if (part1 > part2) return 1;
1201
+ if (part1 < part2) return -1;
1199
1202
  }
1200
- function compareVersions(v1, v2) {
1201
- const clean1 = v1.replace(/^v/, "").split("-")[0];
1202
- const clean2 = v2.replace(/^v/, "").split("-")[0];
1203
- const parts1 = clean1.split(".").map(Number);
1204
- const parts2 = clean2.split(".").map(Number);
1205
- for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
1206
- const part1 = parts1[i] || 0;
1207
- const part2 = parts2[i] || 0;
1208
- if (part1 > part2) return 1;
1209
- if (part1 < part2) return -1;
1210
- }
1211
- return 0;
1203
+ return 0;
1204
+ }
1205
+ function shouldRegisterTool(toolName, backendVersion) {
1206
+ const requirement = TOOL_VERSION_REQUIREMENTS[toolName];
1207
+ if (!requirement) {
1208
+ return true;
1212
1209
  }
1213
- async function checkToolVersion(toolName) {
1214
- const requiredVersion = TOOL_VERSION_REQUIREMENTS[toolName];
1215
- if (!requiredVersion) {
1216
- return;
1217
- }
1218
- try {
1219
- const currentVersion = await getBackendVersion();
1220
- if (compareVersions(currentVersion, requiredVersion) < 0) {
1221
- throw new Error(
1222
- `Tool '${toolName}' requires backend version ${requiredVersion} or higher, but current version is ${currentVersion}. Please upgrade your Insforge backend server.`
1223
- );
1224
- }
1225
- } catch (error) {
1226
- if (error instanceof Error && error.message.includes("requires backend version")) {
1227
- throw error;
1228
- }
1229
- console.warn(`Warning: Could not verify backend version for tool '${toolName}': ${error instanceof Error ? error.message : "Unknown error"}`);
1210
+ const { minVersion, maxVersion } = requirement;
1211
+ if (minVersion && compareVersions(backendVersion, minVersion) < 0) {
1212
+ return false;
1213
+ }
1214
+ if (maxVersion && compareVersions(backendVersion, maxVersion) > 0) {
1215
+ return false;
1216
+ }
1217
+ return true;
1218
+ }
1219
+ async function fetchBackendVersion(apiBaseUrl) {
1220
+ const response = await fetch2(`${apiBaseUrl}/api/health`, {
1221
+ method: "GET",
1222
+ headers: {
1223
+ "Content-Type": "application/json"
1230
1224
  }
1225
+ });
1226
+ if (!response.ok) {
1227
+ throw new Error(`Health check failed with status ${response.status}`);
1231
1228
  }
1229
+ const health = await response.json();
1230
+ return health.version;
1231
+ }
1232
+ async function registerInsforgeTools(server, config = {}) {
1233
+ const GLOBAL_API_KEY = config.apiKey || process.env.API_KEY || "";
1234
+ const API_BASE_URL = config.apiBaseUrl || process.env.API_BASE_URL || "http://localhost:7130";
1235
+ const usageTracker = new UsageTracker(API_BASE_URL, GLOBAL_API_KEY);
1236
+ const backendVersion = await fetchBackendVersion(API_BASE_URL);
1237
+ console.error(`Backend version: ${backendVersion}`);
1238
+ let toolCount = 0;
1239
+ const registerTool = (toolName, ...args) => {
1240
+ if (shouldRegisterTool(toolName, backendVersion)) {
1241
+ server.tool(toolName, ...args);
1242
+ toolCount++;
1243
+ return true;
1244
+ } else {
1245
+ const req = TOOL_VERSION_REQUIREMENTS[toolName];
1246
+ const reason = req?.minVersion && compareVersions(backendVersion, req.minVersion) < 0 ? `requires backend >= ${req.minVersion}` : `deprecated after backend ${req?.maxVersion}`;
1247
+ console.error(`Skipping tool '${toolName}': ${reason} (current: ${backendVersion})`);
1248
+ return false;
1249
+ }
1250
+ };
1232
1251
  async function trackToolUsage(toolName, success = true) {
1233
1252
  if (GLOBAL_API_KEY) {
1234
1253
  await usageTracker.trackUsage(toolName, success);
@@ -1285,28 +1304,23 @@ function registerInsforgeTools(server, config = {}) {
1285
1304
  }
1286
1305
  };
1287
1306
  const addBackgroundContext = async (response) => {
1288
- try {
1289
- const currentVersion = await getBackendVersion();
1290
- const isLegacyVersion = compareVersions(currentVersion, "1.1.7") < 0;
1291
- if (isLegacyVersion) {
1292
- const context = await fetchInsforgeInstructionsContext();
1293
- if (context && response.content && Array.isArray(response.content)) {
1294
- response.content.push({
1295
- type: "text",
1296
- text: `
1307
+ const isLegacyVersion = compareVersions(backendVersion, "1.1.7") < 0;
1308
+ if (isLegacyVersion) {
1309
+ const context = await fetchInsforgeInstructionsContext();
1310
+ if (context && response.content && Array.isArray(response.content)) {
1311
+ response.content.push({
1312
+ type: "text",
1313
+ text: `
1297
1314
 
1298
1315
  ---
1299
1316
  \u{1F527} INSFORGE DEVELOPMENT RULES (Auto-loaded):
1300
1317
  ${context}`
1301
- });
1302
- }
1318
+ });
1303
1319
  }
1304
- } catch {
1305
- console.warn("Could not determine backend version, skipping background context");
1306
1320
  }
1307
1321
  return response;
1308
1322
  };
1309
- server.tool(
1323
+ registerTool(
1310
1324
  "fetch-docs",
1311
1325
  'Fetch Insforge documentation. Use "instructions" for essential backend setup (MANDATORY FIRST), or select specific SDK docs for database, auth, storage, functions, or AI integration.',
1312
1326
  {
@@ -1339,7 +1353,7 @@ ${context}`
1339
1353
  }
1340
1354
  })
1341
1355
  );
1342
- server.tool(
1356
+ registerTool(
1343
1357
  "get-anon-key",
1344
1358
  "Generate an anonymous JWT token that never expires. Requires admin API key. Use this for client-side applications that need public access.",
1345
1359
  {
@@ -1378,7 +1392,7 @@ ${context}`
1378
1392
  }
1379
1393
  })
1380
1394
  );
1381
- server.tool(
1395
+ registerTool(
1382
1396
  "get-table-schema",
1383
1397
  "Returns the detailed schema(including RLS, indexes, constraints, etc.) of a specific table",
1384
1398
  {
@@ -1417,7 +1431,7 @@ ${context}`
1417
1431
  }
1418
1432
  })
1419
1433
  );
1420
- server.tool(
1434
+ registerTool(
1421
1435
  "get-backend-metadata",
1422
1436
  "Index all backend metadata",
1423
1437
  {
@@ -1457,7 +1471,7 @@ ${JSON.stringify(metadata, null, 2)}`
1457
1471
  }
1458
1472
  })
1459
1473
  );
1460
- server.tool(
1474
+ registerTool(
1461
1475
  "run-raw-sql",
1462
1476
  "Execute raw SQL query with optional parameters. Admin access required. Use with caution as it can modify data directly.",
1463
1477
  {
@@ -1502,7 +1516,7 @@ ${JSON.stringify(metadata, null, 2)}`
1502
1516
  }
1503
1517
  })
1504
1518
  );
1505
- server.tool(
1519
+ registerTool(
1506
1520
  "download-template",
1507
1521
  "CRITICAL: MANDATORY FIRST STEP for all new InsForge projects. Download pre-configured starter template to a temporary directory. After download, you MUST copy files to current directory using the provided command.",
1508
1522
  {
@@ -1578,7 +1592,7 @@ To: Your current project directory
1578
1592
  }
1579
1593
  })
1580
1594
  );
1581
- server.tool(
1595
+ registerTool(
1582
1596
  "bulk-upsert",
1583
1597
  "Bulk insert or update data from CSV or JSON file. Supports upsert operations with a unique key.",
1584
1598
  {
@@ -1635,7 +1649,7 @@ To: Your current project directory
1635
1649
  }
1636
1650
  })
1637
1651
  );
1638
- server.tool(
1652
+ registerTool(
1639
1653
  "create-bucket",
1640
1654
  "Create new storage bucket",
1641
1655
  {
@@ -1676,7 +1690,7 @@ To: Your current project directory
1676
1690
  }
1677
1691
  })
1678
1692
  );
1679
- server.tool(
1693
+ registerTool(
1680
1694
  "list-buckets",
1681
1695
  "Lists all storage buckets",
1682
1696
  {},
@@ -1711,7 +1725,7 @@ To: Your current project directory
1711
1725
  }
1712
1726
  })
1713
1727
  );
1714
- server.tool(
1728
+ registerTool(
1715
1729
  "delete-bucket",
1716
1730
  "Deletes a storage bucket",
1717
1731
  {
@@ -1750,7 +1764,7 @@ To: Your current project directory
1750
1764
  }
1751
1765
  })
1752
1766
  );
1753
- server.tool(
1767
+ registerTool(
1754
1768
  "create-function",
1755
1769
  "Create a new edge function that runs in Deno runtime. The code must be written to a file first for version control",
1756
1770
  {
@@ -1809,7 +1823,7 @@ To: Your current project directory
1809
1823
  }
1810
1824
  })
1811
1825
  );
1812
- server.tool(
1826
+ registerTool(
1813
1827
  "get-function",
1814
1828
  "Get details of a specific edge function including its code",
1815
1829
  {
@@ -1846,7 +1860,7 @@ To: Your current project directory
1846
1860
  }
1847
1861
  })
1848
1862
  );
1849
- server.tool(
1863
+ registerTool(
1850
1864
  "update-function",
1851
1865
  "Update an existing edge function code or metadata",
1852
1866
  {
@@ -1912,7 +1926,7 @@ To: Your current project directory
1912
1926
  }
1913
1927
  })
1914
1928
  );
1915
- server.tool(
1929
+ registerTool(
1916
1930
  "delete-function",
1917
1931
  "Delete an edge function permanently",
1918
1932
  {
@@ -1949,7 +1963,7 @@ To: Your current project directory
1949
1963
  }
1950
1964
  })
1951
1965
  );
1952
- server.tool(
1966
+ registerTool(
1953
1967
  "get-container-logs",
1954
1968
  "Get latest logs from a specific container/service. Use this to help debug problems with your app.",
1955
1969
  {
@@ -1999,34 +2013,101 @@ To: Your current project directory
1999
2013
  }
2000
2014
  })
2001
2015
  );
2002
- server.tool(
2016
+ registerTool(
2003
2017
  "create-deployment",
2004
- "Create a new deployment with files, project settings, and environment variables",
2018
+ "Deploy source code from a directory. This tool zips files, uploads to cloud storage, and triggers deployment with optional environment variables and project settings.",
2005
2019
  {
2006
- ...createDeploymentRequestSchema.shape
2020
+ sourceDirectory: z21.string().describe('Absolute path to the source directory containing files to deploy (e.g., /Users/name/project or C:\\Users\\name\\project). Do not use relative paths like "."'),
2021
+ ...startDeploymentRequestSchema.shape
2007
2022
  },
2008
- withUsageTracking("create-deployment", async ({ name, files, projectSettings, meta, envVars }) => {
2023
+ withUsageTracking("create-deployment", async ({ sourceDirectory, projectSettings, envVars, meta }) => {
2009
2024
  try {
2010
- const requestBody = {};
2011
- if (name) requestBody.name = name;
2012
- if (files) requestBody.files = files;
2013
- if (projectSettings) requestBody.projectSettings = projectSettings;
2014
- if (meta) requestBody.meta = meta;
2015
- if (envVars) requestBody.envVars = envVars;
2016
- const response = await fetch2(`${API_BASE_URL}/api/deployments`, {
2025
+ const isAbsolutePath = sourceDirectory.startsWith("/") || /^[a-zA-Z]:[/\\]/.test(sourceDirectory);
2026
+ if (!isAbsolutePath) {
2027
+ return {
2028
+ content: [
2029
+ {
2030
+ type: "text",
2031
+ text: `Error: sourceDirectory must be an absolute path, not a relative path like "${sourceDirectory}". Please provide the full path to the source directory (e.g., /Users/name/project on macOS/Linux or C:\\Users\\name\\project on Windows).`
2032
+ }
2033
+ ],
2034
+ isError: true
2035
+ };
2036
+ }
2037
+ const resolvedSourceDir = sourceDirectory;
2038
+ const createResponse = await fetch2(`${API_BASE_URL}/api/deployments`, {
2039
+ method: "POST",
2040
+ headers: {
2041
+ "x-api-key": getApiKey(),
2042
+ "Content-Type": "application/json"
2043
+ }
2044
+ });
2045
+ const createResult = await handleApiResponse(createResponse);
2046
+ const { id: deploymentId, uploadUrl, uploadFields } = createResult;
2047
+ const zipBuffer = await new Promise((resolve, reject) => {
2048
+ const archive = archiver("zip", { zlib: { level: 9 } });
2049
+ const chunks = [];
2050
+ archive.on("data", (chunk) => chunks.push(chunk));
2051
+ archive.on("end", () => resolve(Buffer.concat(chunks)));
2052
+ archive.on("error", (err) => reject(err));
2053
+ const excludePatterns = [
2054
+ "node_modules",
2055
+ ".git",
2056
+ ".next",
2057
+ "dist",
2058
+ "build",
2059
+ ".env.local",
2060
+ ".DS_Store"
2061
+ ];
2062
+ archive.directory(resolvedSourceDir, false, (entry) => {
2063
+ const normalizedName = entry.name.replace(/\\/g, "/");
2064
+ for (const pattern of excludePatterns) {
2065
+ if (normalizedName.startsWith(pattern + "/") || normalizedName === pattern || normalizedName.endsWith("/" + pattern) || normalizedName.includes("/" + pattern + "/")) {
2066
+ return false;
2067
+ }
2068
+ }
2069
+ if (normalizedName.endsWith(".log")) {
2070
+ return false;
2071
+ }
2072
+ return entry;
2073
+ });
2074
+ archive.finalize();
2075
+ });
2076
+ const uploadFormData = new FormData();
2077
+ for (const [key, value] of Object.entries(uploadFields)) {
2078
+ uploadFormData.append(key, value);
2079
+ }
2080
+ uploadFormData.append("file", zipBuffer, {
2081
+ filename: "deployment.zip",
2082
+ contentType: "application/zip"
2083
+ });
2084
+ const uploadResponse = await fetch2(uploadUrl, {
2085
+ method: "POST",
2086
+ body: uploadFormData,
2087
+ headers: uploadFormData.getHeaders()
2088
+ });
2089
+ if (!uploadResponse.ok) {
2090
+ const uploadError = await uploadResponse.text();
2091
+ throw new Error(`Failed to upload zip file: ${uploadError}`);
2092
+ }
2093
+ const startBody = {};
2094
+ if (projectSettings) startBody.projectSettings = projectSettings;
2095
+ if (envVars) startBody.envVars = envVars;
2096
+ if (meta) startBody.meta = meta;
2097
+ const startResponse = await fetch2(`${API_BASE_URL}/api/deployments/${deploymentId}/start`, {
2017
2098
  method: "POST",
2018
2099
  headers: {
2019
2100
  "x-api-key": getApiKey(),
2020
2101
  "Content-Type": "application/json"
2021
2102
  },
2022
- body: JSON.stringify(requestBody)
2103
+ body: JSON.stringify(startBody)
2023
2104
  });
2024
- const result = await handleApiResponse(response);
2105
+ const startResult = await handleApiResponse(startResponse);
2025
2106
  return await addBackgroundContext({
2026
2107
  content: [
2027
2108
  {
2028
2109
  type: "text",
2029
- text: formatSuccessMessage("Deployment created", result) + "\n\nNote: You can check deployment status by querying the system.deployments table."
2110
+ text: formatSuccessMessage("Deployment started", startResult) + "\n\nNote: You can check deployment status by querying the system.deployments table."
2030
2111
  }
2031
2112
  ]
2032
2113
  });
@@ -2047,7 +2128,8 @@ To: Your current project directory
2047
2128
  return {
2048
2129
  apiKey: GLOBAL_API_KEY,
2049
2130
  apiBaseUrl: API_BASE_URL,
2050
- toolCount: 16
2131
+ toolCount,
2132
+ backendVersion
2051
2133
  };
2052
2134
  }
2053
2135
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-ELPXCUYK.js";
4
+ } from "./chunk-BLV3H4GZ.js";
5
5
 
6
6
  // src/http/server.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -91,7 +91,7 @@ app.post("/mcp", async (req, res) => {
91
91
  name: "insforge-mcp",
92
92
  version: "1.0.0"
93
93
  });
94
- registerInsforgeTools(mcpServer, {
94
+ await registerInsforgeTools(mcpServer, {
95
95
  apiKey,
96
96
  apiBaseUrl
97
97
  });
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-ELPXCUYK.js";
4
+ } from "./chunk-BLV3H4GZ.js";
5
5
 
6
6
  // src/stdio/index.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -12,15 +12,15 @@ program.option("--api_base_url <value>", "API Base URL");
12
12
  program.parse(process.argv);
13
13
  var options = program.opts();
14
14
  var { api_key, api_base_url } = options;
15
- var server = new McpServer({
16
- name: "insforge-mcp",
17
- version: "1.0.0"
18
- });
19
- var toolsConfig = registerInsforgeTools(server, {
20
- apiKey: api_key,
21
- apiBaseUrl: api_base_url || process.env.API_BASE_URL
22
- });
23
15
  async function main() {
16
+ const server = new McpServer({
17
+ name: "insforge-mcp",
18
+ version: "1.0.0"
19
+ });
20
+ const toolsConfig = await registerInsforgeTools(server, {
21
+ apiKey: api_key,
22
+ apiBaseUrl: api_base_url || process.env.API_BASE_URL
23
+ });
24
24
  const transport = new StdioServerTransport();
25
25
  await server.connect(transport);
26
26
  console.error("Insforge MCP server started");
@@ -30,6 +30,9 @@ async function main() {
30
30
  console.error("API Key: Not configured (will require api_key in tool calls)");
31
31
  }
32
32
  console.error(`API Base URL: ${toolsConfig.apiBaseUrl}`);
33
+ if (toolsConfig.backendVersion) {
34
+ console.error(`Backend Version: ${toolsConfig.backendVersion}`);
35
+ }
33
36
  console.error(`Tools registered: ${toolsConfig.toolCount}`);
34
37
  }
35
38
  main().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/mcp",
3
- "version": "1.2.4-deployment.0",
3
+ "version": "1.2.4-deployment.10",
4
4
  "description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
5
5
  "mcpName": "io.github.InsForge/insforge-mcp",
6
6
  "type": "module",
@@ -36,9 +36,10 @@
36
36
  "server.json"
37
37
  ],
38
38
  "dependencies": {
39
- "@insforge/shared-schemas": "1.1.36-deployment.1",
39
+ "@insforge/shared-schemas": "1.1.37-deployment.1",
40
40
  "@modelcontextprotocol/sdk": "^1.15.1",
41
41
  "@types/express": "^5.0.3",
42
+ "archiver": "^7.0.1",
42
43
  "commander": "^14.0.0",
43
44
  "express": "^5.1.0",
44
45
  "form-data": "^4.0.4",
@@ -46,6 +47,7 @@
46
47
  "zod": "^3.23.8"
47
48
  },
48
49
  "devDependencies": {
50
+ "@types/archiver": "^7.0.0",
49
51
  "@types/node": "^20.10.5",
50
52
  "rimraf": "^5.0.5",
51
53
  "tsup": "^8.5.0",