@insforge/mcp 1.0.54

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.
Files changed (3) hide show
  1. package/README.md +35 -0
  2. package/dist/index.js +1260 -0
  3. package/package.json +40 -0
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ <div align="center">
2
+ <a href="https://insforge.com">
3
+ <img src="logo.svg" alt="Insforge Logo" width="400">
4
+ </a>
5
+ </div>
6
+
7
+ # Insforge MCP Server
8
+
9
+ Model Context Protocol server for [Insforge](https://github.com/InsForge/insforge).
10
+
11
+ ## 📖 Documentation
12
+
13
+ Please visit the [main Insforge repository](https://github.com/InsForge/insforge) for:
14
+
15
+ - Installation and setup instructions
16
+ - Configuration guide
17
+ - Available tools and usage examples
18
+ - API documentation
19
+ - Contributing guidelines
20
+
21
+ ## 🚀 Quick Start
22
+
23
+ ```bash
24
+ npm install -g @insforge/insforge-mcp
25
+ ```
26
+
27
+ For detailed setup instructions, see the [MCP Integration Guide](https://github.com/InsForge/insforge#mcp-integration-setup) in the main repository.
28
+
29
+ ## 📄 License
30
+
31
+ Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
32
+
33
+ ---
34
+
35
+ Part of the [Insforge](https://github.com/InsForge/insforge) project.
package/dist/index.js ADDED
@@ -0,0 +1,1260 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
+ import { z as z12 } from "zod";
7
+ import fetch2 from "node-fetch";
8
+ import { program } from "commander";
9
+ import { promises as fs } from "fs";
10
+
11
+ // src/response-handler.ts
12
+ async function handleApiResponse(response) {
13
+ const responseData = await response.json();
14
+ if (!response.ok) {
15
+ const errorData = responseData;
16
+ let fullMessage = errorData.message || errorData.error || "Unknown error";
17
+ if (errorData.nextAction) {
18
+ fullMessage += `. ${errorData.nextAction}`;
19
+ }
20
+ throw new Error(fullMessage);
21
+ }
22
+ return responseData;
23
+ }
24
+ function formatSuccessMessage(operation, data) {
25
+ if (data && typeof data === "object" && "message" in data) {
26
+ return `${data.message}
27
+ ${JSON.stringify(data, null, 2)}`;
28
+ }
29
+ return `${operation} completed successfully:
30
+ ${JSON.stringify(data, null, 2)}`;
31
+ }
32
+
33
+ // src/usage-tracker.ts
34
+ import fetch from "node-fetch";
35
+ var UsageTracker = class {
36
+ apiBaseUrl;
37
+ apiKey;
38
+ constructor(apiBaseUrl, apiKey) {
39
+ this.apiBaseUrl = apiBaseUrl;
40
+ this.apiKey = apiKey;
41
+ }
42
+ async trackUsage(toolName, success = true) {
43
+ if (!this.apiKey) {
44
+ return;
45
+ }
46
+ try {
47
+ const payload = {
48
+ tool_name: toolName,
49
+ success,
50
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
51
+ };
52
+ await fetch(`${this.apiBaseUrl}/api/usage/mcp`, {
53
+ method: "POST",
54
+ headers: {
55
+ "Content-Type": "application/json",
56
+ "x-api-key": this.apiKey
57
+ },
58
+ body: JSON.stringify(payload)
59
+ });
60
+ } catch (error) {
61
+ console.error("Failed to track usage:", error);
62
+ }
63
+ }
64
+ };
65
+
66
+ // node_modules/@insforge/shared-schemas/dist/database.schema.js
67
+ import { z } from "zod";
68
+ var ColumnType;
69
+ (function(ColumnType2) {
70
+ ColumnType2["STRING"] = "string";
71
+ ColumnType2["DATE"] = "date";
72
+ ColumnType2["DATETIME"] = "datetime";
73
+ ColumnType2["INTEGER"] = "integer";
74
+ ColumnType2["FLOAT"] = "float";
75
+ ColumnType2["BOOLEAN"] = "boolean";
76
+ ColumnType2["UUID"] = "uuid";
77
+ ColumnType2["JSON"] = "json";
78
+ })(ColumnType || (ColumnType = {}));
79
+ var onUpdateActionSchema = z.enum(["CASCADE", "RESTRICT", "NO ACTION"]);
80
+ var onDeleteActionSchema = z.enum([
81
+ "CASCADE",
82
+ "SET NULL",
83
+ "SET DEFAULT",
84
+ "RESTRICT",
85
+ "NO ACTION"
86
+ ]);
87
+ var columnTypeSchema = z.enum([
88
+ ColumnType.STRING,
89
+ ColumnType.DATE,
90
+ ColumnType.DATETIME,
91
+ ColumnType.INTEGER,
92
+ ColumnType.FLOAT,
93
+ ColumnType.BOOLEAN,
94
+ ColumnType.UUID,
95
+ ColumnType.JSON
96
+ ]);
97
+ var foreignKeySchema = z.object({
98
+ referenceTable: z.string().min(1, "Target table cannot be empty"),
99
+ referenceColumn: z.string().min(1, "Target column cannot be empty"),
100
+ onDelete: onDeleteActionSchema,
101
+ onUpdate: onUpdateActionSchema
102
+ });
103
+ var columnSchema = z.object({
104
+ columnName: z.string().min(1, "Column name cannot be empty").max(64, "Column name must be less than 64 characters"),
105
+ type: z.union([columnTypeSchema, z.string()]),
106
+ defaultValue: z.string().optional(),
107
+ isPrimaryKey: z.boolean().optional(),
108
+ isNullable: z.boolean(),
109
+ isUnique: z.boolean(),
110
+ foreignKey: foreignKeySchema.optional()
111
+ });
112
+ var tableSchema = z.object({
113
+ tableName: z.string().min(1, "Table name cannot be empty").max(64, "Table name must be less than 64 characters"),
114
+ columns: z.array(columnSchema).min(1, "At least one column is required"),
115
+ recordCount: z.number().default(0),
116
+ createdAt: z.string().optional(),
117
+ updatedAt: z.string().optional()
118
+ });
119
+
120
+ // node_modules/@insforge/shared-schemas/dist/database-api.schema.js
121
+ import { z as z2 } from "zod";
122
+ var createTableRequestSchema = tableSchema.pick({
123
+ tableName: true,
124
+ columns: true
125
+ }).extend({
126
+ rlsEnabled: z2.boolean().default(true)
127
+ });
128
+ var createTableResponseSchema = tableSchema.pick({
129
+ tableName: true,
130
+ columns: true
131
+ }).extend({
132
+ message: z2.string(),
133
+ autoFields: z2.array(z2.string()),
134
+ nextActions: z2.string()
135
+ });
136
+ var updateTableSchemaRequestSchema = z2.object({
137
+ addColumns: z2.array(columnSchema.omit({
138
+ foreignKey: true
139
+ })).optional(),
140
+ dropColumns: z2.array(z2.string()).optional(),
141
+ updateColumns: z2.array(z2.object({
142
+ columnName: z2.string(),
143
+ defaultValue: z2.string().optional(),
144
+ newColumnName: z2.string().min(1, "New column name cannot be empty").max(64, "New column name must be less than 64 characters").optional()
145
+ })).optional(),
146
+ addForeignKeys: z2.array(z2.object({
147
+ columnName: z2.string().min(1, "Column name is required for adding foreign key"),
148
+ foreignKey: foreignKeySchema
149
+ })).optional(),
150
+ dropForeignKeys: z2.array(z2.string()).optional(),
151
+ renameTable: z2.object({
152
+ newTableName: z2.string().min(1, "New table name cannot be empty").max(64, "New table name must be less than 64 characters")
153
+ }).optional()
154
+ });
155
+ var updateTableSchemaResponse = z2.object({
156
+ message: z2.string(),
157
+ tableName: z2.string(),
158
+ operations: z2.array(z2.string())
159
+ });
160
+ var deleteTableResponse = z2.object({
161
+ message: z2.string(),
162
+ tableName: z2.string(),
163
+ nextActions: z2.string()
164
+ });
165
+ var rawSQLRequestSchema = z2.object({
166
+ query: z2.string().min(1, "Query is required"),
167
+ params: z2.array(z2.any()).optional()
168
+ });
169
+ var rawSQLResponseSchema = z2.object({
170
+ rows: z2.array(z2.any()),
171
+ rowCount: z2.number().nullable(),
172
+ fields: z2.array(z2.object({
173
+ name: z2.string(),
174
+ dataTypeID: z2.number()
175
+ })).optional()
176
+ });
177
+ var exportRequestSchema = z2.object({
178
+ tables: z2.array(z2.string()).optional(),
179
+ format: z2.enum(["sql", "json"]).default("sql"),
180
+ includeData: z2.boolean().default(true),
181
+ includeFunctions: z2.boolean().default(false),
182
+ includeSequences: z2.boolean().default(false),
183
+ includeViews: z2.boolean().default(false),
184
+ rowLimit: z2.number().int().positive().max(1e4).default(1e3)
185
+ });
186
+ var exportJsonDataSchema = z2.object({
187
+ timestamp: z2.string(),
188
+ tables: z2.record(z2.string(), z2.object({
189
+ schema: z2.array(z2.object({
190
+ columnName: z2.string(),
191
+ dataType: z2.string(),
192
+ characterMaximumLength: z2.number().nullable(),
193
+ isNullable: z2.string(),
194
+ columnDefault: z2.string().nullable()
195
+ })),
196
+ indexes: z2.array(z2.object({
197
+ indexname: z2.string(),
198
+ indexdef: z2.string(),
199
+ isUnique: z2.boolean().nullable(),
200
+ isPrimary: z2.boolean().nullable()
201
+ })),
202
+ foreignKeys: z2.array(z2.object({
203
+ constraintName: z2.string(),
204
+ columnName: z2.string(),
205
+ foreignTableName: z2.string(),
206
+ foreignColumnName: z2.string(),
207
+ deleteRule: z2.string().nullable(),
208
+ updateRule: z2.string().nullable()
209
+ })),
210
+ rlsEnabled: z2.boolean().optional(),
211
+ policies: z2.array(z2.object({
212
+ policyname: z2.string(),
213
+ cmd: z2.string(),
214
+ roles: z2.array(z2.string()),
215
+ qual: z2.string().nullable(),
216
+ withCheck: z2.string().nullable()
217
+ })),
218
+ triggers: z2.array(z2.object({
219
+ triggerName: z2.string(),
220
+ actionTiming: z2.string(),
221
+ eventManipulation: z2.string(),
222
+ actionOrientation: z2.string(),
223
+ actionCondition: z2.string().nullable(),
224
+ actionStatement: z2.string(),
225
+ newTable: z2.string().nullable(),
226
+ oldTable: z2.string().nullable()
227
+ })),
228
+ rows: z2.array(z2.any()).optional()
229
+ })),
230
+ functions: z2.array(z2.object({
231
+ functionName: z2.string(),
232
+ functionDef: z2.string(),
233
+ kind: z2.string()
234
+ })),
235
+ sequences: z2.array(z2.object({
236
+ sequenceName: z2.string(),
237
+ startValue: z2.string(),
238
+ increment: z2.string(),
239
+ minValue: z2.string().nullable(),
240
+ maxValue: z2.string().nullable(),
241
+ cycle: z2.string()
242
+ })),
243
+ views: z2.array(z2.object({
244
+ viewName: z2.string(),
245
+ definition: z2.string()
246
+ }))
247
+ });
248
+ var exportResponseSchema = z2.object({
249
+ format: z2.enum(["sql", "json"]),
250
+ data: z2.union([z2.string(), exportJsonDataSchema]),
251
+ timestamp: z2.string()
252
+ });
253
+ var importRequestSchema = z2.object({
254
+ truncate: z2.union([
255
+ z2.boolean(),
256
+ z2.string().transform((val) => {
257
+ if (val === "true")
258
+ return true;
259
+ if (val === "false")
260
+ return false;
261
+ throw new Error("Invalid boolean string");
262
+ })
263
+ ]).default(false)
264
+ });
265
+ var importResponseSchema = z2.object({
266
+ success: z2.boolean(),
267
+ message: z2.string(),
268
+ filename: z2.string(),
269
+ tables: z2.array(z2.string()),
270
+ rowsImported: z2.number(),
271
+ fileSize: z2.number()
272
+ });
273
+
274
+ // node_modules/@insforge/shared-schemas/dist/storage.schema.js
275
+ import { z as z3 } from "zod";
276
+ var storageFileSchema = z3.object({
277
+ key: z3.string(),
278
+ bucket: z3.string(),
279
+ size: z3.number(),
280
+ mimeType: z3.string().optional(),
281
+ uploadedAt: z3.string(),
282
+ url: z3.string()
283
+ });
284
+ var storageBucketSchema = z3.object({
285
+ name: z3.string(),
286
+ public: z3.boolean(),
287
+ createdAt: z3.string()
288
+ });
289
+
290
+ // node_modules/@insforge/shared-schemas/dist/storage-api.schema.js
291
+ import { z as z4 } from "zod";
292
+ var createBucketRequestSchema = z4.object({
293
+ bucketName: z4.string().min(1, "Bucket name cannot be empty"),
294
+ isPublic: z4.boolean().default(true)
295
+ });
296
+ var updateBucketRequestSchema = z4.object({
297
+ isPublic: z4.boolean()
298
+ });
299
+ var listObjectsResponseSchema = z4.object({
300
+ objects: z4.array(storageFileSchema),
301
+ pagination: z4.object({
302
+ offset: z4.number(),
303
+ limit: z4.number(),
304
+ total: z4.number()
305
+ })
306
+ });
307
+ var uploadStrategyRequestSchema = z4.object({
308
+ filename: z4.string().min(1, "Filename cannot be empty"),
309
+ contentType: z4.string().optional(),
310
+ size: z4.number().optional()
311
+ });
312
+ var uploadStrategyResponseSchema = z4.object({
313
+ method: z4.enum(["presigned", "direct"]),
314
+ uploadUrl: z4.string(),
315
+ fields: z4.record(z4.string()).optional(),
316
+ key: z4.string(),
317
+ confirmRequired: z4.boolean(),
318
+ confirmUrl: z4.string().optional(),
319
+ expiresAt: z4.date().optional()
320
+ });
321
+ var downloadStrategyRequestSchema = z4.object({
322
+ expiresIn: z4.number().optional().default(3600)
323
+ });
324
+ var downloadStrategyResponseSchema = z4.object({
325
+ method: z4.enum(["presigned", "direct"]),
326
+ url: z4.string(),
327
+ expiresAt: z4.date().optional(),
328
+ headers: z4.record(z4.string()).optional()
329
+ });
330
+ var confirmUploadRequestSchema = z4.object({
331
+ size: z4.number(),
332
+ contentType: z4.string().optional(),
333
+ etag: z4.string().optional()
334
+ });
335
+
336
+ // node_modules/@insforge/shared-schemas/dist/auth.schema.js
337
+ import { z as z5 } from "zod";
338
+ var userIdSchema = z5.string().uuid("Invalid user ID format");
339
+ var emailSchema = z5.string().email("Invalid email format").toLowerCase().trim();
340
+ var passwordSchema = z5.string().min(6, "Password must be at least 6 characters").max(32, "Password must be less than 32 characters");
341
+ var nameSchema = z5.string().min(1, "Name is required").max(100, "Name must be less than 100 characters").trim();
342
+ var roleSchema = z5.enum(["authenticated", "project_admin"]);
343
+ var userSchema = z5.object({
344
+ id: userIdSchema,
345
+ email: emailSchema,
346
+ name: nameSchema,
347
+ emailVerified: z5.boolean(),
348
+ identities: z5.array(z5.object({
349
+ provider: z5.string()
350
+ })).optional(),
351
+ providerType: z5.string().optional(),
352
+ createdAt: z5.string(),
353
+ // PostgreSQL timestamp
354
+ updatedAt: z5.string()
355
+ // PostgreSQL timestamp
356
+ });
357
+ var oAuthProvidersSchema = z5.enum(["google", "github"]);
358
+ var oAuthStateSchema = z5.object({
359
+ provider: oAuthProvidersSchema,
360
+ redirectUri: z5.string().url().optional()
361
+ });
362
+ var oAuthConfigSchema = z5.object({
363
+ provider: z5.string(),
364
+ clientId: z5.string().optional(),
365
+ scopes: z5.array(z5.string()).optional(),
366
+ redirectUri: z5.string().optional(),
367
+ useSharedKey: z5.boolean()
368
+ });
369
+ var tokenPayloadSchema = z5.object({
370
+ sub: userIdSchema,
371
+ // Subject (user ID)
372
+ email: emailSchema,
373
+ role: roleSchema,
374
+ iat: z5.number().optional(),
375
+ // Issued at
376
+ exp: z5.number().optional()
377
+ // Expiration
378
+ });
379
+
380
+ // node_modules/@insforge/shared-schemas/dist/auth-api.schema.js
381
+ import { z as z6 } from "zod";
382
+ var paginationSchema = z6.object({
383
+ limit: z6.string().optional(),
384
+ offset: z6.string().optional()
385
+ });
386
+ var createUserRequestSchema = z6.object({
387
+ email: emailSchema,
388
+ password: passwordSchema,
389
+ name: nameSchema.optional()
390
+ });
391
+ var createSessionRequestSchema = z6.object({
392
+ email: emailSchema,
393
+ password: passwordSchema
394
+ });
395
+ var exchangeAdminSessionRequestSchema = z6.object({
396
+ code: z6.string()
397
+ });
398
+ var listUsersRequestSchema = paginationSchema.extend({
399
+ search: z6.string().optional()
400
+ }).optional();
401
+ var deleteUsersRequestSchema = z6.object({
402
+ userIds: z6.array(userIdSchema).min(1, "At least one user ID is required")
403
+ });
404
+ var createUserResponseSchema = z6.object({
405
+ user: userSchema,
406
+ accessToken: z6.string()
407
+ });
408
+ var getCurrentSessionResponseSchema = z6.object({
409
+ user: z6.object({
410
+ id: userIdSchema,
411
+ email: emailSchema,
412
+ role: roleSchema
413
+ })
414
+ });
415
+ var listUsersResponseSchema = z6.object({
416
+ data: z6.array(userSchema),
417
+ pagination: z6.object({
418
+ offset: z6.number(),
419
+ limit: z6.number(),
420
+ total: z6.number()
421
+ })
422
+ });
423
+ var deleteUsersResponseSchema = z6.object({
424
+ message: z6.string(),
425
+ deletedCount: z6.number().int().nonnegative()
426
+ });
427
+ var getOauthUrlResponseSchema = z6.object({
428
+ authUrl: z6.string().url()
429
+ });
430
+ var createOAuthConfigRequestSchema = oAuthConfigSchema.extend({
431
+ clientSecret: z6.string().optional()
432
+ });
433
+ var updateOAuthConfigRequestSchema = oAuthConfigSchema.extend({
434
+ clientSecret: z6.string().optional()
435
+ }).omit({
436
+ provider: true
437
+ });
438
+ var listOAuthConfigsResponseSchema = z6.object({
439
+ data: z6.array(oAuthConfigSchema),
440
+ count: z6.number()
441
+ });
442
+ var authErrorResponseSchema = z6.object({
443
+ error: z6.string(),
444
+ message: z6.string(),
445
+ statusCode: z6.number().int(),
446
+ nextActions: z6.string().optional()
447
+ });
448
+
449
+ // node_modules/@insforge/shared-schemas/dist/metadata.schema.js
450
+ import { z as z7 } from "zod";
451
+ var authMetadataSchema = z7.object({
452
+ oauths: z7.array(oAuthConfigSchema)
453
+ });
454
+ var databaseMetadataSchema = z7.object({
455
+ tables: z7.array(tableSchema),
456
+ totalSize: z7.number()
457
+ });
458
+ var bucketMetadataSchema = storageBucketSchema.extend({
459
+ objectCount: z7.number().optional()
460
+ });
461
+ var storageMetadataSchema = z7.object({
462
+ buckets: z7.array(bucketMetadataSchema),
463
+ totalSize: z7.number()
464
+ });
465
+ var edgeFunctionMetadataSchema = z7.object({
466
+ slug: z7.string(),
467
+ name: z7.string(),
468
+ description: z7.string().nullable(),
469
+ status: z7.string()
470
+ });
471
+ var aiMetadataSchema = z7.object({
472
+ models: z7.array(z7.object({
473
+ modality: z7.string(),
474
+ modelId: z7.string()
475
+ }))
476
+ });
477
+ var appMetaDataSchema = z7.object({
478
+ auth: authMetadataSchema,
479
+ database: databaseMetadataSchema,
480
+ storage: storageMetadataSchema,
481
+ aiIntegration: aiMetadataSchema.optional(),
482
+ functions: z7.array(edgeFunctionMetadataSchema),
483
+ version: z7.string().optional()
484
+ });
485
+
486
+ // node_modules/@insforge/shared-schemas/dist/ai.schema.js
487
+ import { z as z8 } from "zod";
488
+ var modalitySchema = z8.enum(["text", "image", "audio", "video", "multi"]);
489
+ var aiConfigurationSchema = z8.object({
490
+ id: z8.string().uuid(),
491
+ modality: modalitySchema,
492
+ provider: z8.string(),
493
+ modelId: z8.string(),
494
+ systemPrompt: z8.string().optional()
495
+ });
496
+ var aiConfigurationWithUsageSchema = aiConfigurationSchema.extend({
497
+ usageStats: z8.object({
498
+ totalInputTokens: z8.number(),
499
+ totalOutputTokens: z8.number(),
500
+ totalTokens: z8.number(),
501
+ totalImageCount: z8.number(),
502
+ totalRequests: z8.number()
503
+ }).optional()
504
+ });
505
+ var aiUsageDataSchema = z8.object({
506
+ configId: z8.string().uuid(),
507
+ inputTokens: z8.number().int().optional(),
508
+ outputTokens: z8.number().int().optional(),
509
+ imageCount: z8.number().int().optional(),
510
+ imageResolution: z8.string().optional()
511
+ });
512
+ var aiUsageRecordSchema = aiUsageDataSchema.extend({
513
+ id: z8.string().uuid(),
514
+ createdAt: z8.date()
515
+ });
516
+ var aiUsageSummarySchema = z8.object({
517
+ totalInputTokens: z8.number(),
518
+ totalOutputTokens: z8.number(),
519
+ totalTokens: z8.number(),
520
+ totalImageCount: z8.number(),
521
+ totalRequests: z8.number()
522
+ });
523
+
524
+ // node_modules/@insforge/shared-schemas/dist/ai-api.schema.js
525
+ import { z as z9 } from "zod";
526
+ var chatMessageSchema = z9.object({
527
+ role: z9.enum(["user", "assistant", "system"]),
528
+ content: z9.string(),
529
+ images: z9.array(z9.object({
530
+ url: z9.string()
531
+ })).optional()
532
+ });
533
+ var chatCompletionRequestSchema = z9.object({
534
+ model: z9.string(),
535
+ messages: z9.array(chatMessageSchema),
536
+ temperature: z9.number().min(0).max(2).optional(),
537
+ maxTokens: z9.number().positive().optional(),
538
+ topP: z9.number().min(0).max(1).optional(),
539
+ stream: z9.boolean().optional()
540
+ });
541
+ var chatCompletionResponseSchema = z9.object({
542
+ text: z9.string(),
543
+ metadata: z9.object({
544
+ model: z9.string(),
545
+ usage: z9.object({
546
+ promptTokens: z9.number().optional(),
547
+ completionTokens: z9.number().optional(),
548
+ totalTokens: z9.number().optional()
549
+ }).optional()
550
+ }).optional()
551
+ });
552
+ var imageGenerationRequestSchema = z9.object({
553
+ model: z9.string(),
554
+ prompt: z9.string(),
555
+ images: z9.array(z9.object({
556
+ url: z9.string()
557
+ })).optional()
558
+ });
559
+ var imageGenerationResponseSchema = z9.object({
560
+ text: z9.string().optional(),
561
+ images: z9.array(z9.object({
562
+ type: z9.literal("imageUrl"),
563
+ imageUrl: z9.string()
564
+ })),
565
+ metadata: z9.object({
566
+ model: z9.string(),
567
+ usage: z9.object({
568
+ promptTokens: z9.number().optional(),
569
+ completionTokens: z9.number().optional(),
570
+ totalTokens: z9.number().optional()
571
+ }).optional()
572
+ }).optional()
573
+ });
574
+ var openRouterModelSchema = z9.object({
575
+ id: z9.string(),
576
+ name: z9.string(),
577
+ created: z9.number(),
578
+ description: z9.string().optional(),
579
+ architecture: z9.object({
580
+ inputModalities: z9.array(z9.string()),
581
+ outputModalities: z9.array(z9.string()),
582
+ tokenizer: z9.string(),
583
+ instructType: z9.string()
584
+ }).optional(),
585
+ topProvider: z9.object({
586
+ isModerated: z9.boolean(),
587
+ contextLength: z9.number(),
588
+ maxCompletionTokens: z9.number()
589
+ }).optional(),
590
+ pricing: z9.object({
591
+ prompt: z9.string(),
592
+ completion: z9.string(),
593
+ image: z9.string().optional(),
594
+ request: z9.string().optional(),
595
+ webSearch: z9.string().optional(),
596
+ internalReasoning: z9.string().optional(),
597
+ inputCacheRead: z9.string().optional(),
598
+ inputCacheWrite: z9.string().optional()
599
+ })
600
+ });
601
+ var listModelsResponseSchema = z9.object({
602
+ text: z9.array(z9.object({
603
+ provider: z9.string(),
604
+ configured: z9.boolean(),
605
+ models: z9.array(openRouterModelSchema)
606
+ })),
607
+ image: z9.array(z9.object({
608
+ provider: z9.string(),
609
+ configured: z9.boolean(),
610
+ models: z9.array(openRouterModelSchema)
611
+ }))
612
+ });
613
+ var createAIConfigurationRequestSchema = aiConfigurationSchema.omit({
614
+ id: true
615
+ });
616
+ var updateAIConfigurationRequestSchema = z9.object({
617
+ systemPrompt: z9.string().nullable()
618
+ });
619
+ var listAIUsageResponseSchema = z9.object({
620
+ records: z9.array(aiUsageRecordSchema),
621
+ total: z9.number()
622
+ });
623
+ var getAIUsageRequestSchema = z9.object({
624
+ startDate: z9.string().datetime().optional(),
625
+ endDate: z9.string().datetime().optional(),
626
+ limit: z9.string().regex(/^\d+$/).default("50"),
627
+ offset: z9.string().regex(/^\d+$/).default("0")
628
+ });
629
+ var getAIUsageSummaryRequestSchema = z9.object({
630
+ configId: z9.string().uuid().optional(),
631
+ startDate: z9.string().datetime().optional(),
632
+ endDate: z9.string().datetime().optional()
633
+ });
634
+
635
+ // node_modules/@insforge/shared-schemas/dist/logs.schema.js
636
+ import { z as z10 } from "zod";
637
+ var auditLogSchema = z10.object({
638
+ id: z10.string(),
639
+ actor: z10.string(),
640
+ action: z10.string(),
641
+ module: z10.string(),
642
+ details: z10.record(z10.unknown()).nullable(),
643
+ ipAddress: z10.string().nullable(),
644
+ createdAt: z10.string(),
645
+ updatedAt: z10.string()
646
+ });
647
+
648
+ // node_modules/@insforge/shared-schemas/dist/logs-api.schema.js
649
+ import { z as z11 } from "zod";
650
+ var getAuditLogsRequestSchema = z11.object({
651
+ limit: z11.number().default(100),
652
+ offset: z11.number().default(0),
653
+ actor: z11.string().optional(),
654
+ action: z11.string().optional(),
655
+ module: z11.string().optional(),
656
+ startDate: z11.string().optional(),
657
+ endDate: z11.string().optional()
658
+ });
659
+ var getAuditLogsResponseSchema = z11.object({
660
+ data: z11.array(auditLogSchema),
661
+ pagination: z11.object({
662
+ limit: z11.number(),
663
+ offset: z11.number(),
664
+ total: z11.number()
665
+ })
666
+ });
667
+ var getAuditLogStatsRequestSchema = z11.object({
668
+ days: z11.number().default(7)
669
+ });
670
+ var getAuditLogStatsResponseSchema = z11.object({
671
+ totalLogs: z11.number(),
672
+ uniqueActors: z11.number(),
673
+ uniqueModules: z11.number(),
674
+ actionsByModule: z11.record(z11.number()),
675
+ recentActivity: z11.array(auditLogSchema)
676
+ });
677
+ var clearAuditLogsRequestSchema = z11.object({
678
+ daysToKeep: z11.number().default(90)
679
+ });
680
+ var clearAuditLogsResponseSchema = z11.object({
681
+ message: z11.string(),
682
+ deleted: z11.number()
683
+ });
684
+
685
+ // src/index.ts
686
+ program.option("--api_key <value>", "API Key");
687
+ program.parse(process.argv);
688
+ var options = program.opts();
689
+ var { api_key } = options;
690
+ var GLOBAL_API_KEY = api_key || process.env.API_KEY || "";
691
+ var server = new McpServer({
692
+ name: "insforge-mcp",
693
+ version: "1.0.0"
694
+ });
695
+ var API_BASE_URL = process.env.API_BASE_URL || "http://localhost:7130";
696
+ var usageTracker = new UsageTracker(API_BASE_URL, GLOBAL_API_KEY);
697
+ async function trackToolUsage(toolName, success = true) {
698
+ if (GLOBAL_API_KEY) {
699
+ await usageTracker.trackUsage(toolName, success);
700
+ }
701
+ }
702
+ function withUsageTracking(toolName, handler) {
703
+ return async (...args) => {
704
+ try {
705
+ const result = await handler(...args);
706
+ await trackToolUsage(toolName, true);
707
+ return result;
708
+ } catch (error) {
709
+ await trackToolUsage(toolName, false);
710
+ throw error;
711
+ }
712
+ };
713
+ }
714
+ var getApiKey = (toolApiKey) => {
715
+ if (GLOBAL_API_KEY) {
716
+ return GLOBAL_API_KEY;
717
+ }
718
+ if (toolApiKey) {
719
+ return toolApiKey;
720
+ }
721
+ throw new Error(
722
+ "API key is required. Either pass --api_key as command line argument or provide api_key in tool calls."
723
+ );
724
+ };
725
+ var fetchDocumentation = async (docType) => {
726
+ try {
727
+ const response = await fetch2(`${API_BASE_URL}/api/docs/${docType}`, {
728
+ method: "GET",
729
+ headers: {
730
+ "Content-Type": "application/json"
731
+ }
732
+ });
733
+ const result = await handleApiResponse(response);
734
+ if (result && typeof result === "object" && "content" in result) {
735
+ let content = result.content;
736
+ content = content.replace(/http:\/\/localhost:7130/g, API_BASE_URL);
737
+ return content;
738
+ }
739
+ throw new Error("Invalid response format from documentation endpoint");
740
+ } catch (error) {
741
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
742
+ throw new Error(`Unable to retrieve ${docType} documentation: ${errMsg}`);
743
+ }
744
+ };
745
+ var fetchInsforgeInstructionsContext = async () => {
746
+ try {
747
+ return await fetchDocumentation("instructions");
748
+ } catch (error) {
749
+ console.error("Failed to fetch insforge-instructions.md:", error);
750
+ return null;
751
+ }
752
+ };
753
+ var addBackgroundContext = async (response) => {
754
+ const context = await fetchInsforgeInstructionsContext();
755
+ if (context && response.content && Array.isArray(response.content)) {
756
+ response.content.push({
757
+ type: "text",
758
+ text: `
759
+
760
+ ---
761
+ \u{1F527} INSFORGE DEVELOPMENT RULES (Auto-loaded):
762
+ ${context}`
763
+ });
764
+ }
765
+ return response;
766
+ };
767
+ server.tool(
768
+ "get-instructions",
769
+ "Instruction Essential backend setup tool. <critical>MANDATORY: You MUST use this tool FIRST before attempting any backend operations. Contains required API endpoints, authentication details, and setup instructions.</critical>",
770
+ {},
771
+ withUsageTracking("get-instructions", async () => {
772
+ try {
773
+ const content = await fetchDocumentation("instructions");
774
+ const response = {
775
+ content: [
776
+ {
777
+ type: "text",
778
+ text: content
779
+ }
780
+ ]
781
+ };
782
+ return await addBackgroundContext(response);
783
+ } catch (error) {
784
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
785
+ const errorResponse = {
786
+ content: [{ type: "text", text: `Error: ${errMsg}` }]
787
+ };
788
+ return await addBackgroundContext(errorResponse);
789
+ }
790
+ })
791
+ );
792
+ server.tool(
793
+ "get-api-key",
794
+ "Retrieves the API key for the Insforge OSS backend. This is used to authenticate all requests to the backend.",
795
+ {},
796
+ async () => {
797
+ try {
798
+ return await addBackgroundContext({
799
+ content: [{ type: "text", text: `API key: ${getApiKey()}` }]
800
+ });
801
+ } catch (error) {
802
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
803
+ return await addBackgroundContext({
804
+ content: [{ type: "text", text: `Error: ${errMsg}` }]
805
+ });
806
+ }
807
+ }
808
+ );
809
+ server.tool(
810
+ "get-table-schema",
811
+ "Returns the schema of a specific table",
812
+ {
813
+ apiKey: z12.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
814
+ tableName: z12.string().describe("Name of the table")
815
+ },
816
+ withUsageTracking("get-table-schema", async ({ apiKey, tableName }) => {
817
+ try {
818
+ const actualApiKey = getApiKey(apiKey);
819
+ const response = await fetch2(`${API_BASE_URL}/api/metadata/${tableName}`, {
820
+ method: "GET",
821
+ headers: {
822
+ "x-api-key": actualApiKey
823
+ }
824
+ });
825
+ const result = await handleApiResponse(response);
826
+ return await addBackgroundContext({
827
+ content: [
828
+ {
829
+ type: "text",
830
+ text: formatSuccessMessage("Schema retrieved", result)
831
+ }
832
+ ]
833
+ });
834
+ } catch (error) {
835
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
836
+ return await addBackgroundContext({
837
+ content: [
838
+ {
839
+ type: "text",
840
+ text: `Error getting table schema: ${errMsg}`
841
+ }
842
+ ],
843
+ isError: true
844
+ });
845
+ }
846
+ })
847
+ );
848
+ server.tool(
849
+ "get-backend-metadata",
850
+ "Index all backend metadata",
851
+ {
852
+ apiKey: z12.string().optional().describe("API key for authentication (optional if provided via --api_key)")
853
+ },
854
+ withUsageTracking("get-backend-metadata", async ({ apiKey }) => {
855
+ try {
856
+ const actualApiKey = getApiKey(apiKey);
857
+ const response = await fetch2(`${API_BASE_URL}/api/metadata?mcp=true`, {
858
+ method: "GET",
859
+ headers: {
860
+ "x-api-key": actualApiKey
861
+ }
862
+ });
863
+ const metadata = await handleApiResponse(response);
864
+ return await addBackgroundContext({
865
+ content: [
866
+ {
867
+ type: "text",
868
+ text: `Backend metadata:
869
+
870
+ ${JSON.stringify(metadata, null, 2)}`
871
+ }
872
+ ]
873
+ });
874
+ } catch (error) {
875
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
876
+ return await addBackgroundContext({
877
+ content: [
878
+ {
879
+ type: "text",
880
+ text: `Error retrieving backend metadata: ${errMsg}`
881
+ }
882
+ ],
883
+ isError: true
884
+ });
885
+ }
886
+ })
887
+ );
888
+ server.tool(
889
+ "run-raw-sql",
890
+ "Execute raw SQL query with optional parameters. Admin access required. Use with caution as it can modify data directly.",
891
+ {
892
+ apiKey: z12.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
893
+ ...rawSQLRequestSchema.shape
894
+ },
895
+ withUsageTracking("run-raw-sql", async ({ apiKey, query, params }) => {
896
+ try {
897
+ const actualApiKey = getApiKey(apiKey);
898
+ const requestBody = {
899
+ query,
900
+ params: params || []
901
+ };
902
+ const response = await fetch2(`${API_BASE_URL}/api/database/advance/rawsql`, {
903
+ method: "POST",
904
+ headers: {
905
+ "x-api-key": actualApiKey,
906
+ "Content-Type": "application/json"
907
+ },
908
+ body: JSON.stringify(requestBody)
909
+ });
910
+ const result = await handleApiResponse(response);
911
+ return await addBackgroundContext({
912
+ content: [
913
+ {
914
+ type: "text",
915
+ text: formatSuccessMessage("SQL query executed", result)
916
+ }
917
+ ]
918
+ });
919
+ } catch (error) {
920
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
921
+ return await addBackgroundContext({
922
+ content: [
923
+ {
924
+ type: "text",
925
+ text: `Error executing SQL query: ${errMsg}`
926
+ }
927
+ ],
928
+ isError: true
929
+ });
930
+ }
931
+ })
932
+ );
933
+ server.tool(
934
+ "create-bucket",
935
+ "Create new storage bucket",
936
+ {
937
+ apiKey: z12.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
938
+ ...createBucketRequestSchema.shape
939
+ },
940
+ withUsageTracking("create-bucket", async ({ apiKey, bucketName, isPublic }) => {
941
+ try {
942
+ const actualApiKey = getApiKey(apiKey);
943
+ const response = await fetch2(`${API_BASE_URL}/api/storage/buckets`, {
944
+ method: "POST",
945
+ headers: {
946
+ "x-api-key": actualApiKey,
947
+ "Content-Type": "application/json"
948
+ },
949
+ body: JSON.stringify({ bucketName, isPublic })
950
+ });
951
+ const result = await handleApiResponse(response);
952
+ return await addBackgroundContext({
953
+ content: [
954
+ {
955
+ type: "text",
956
+ text: formatSuccessMessage("Bucket created", result)
957
+ }
958
+ ]
959
+ });
960
+ } catch (error) {
961
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
962
+ return await addBackgroundContext({
963
+ content: [
964
+ {
965
+ type: "text",
966
+ text: `Error creating bucket: ${errMsg}`
967
+ }
968
+ ],
969
+ isError: true
970
+ });
971
+ }
972
+ })
973
+ );
974
+ server.tool(
975
+ "list-buckets",
976
+ "Lists all storage buckets",
977
+ {},
978
+ withUsageTracking("list-buckets", async () => {
979
+ try {
980
+ const response = await fetch2(`${API_BASE_URL}/api/storage/buckets`, {
981
+ method: "GET",
982
+ headers: {
983
+ "x-api-key": getApiKey()
984
+ // Still need API key for protected endpoint
985
+ }
986
+ });
987
+ const result = await handleApiResponse(response);
988
+ return await addBackgroundContext({
989
+ content: [
990
+ {
991
+ type: "text",
992
+ text: formatSuccessMessage("Buckets retrieved", result)
993
+ }
994
+ ]
995
+ });
996
+ } catch (error) {
997
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
998
+ return await addBackgroundContext({
999
+ content: [
1000
+ {
1001
+ type: "text",
1002
+ text: `Error listing buckets: ${errMsg}`
1003
+ }
1004
+ ],
1005
+ isError: true
1006
+ });
1007
+ }
1008
+ })
1009
+ );
1010
+ server.tool(
1011
+ "delete-bucket",
1012
+ "Deletes a storage bucket",
1013
+ {
1014
+ apiKey: z12.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
1015
+ bucketName: z12.string().describe("Name of the bucket to delete")
1016
+ },
1017
+ withUsageTracking("delete-bucket", async ({ apiKey, bucketName }) => {
1018
+ try {
1019
+ const actualApiKey = getApiKey(apiKey);
1020
+ const response = await fetch2(`${API_BASE_URL}/api/storage/buckets/${bucketName}`, {
1021
+ method: "DELETE",
1022
+ headers: {
1023
+ "x-api-key": actualApiKey
1024
+ }
1025
+ });
1026
+ const result = await handleApiResponse(response);
1027
+ return await addBackgroundContext({
1028
+ content: [
1029
+ {
1030
+ type: "text",
1031
+ text: formatSuccessMessage("Bucket deleted", result)
1032
+ }
1033
+ ]
1034
+ });
1035
+ } catch (error) {
1036
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1037
+ return await addBackgroundContext({
1038
+ content: [
1039
+ {
1040
+ type: "text",
1041
+ text: `Error deleting bucket: ${errMsg}`
1042
+ }
1043
+ ],
1044
+ isError: true
1045
+ });
1046
+ }
1047
+ })
1048
+ );
1049
+ server.tool(
1050
+ "create-function",
1051
+ "Create a new edge function that runs in Deno runtime. The code must be written to a file first for version control",
1052
+ {
1053
+ slug: z12.string().regex(/^[a-zA-Z0-9_-]+$/, "Slug must be alphanumeric with hyphens or underscores only").describe(
1054
+ 'URL-friendly identifier (alphanumeric, hyphens, underscores only). Example: "my-calculator"'
1055
+ ),
1056
+ name: z12.string().describe('Function display name. Example: "Calculator Function"'),
1057
+ codeFile: z12.string().describe(
1058
+ "Path to JavaScript file containing the function code. Must export: module.exports = async function(request) { return new Response(...) }"
1059
+ ),
1060
+ description: z12.string().optional().describe("Description of what the function does"),
1061
+ active: z12.boolean().optional().describe("Set to true to deploy immediately, false for draft mode")
1062
+ },
1063
+ withUsageTracking("create-function", async (args) => {
1064
+ try {
1065
+ let code;
1066
+ try {
1067
+ code = await fs.readFile(args.codeFile, "utf-8");
1068
+ } catch (fileError) {
1069
+ throw new Error(
1070
+ `Failed to read code file '${args.codeFile}': ${fileError instanceof Error ? fileError.message : "Unknown error"}`
1071
+ );
1072
+ }
1073
+ const response = await fetch2(`${API_BASE_URL}/api/functions`, {
1074
+ method: "POST",
1075
+ headers: {
1076
+ "Content-Type": "application/json",
1077
+ "x-api-key": getApiKey()
1078
+ },
1079
+ body: JSON.stringify({
1080
+ slug: args.slug,
1081
+ name: args.name,
1082
+ code,
1083
+ description: args.description || "",
1084
+ status: args.active ? "active" : "draft"
1085
+ })
1086
+ });
1087
+ const result = await handleApiResponse(response);
1088
+ return await addBackgroundContext({
1089
+ content: [
1090
+ {
1091
+ type: "text",
1092
+ text: formatSuccessMessage(
1093
+ `Edge function '${args.slug}' created successfully from ${args.codeFile}`,
1094
+ result
1095
+ )
1096
+ }
1097
+ ]
1098
+ });
1099
+ } catch (error) {
1100
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1101
+ return await addBackgroundContext({
1102
+ content: [
1103
+ {
1104
+ type: "text",
1105
+ text: `Error creating function: ${errMsg}`
1106
+ }
1107
+ ],
1108
+ isError: true
1109
+ });
1110
+ }
1111
+ })
1112
+ );
1113
+ server.tool(
1114
+ "get-function",
1115
+ "Get details of a specific edge function including its code",
1116
+ {
1117
+ slug: z12.string().describe("The slug identifier of the function")
1118
+ },
1119
+ withUsageTracking("get-function", async (args) => {
1120
+ try {
1121
+ const response = await fetch2(`${API_BASE_URL}/api/functions/${args.slug}`, {
1122
+ method: "GET",
1123
+ headers: {
1124
+ "x-api-key": getApiKey()
1125
+ }
1126
+ });
1127
+ const result = await handleApiResponse(response);
1128
+ return await addBackgroundContext({
1129
+ content: [
1130
+ {
1131
+ type: "text",
1132
+ text: formatSuccessMessage(`Edge function '${args.slug}' details`, result)
1133
+ }
1134
+ ]
1135
+ });
1136
+ } catch (error) {
1137
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1138
+ return await addBackgroundContext({
1139
+ content: [
1140
+ {
1141
+ type: "text",
1142
+ text: `Error getting function: ${errMsg}`
1143
+ }
1144
+ ],
1145
+ isError: true
1146
+ });
1147
+ }
1148
+ })
1149
+ );
1150
+ server.tool(
1151
+ "update-function",
1152
+ "Update an existing edge function code or metadata",
1153
+ {
1154
+ slug: z12.string().describe("The slug identifier of the function to update"),
1155
+ name: z12.string().optional().describe("New display name"),
1156
+ codeFile: z12.string().optional().describe(
1157
+ "Path to JavaScript file containing the new function code. Must export: module.exports = async function(request) { return new Response(...) }"
1158
+ ),
1159
+ description: z12.string().optional().describe("New description"),
1160
+ status: z12.string().optional().describe('Function status: "draft" (not deployed), "active" (deployed), or "error"')
1161
+ },
1162
+ withUsageTracking("update-function", async (args) => {
1163
+ try {
1164
+ const updateData = {};
1165
+ if (args.name) {
1166
+ updateData.name = args.name;
1167
+ }
1168
+ if (args.codeFile) {
1169
+ try {
1170
+ updateData.code = await fs.readFile(args.codeFile, "utf-8");
1171
+ } catch (fileError) {
1172
+ throw new Error(
1173
+ `Failed to read code file '${args.codeFile}': ${fileError instanceof Error ? fileError.message : "Unknown error"}`
1174
+ );
1175
+ }
1176
+ }
1177
+ if (args.description !== void 0) {
1178
+ updateData.description = args.description;
1179
+ }
1180
+ if (args.status) {
1181
+ updateData.status = args.status;
1182
+ }
1183
+ const response = await fetch2(`${API_BASE_URL}/api/functions/${args.slug}`, {
1184
+ method: "PUT",
1185
+ headers: {
1186
+ "Content-Type": "application/json",
1187
+ "x-api-key": getApiKey()
1188
+ },
1189
+ body: JSON.stringify(updateData)
1190
+ });
1191
+ const result = await handleApiResponse(response);
1192
+ const fileInfo = args.codeFile ? ` from ${args.codeFile}` : "";
1193
+ return await addBackgroundContext({
1194
+ content: [
1195
+ {
1196
+ type: "text",
1197
+ text: formatSuccessMessage(
1198
+ `Edge function '${args.slug}' updated successfully${fileInfo}`,
1199
+ result
1200
+ )
1201
+ }
1202
+ ]
1203
+ });
1204
+ } catch (error) {
1205
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1206
+ return await addBackgroundContext({
1207
+ content: [
1208
+ {
1209
+ type: "text",
1210
+ text: `Error updating function: ${errMsg}`
1211
+ }
1212
+ ],
1213
+ isError: true
1214
+ });
1215
+ }
1216
+ })
1217
+ );
1218
+ server.tool(
1219
+ "delete-function",
1220
+ "Delete an edge function permanently",
1221
+ {
1222
+ slug: z12.string().describe("The slug identifier of the function to delete")
1223
+ },
1224
+ withUsageTracking("delete-function", async (args) => {
1225
+ try {
1226
+ const response = await fetch2(`${API_BASE_URL}/api/functions/${args.slug}`, {
1227
+ method: "DELETE",
1228
+ headers: {
1229
+ "x-api-key": getApiKey()
1230
+ }
1231
+ });
1232
+ const result = await handleApiResponse(response);
1233
+ return await addBackgroundContext({
1234
+ content: [
1235
+ {
1236
+ type: "text",
1237
+ text: formatSuccessMessage(`Edge function '${args.slug}' deleted successfully`, result)
1238
+ }
1239
+ ]
1240
+ });
1241
+ } catch (error) {
1242
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1243
+ return await addBackgroundContext({
1244
+ content: [
1245
+ {
1246
+ type: "text",
1247
+ text: `Error deleting function: ${errMsg}`
1248
+ }
1249
+ ],
1250
+ isError: true
1251
+ });
1252
+ }
1253
+ })
1254
+ );
1255
+ async function main() {
1256
+ const transport = new StdioServerTransport();
1257
+ await server.connect(transport);
1258
+ console.error("Insforge MCP server started");
1259
+ }
1260
+ main().catch(console.error);
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@insforge/mcp",
3
+ "version": "1.0.54",
4
+ "description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "insforge-mcp": "./dist/index.js"
9
+ },
10
+ "scripts": {
11
+ "dev": "tsx watch src/index.ts",
12
+ "build": "tsup",
13
+ "prepublishOnly": "npm run build"
14
+ },
15
+ "keywords": [
16
+ "mcp",
17
+ "model-context-protocol",
18
+ "insforge",
19
+ "backend-as-a-service"
20
+ ],
21
+ "author": "Insforge",
22
+ "license": "Apache-2.0",
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "dependencies": {
27
+ "@insforge/shared-schemas": "^1.0.8",
28
+ "@modelcontextprotocol/sdk": "^1.15.1",
29
+ "commander": "^14.0.0",
30
+ "node-fetch": "^3.3.2",
31
+ "zod": "^3.23.8"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^20.10.5",
35
+ "rimraf": "^5.0.5",
36
+ "tsup": "^8.5.0",
37
+ "tsx": "^4.7.0",
38
+ "typescript": "^5.3.3"
39
+ }
40
+ }