@insforge/mcp 1.2.5 → 1.2.6-dev.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.
@@ -848,7 +848,7 @@ var apiKeyResponseSchema = z11.object({
848
848
 
849
849
  // node_modules/@insforge/shared-schemas/dist/ai.schema.js
850
850
  import { z as z12 } from "zod";
851
- var modalitySchema = z12.enum(["text", "image"]);
851
+ var modalitySchema = z12.enum(["text", "image", "audio"]);
852
852
  var aiConfigurationInputSchema = z12.object({
853
853
  inputModality: z12.array(modalitySchema).min(1),
854
854
  outputModality: z12.array(modalitySchema).min(1),
@@ -910,7 +910,16 @@ var imageContentSchema = z13.object({
910
910
  detail: z13.enum(["auto", "low", "high"]).optional()
911
911
  })
912
912
  });
913
- var contentSchema = z13.union([textContentSchema, imageContentSchema]);
913
+ var audioContentSchema = z13.object({
914
+ type: z13.literal("input_audio"),
915
+ // eslint-disable-next-line @typescript-eslint/naming-convention
916
+ input_audio: z13.object({
917
+ // Base64-encoded audio data (direct URLs not supported for audio)
918
+ data: z13.string(),
919
+ format: z13.enum(["wav", "mp3", "aiff", "aac", "ogg", "flac", "m4a"])
920
+ })
921
+ });
922
+ var contentSchema = z13.union([textContentSchema, imageContentSchema, audioContentSchema]);
914
923
  var chatMessageSchema = z13.object({
915
924
  role: z13.enum(["user", "assistant", "system"]),
916
925
  // New format: content can be string or array of content parts (OpenAI-compatible)
@@ -1158,6 +1167,30 @@ var cloudEventSchema = z18.discriminatedUnion("type", [
1158
1167
 
1159
1168
  // node_modules/@insforge/shared-schemas/dist/docs.schema.js
1160
1169
  import { z as z19 } from "zod";
1170
+ var sdkFeatureSchema = z19.enum(["db", "storage", "functions", "auth", "ai", "realtime"]).describe(`
1171
+ SDK feature categories:
1172
+
1173
+ - "db" - Database operations
1174
+ - "storage" - File storage
1175
+ - "functions" - Edge functions
1176
+ - "auth" - User authentication
1177
+ - "ai" - AI features
1178
+ - "realtime" - Real-time WebSockets
1179
+ `);
1180
+ var sdkLanguageSchema = z19.enum([
1181
+ "typescript",
1182
+ "swift",
1183
+ "kotlin",
1184
+ // 'flutter',
1185
+ "rest-api"
1186
+ ]).describe(`
1187
+ SDK languages:
1188
+
1189
+ - "typescript" - JavaScript/TypeScript SDK
1190
+ - "swift" - Swift SDK
1191
+ - "kotlin" - Kotlin SDK
1192
+ - "rest-api" - REST API
1193
+ `);
1161
1194
  var docTypeSchema = z19.enum([
1162
1195
  "instructions",
1163
1196
  "auth-sdk",
@@ -1268,11 +1301,12 @@ import FormData from "form-data";
1268
1301
  var execAsync = promisify(exec);
1269
1302
  var TOOL_VERSION_REQUIREMENTS = {
1270
1303
  // Schedule tools - require backend v1.1.1+
1271
- "upsert-schedule": { minVersion: "1.1.1" },
1272
- "delete-schedule": { minVersion: "1.1.1" },
1304
+ // 'upsert-schedule': { minVersion: '1.1.1' },
1305
+ // 'delete-schedule': { minVersion: '1.1.1' },
1273
1306
  // 'get-schedules': { minVersion: '1.1.1' },
1274
1307
  // 'get-schedule-logs': { minVersion: '1.1.1' },
1275
1308
  "create-deployment": { minVersion: "1.4.7" }
1309
+ // 'fetch-sdk-docs': { minVersion: '1.4.7' },
1276
1310
  // Example of a deprecated tool (uncomment when needed):
1277
1311
  // 'legacy-tool': { minVersion: '1.0.0', maxVersion: '1.5.0' },
1278
1312
  };
@@ -1374,6 +1408,7 @@ async function registerInsforgeTools(server, config = {}) {
1374
1408
  let content = result.content;
1375
1409
  content = content.replace(/http:\/\/localhost:7130/g, API_BASE_URL);
1376
1410
  content = content.replace(/https:\/\/your-app\.region\.insforge\.app/g, API_BASE_URL);
1411
+ content = content.replace(/https:\/\/your-app\.insforge\.app/g, API_BASE_URL);
1377
1412
  return content;
1378
1413
  }
1379
1414
  throw new Error("Invalid response format from documentation endpoint");
@@ -1382,6 +1417,31 @@ async function registerInsforgeTools(server, config = {}) {
1382
1417
  throw new Error(`Unable to retrieve ${docType} documentation: ${errMsg}`);
1383
1418
  }
1384
1419
  };
1420
+ const fetchSDKDocumentation = async (feature, language) => {
1421
+ try {
1422
+ const response = await fetch2(`${API_BASE_URL}/api/docs/${feature}/${language}`, {
1423
+ method: "GET",
1424
+ headers: {
1425
+ "Content-Type": "application/json"
1426
+ }
1427
+ });
1428
+ if (response.status === 404) {
1429
+ throw new Error("Documentation not found. This feature may not be supported in your project version. Please contact the Insforge team for assistance.");
1430
+ }
1431
+ const result = await handleApiResponse(response);
1432
+ if (result && typeof result === "object" && "content" in result) {
1433
+ let content = result.content;
1434
+ content = content.replace(/http:\/\/localhost:7130/g, API_BASE_URL);
1435
+ content = content.replace(/https:\/\/your-app\.region\.insforge\.app/g, API_BASE_URL);
1436
+ content = content.replace(/https:\/\/your-app\.insforge\.app/g, API_BASE_URL);
1437
+ return content;
1438
+ }
1439
+ throw new Error("Invalid response format from documentation endpoint");
1440
+ } catch (error) {
1441
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1442
+ throw new Error(`Unable to retrieve ${feature}-${language} documentation: ${errMsg}`);
1443
+ }
1444
+ };
1385
1445
  const fetchInsforgeInstructionsContext = async () => {
1386
1446
  try {
1387
1447
  return await fetchDocumentation("instructions");
@@ -1440,6 +1500,43 @@ ${context}`
1440
1500
  }
1441
1501
  })
1442
1502
  );
1503
+ registerTool(
1504
+ "fetch-sdk-docs",
1505
+ `Fetch Insforge SDK documentation for a specific feature and language combination.
1506
+
1507
+ Supported features: ${sdkFeatureSchema.options.join(", ")}
1508
+ Supported languages: ${sdkLanguageSchema.options.join(", ")}`,
1509
+ {
1510
+ sdkFeature: sdkFeatureSchema,
1511
+ sdkLanguage: sdkLanguageSchema
1512
+ },
1513
+ withUsageTracking("fetch-sdk-docs", async ({ sdkFeature, sdkLanguage }) => {
1514
+ try {
1515
+ const content = await fetchSDKDocumentation(sdkFeature, sdkLanguage);
1516
+ return await addBackgroundContext({
1517
+ content: [
1518
+ {
1519
+ type: "text",
1520
+ text: content
1521
+ }
1522
+ ]
1523
+ });
1524
+ } catch (error) {
1525
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1526
+ if (errMsg.includes("404") || errMsg.toLowerCase().includes("not found")) {
1527
+ return {
1528
+ content: [{
1529
+ type: "text",
1530
+ text: `Documentation for "${sdkFeature}-${sdkLanguage}" is not available. This is likely because your backend version is too old and doesn't support this documentation endpoint yet. This won't affect the functionality of the tools - they will still work correctly.`
1531
+ }]
1532
+ };
1533
+ }
1534
+ return {
1535
+ content: [{ type: "text", text: `Error fetching ${sdkFeature}-${sdkLanguage} documentation: ${errMsg}` }]
1536
+ };
1537
+ }
1538
+ })
1539
+ );
1443
1540
  registerTool(
1444
1541
  "get-anon-key",
1445
1542
  "Generate an anonymous JWT token that never expires. Requires admin API key. Use this for client-side applications that need public access.",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-FUYK7JVW.js";
4
+ } from "./chunk-LMIQ5YVT.js";
5
5
 
6
6
  // src/http/server.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-FUYK7JVW.js";
4
+ } from "./chunk-LMIQ5YVT.js";
5
5
 
6
6
  // src/stdio/index.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/mcp",
3
- "version": "1.2.5",
3
+ "version": "1.2.6-dev.0",
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,7 +36,7 @@
36
36
  "server.json"
37
37
  ],
38
38
  "dependencies": {
39
- "@insforge/shared-schemas": "1.1.38",
39
+ "@insforge/shared-schemas": "1.1.39-dev.0",
40
40
  "@modelcontextprotocol/sdk": "^1.15.1",
41
41
  "@types/express": "^5.0.3",
42
42
  "archiver": "^7.0.1",