@insforge/mcp 1.2.4-deployment.1 → 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.
- package/dist/{chunk-WAOSJ573.js → chunk-BLV3H4GZ.js} +143 -117
- package/dist/http-server.js +2 -2
- package/dist/index.js +12 -9
- package/package.json +4 -2
|
@@ -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 =
|
|
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
|
|
@@ -1135,7 +1138,7 @@ var deploymentStatusSchema = z19.enum([
|
|
|
1135
1138
|
]);
|
|
1136
1139
|
var deploymentSchema = z19.object({
|
|
1137
1140
|
id: z19.string().uuid(),
|
|
1138
|
-
|
|
1141
|
+
providerDeploymentId: z19.string().nullable(),
|
|
1139
1142
|
// Provider's deployment ID, null until deployment starts
|
|
1140
1143
|
provider: z19.string(),
|
|
1141
1144
|
status: deploymentStatusSchema,
|
|
@@ -1177,75 +1180,74 @@ var listDeploymentsResponseSchema = z20.object({
|
|
|
1177
1180
|
import FormData from "form-data";
|
|
1178
1181
|
var execAsync = promisify(exec);
|
|
1179
1182
|
var TOOL_VERSION_REQUIREMENTS = {
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
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' },
|
|
1184
1191
|
};
|
|
1185
|
-
function
|
|
1186
|
-
const
|
|
1187
|
-
const
|
|
1188
|
-
const
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
const
|
|
1193
|
-
if (
|
|
1194
|
-
|
|
1195
|
-
}
|
|
1196
|
-
try {
|
|
1197
|
-
const response = await fetch2(`${API_BASE_URL}/api/health`, {
|
|
1198
|
-
method: "GET",
|
|
1199
|
-
headers: {
|
|
1200
|
-
"Content-Type": "application/json"
|
|
1201
|
-
}
|
|
1202
|
-
});
|
|
1203
|
-
if (!response.ok) {
|
|
1204
|
-
throw new Error(`Health check failed with status ${response.status}`);
|
|
1205
|
-
}
|
|
1206
|
-
const health = await response.json();
|
|
1207
|
-
versionCache = {
|
|
1208
|
-
version: health.version,
|
|
1209
|
-
timestamp: now
|
|
1210
|
-
};
|
|
1211
|
-
return health.version;
|
|
1212
|
-
} catch (error) {
|
|
1213
|
-
const errMsg = error instanceof Error ? error.message : "Unknown error";
|
|
1214
|
-
throw new Error(`Failed to fetch backend version: ${errMsg}`);
|
|
1215
|
-
}
|
|
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;
|
|
1216
1202
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
const part1 = parts1[i] || 0;
|
|
1224
|
-
const part2 = parts2[i] || 0;
|
|
1225
|
-
if (part1 > part2) return 1;
|
|
1226
|
-
if (part1 < part2) return -1;
|
|
1227
|
-
}
|
|
1228
|
-
return 0;
|
|
1203
|
+
return 0;
|
|
1204
|
+
}
|
|
1205
|
+
function shouldRegisterTool(toolName, backendVersion) {
|
|
1206
|
+
const requirement = TOOL_VERSION_REQUIREMENTS[toolName];
|
|
1207
|
+
if (!requirement) {
|
|
1208
|
+
return true;
|
|
1229
1209
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
throw error;
|
|
1245
|
-
}
|
|
1246
|
-
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"
|
|
1247
1224
|
}
|
|
1225
|
+
});
|
|
1226
|
+
if (!response.ok) {
|
|
1227
|
+
throw new Error(`Health check failed with status ${response.status}`);
|
|
1248
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
|
+
};
|
|
1249
1251
|
async function trackToolUsage(toolName, success = true) {
|
|
1250
1252
|
if (GLOBAL_API_KEY) {
|
|
1251
1253
|
await usageTracker.trackUsage(toolName, success);
|
|
@@ -1302,28 +1304,23 @@ function registerInsforgeTools(server, config = {}) {
|
|
|
1302
1304
|
}
|
|
1303
1305
|
};
|
|
1304
1306
|
const addBackgroundContext = async (response) => {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
const
|
|
1308
|
-
if (
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
type: "text",
|
|
1313
|
-
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: `
|
|
1314
1314
|
|
|
1315
1315
|
---
|
|
1316
1316
|
\u{1F527} INSFORGE DEVELOPMENT RULES (Auto-loaded):
|
|
1317
1317
|
${context}`
|
|
1318
|
-
|
|
1319
|
-
}
|
|
1318
|
+
});
|
|
1320
1319
|
}
|
|
1321
|
-
} catch {
|
|
1322
|
-
console.warn("Could not determine backend version, skipping background context");
|
|
1323
1320
|
}
|
|
1324
1321
|
return response;
|
|
1325
1322
|
};
|
|
1326
|
-
|
|
1323
|
+
registerTool(
|
|
1327
1324
|
"fetch-docs",
|
|
1328
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.',
|
|
1329
1326
|
{
|
|
@@ -1356,7 +1353,7 @@ ${context}`
|
|
|
1356
1353
|
}
|
|
1357
1354
|
})
|
|
1358
1355
|
);
|
|
1359
|
-
|
|
1356
|
+
registerTool(
|
|
1360
1357
|
"get-anon-key",
|
|
1361
1358
|
"Generate an anonymous JWT token that never expires. Requires admin API key. Use this for client-side applications that need public access.",
|
|
1362
1359
|
{
|
|
@@ -1395,7 +1392,7 @@ ${context}`
|
|
|
1395
1392
|
}
|
|
1396
1393
|
})
|
|
1397
1394
|
);
|
|
1398
|
-
|
|
1395
|
+
registerTool(
|
|
1399
1396
|
"get-table-schema",
|
|
1400
1397
|
"Returns the detailed schema(including RLS, indexes, constraints, etc.) of a specific table",
|
|
1401
1398
|
{
|
|
@@ -1434,7 +1431,7 @@ ${context}`
|
|
|
1434
1431
|
}
|
|
1435
1432
|
})
|
|
1436
1433
|
);
|
|
1437
|
-
|
|
1434
|
+
registerTool(
|
|
1438
1435
|
"get-backend-metadata",
|
|
1439
1436
|
"Index all backend metadata",
|
|
1440
1437
|
{
|
|
@@ -1474,7 +1471,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1474
1471
|
}
|
|
1475
1472
|
})
|
|
1476
1473
|
);
|
|
1477
|
-
|
|
1474
|
+
registerTool(
|
|
1478
1475
|
"run-raw-sql",
|
|
1479
1476
|
"Execute raw SQL query with optional parameters. Admin access required. Use with caution as it can modify data directly.",
|
|
1480
1477
|
{
|
|
@@ -1519,7 +1516,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1519
1516
|
}
|
|
1520
1517
|
})
|
|
1521
1518
|
);
|
|
1522
|
-
|
|
1519
|
+
registerTool(
|
|
1523
1520
|
"download-template",
|
|
1524
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.",
|
|
1525
1522
|
{
|
|
@@ -1595,7 +1592,7 @@ To: Your current project directory
|
|
|
1595
1592
|
}
|
|
1596
1593
|
})
|
|
1597
1594
|
);
|
|
1598
|
-
|
|
1595
|
+
registerTool(
|
|
1599
1596
|
"bulk-upsert",
|
|
1600
1597
|
"Bulk insert or update data from CSV or JSON file. Supports upsert operations with a unique key.",
|
|
1601
1598
|
{
|
|
@@ -1652,7 +1649,7 @@ To: Your current project directory
|
|
|
1652
1649
|
}
|
|
1653
1650
|
})
|
|
1654
1651
|
);
|
|
1655
|
-
|
|
1652
|
+
registerTool(
|
|
1656
1653
|
"create-bucket",
|
|
1657
1654
|
"Create new storage bucket",
|
|
1658
1655
|
{
|
|
@@ -1693,7 +1690,7 @@ To: Your current project directory
|
|
|
1693
1690
|
}
|
|
1694
1691
|
})
|
|
1695
1692
|
);
|
|
1696
|
-
|
|
1693
|
+
registerTool(
|
|
1697
1694
|
"list-buckets",
|
|
1698
1695
|
"Lists all storage buckets",
|
|
1699
1696
|
{},
|
|
@@ -1728,7 +1725,7 @@ To: Your current project directory
|
|
|
1728
1725
|
}
|
|
1729
1726
|
})
|
|
1730
1727
|
);
|
|
1731
|
-
|
|
1728
|
+
registerTool(
|
|
1732
1729
|
"delete-bucket",
|
|
1733
1730
|
"Deletes a storage bucket",
|
|
1734
1731
|
{
|
|
@@ -1767,7 +1764,7 @@ To: Your current project directory
|
|
|
1767
1764
|
}
|
|
1768
1765
|
})
|
|
1769
1766
|
);
|
|
1770
|
-
|
|
1767
|
+
registerTool(
|
|
1771
1768
|
"create-function",
|
|
1772
1769
|
"Create a new edge function that runs in Deno runtime. The code must be written to a file first for version control",
|
|
1773
1770
|
{
|
|
@@ -1826,7 +1823,7 @@ To: Your current project directory
|
|
|
1826
1823
|
}
|
|
1827
1824
|
})
|
|
1828
1825
|
);
|
|
1829
|
-
|
|
1826
|
+
registerTool(
|
|
1830
1827
|
"get-function",
|
|
1831
1828
|
"Get details of a specific edge function including its code",
|
|
1832
1829
|
{
|
|
@@ -1863,7 +1860,7 @@ To: Your current project directory
|
|
|
1863
1860
|
}
|
|
1864
1861
|
})
|
|
1865
1862
|
);
|
|
1866
|
-
|
|
1863
|
+
registerTool(
|
|
1867
1864
|
"update-function",
|
|
1868
1865
|
"Update an existing edge function code or metadata",
|
|
1869
1866
|
{
|
|
@@ -1929,7 +1926,7 @@ To: Your current project directory
|
|
|
1929
1926
|
}
|
|
1930
1927
|
})
|
|
1931
1928
|
);
|
|
1932
|
-
|
|
1929
|
+
registerTool(
|
|
1933
1930
|
"delete-function",
|
|
1934
1931
|
"Delete an edge function permanently",
|
|
1935
1932
|
{
|
|
@@ -1966,7 +1963,7 @@ To: Your current project directory
|
|
|
1966
1963
|
}
|
|
1967
1964
|
})
|
|
1968
1965
|
);
|
|
1969
|
-
|
|
1966
|
+
registerTool(
|
|
1970
1967
|
"get-container-logs",
|
|
1971
1968
|
"Get latest logs from a specific container/service. Use this to help debug problems with your app.",
|
|
1972
1969
|
{
|
|
@@ -2016,15 +2013,28 @@ To: Your current project directory
|
|
|
2016
2013
|
}
|
|
2017
2014
|
})
|
|
2018
2015
|
);
|
|
2019
|
-
|
|
2016
|
+
registerTool(
|
|
2020
2017
|
"create-deployment",
|
|
2021
|
-
"Deploy source code from a directory.
|
|
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.",
|
|
2022
2019
|
{
|
|
2023
|
-
sourceDirectory: z21.string().describe(
|
|
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 "."'),
|
|
2024
2021
|
...startDeploymentRequestSchema.shape
|
|
2025
2022
|
},
|
|
2026
2023
|
withUsageTracking("create-deployment", async ({ sourceDirectory, projectSettings, envVars, meta }) => {
|
|
2027
2024
|
try {
|
|
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;
|
|
2028
2038
|
const createResponse = await fetch2(`${API_BASE_URL}/api/deployments`, {
|
|
2029
2039
|
method: "POST",
|
|
2030
2040
|
headers: {
|
|
@@ -2034,18 +2044,35 @@ To: Your current project directory
|
|
|
2034
2044
|
});
|
|
2035
2045
|
const createResult = await handleApiResponse(createResponse);
|
|
2036
2046
|
const { id: deploymentId, uploadUrl, uploadFields } = createResult;
|
|
2037
|
-
const
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
"
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
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
|
+
});
|
|
2049
2076
|
const uploadFormData = new FormData();
|
|
2050
2077
|
for (const [key, value] of Object.entries(uploadFields)) {
|
|
2051
2078
|
uploadFormData.append(key, value);
|
|
@@ -2063,8 +2090,6 @@ To: Your current project directory
|
|
|
2063
2090
|
const uploadError = await uploadResponse.text();
|
|
2064
2091
|
throw new Error(`Failed to upload zip file: ${uploadError}`);
|
|
2065
2092
|
}
|
|
2066
|
-
await fs.unlink(zipPath).catch(() => {
|
|
2067
|
-
});
|
|
2068
2093
|
const startBody = {};
|
|
2069
2094
|
if (projectSettings) startBody.projectSettings = projectSettings;
|
|
2070
2095
|
if (envVars) startBody.envVars = envVars;
|
|
@@ -2103,7 +2128,8 @@ To: Your current project directory
|
|
|
2103
2128
|
return {
|
|
2104
2129
|
apiKey: GLOBAL_API_KEY,
|
|
2105
2130
|
apiBaseUrl: API_BASE_URL,
|
|
2106
|
-
toolCount
|
|
2131
|
+
toolCount,
|
|
2132
|
+
backendVersion
|
|
2107
2133
|
};
|
|
2108
2134
|
}
|
|
2109
2135
|
|
package/dist/http-server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
registerInsforgeTools
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
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.
|
|
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.
|
|
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",
|