@insforge/mcp 1.1.6 → 1.1.7-dev.2
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-7CREF7XU.js → chunk-74IVXADC.js} +107 -152
- package/dist/http-server.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -5
- package/server.json +0 -17
|
@@ -162,9 +162,10 @@ var deleteTableResponse = z2.object({
|
|
|
162
162
|
var rawSQLRequestSchema = z2.object({
|
|
163
163
|
query: z2.string().min(1, "Query is required"),
|
|
164
164
|
params: z2.array(z2.any()).optional()
|
|
165
|
+
// z.any() generates valid JSON Schema with items: {}
|
|
165
166
|
});
|
|
166
167
|
var rawSQLResponseSchema = z2.object({
|
|
167
|
-
rows: z2.array(z2.
|
|
168
|
+
rows: z2.array(z2.record(z2.string(), z2.unknown())),
|
|
168
169
|
rowCount: z2.number().nullable(),
|
|
169
170
|
fields: z2.array(z2.object({
|
|
170
171
|
name: z2.string(),
|
|
@@ -222,7 +223,8 @@ var exportJsonDataSchema = z2.object({
|
|
|
222
223
|
newTable: z2.string().nullable(),
|
|
223
224
|
oldTable: z2.string().nullable()
|
|
224
225
|
})),
|
|
225
|
-
rows: z2.array(z2.
|
|
226
|
+
rows: z2.array(z2.record(z2.string(), z2.unknown())).optional(),
|
|
227
|
+
recordCount: z2.number().optional()
|
|
226
228
|
})),
|
|
227
229
|
functions: z2.array(z2.object({
|
|
228
230
|
functionName: z2.string(),
|
|
@@ -364,7 +366,19 @@ var userSchema = z5.object({
|
|
|
364
366
|
updatedAt: z5.string()
|
|
365
367
|
// PostgreSQL timestamp
|
|
366
368
|
});
|
|
367
|
-
var oAuthProvidersSchema = z5.enum([
|
|
369
|
+
var oAuthProvidersSchema = z5.enum([
|
|
370
|
+
"google",
|
|
371
|
+
"github",
|
|
372
|
+
"discord",
|
|
373
|
+
"linkedin",
|
|
374
|
+
"facebook",
|
|
375
|
+
"instagram",
|
|
376
|
+
"tiktok",
|
|
377
|
+
"apple",
|
|
378
|
+
"x",
|
|
379
|
+
"spotify",
|
|
380
|
+
"microsoft"
|
|
381
|
+
]);
|
|
368
382
|
var oAuthStateSchema = z5.object({
|
|
369
383
|
provider: oAuthProvidersSchema,
|
|
370
384
|
redirectUri: z5.string().url().optional()
|
|
@@ -462,15 +476,20 @@ var authMetadataSchema = z7.object({
|
|
|
462
476
|
oauths: z7.array(oAuthConfigSchema)
|
|
463
477
|
});
|
|
464
478
|
var databaseMetadataSchema = z7.object({
|
|
465
|
-
tables: z7.array(
|
|
466
|
-
|
|
479
|
+
tables: z7.array(z7.object({
|
|
480
|
+
schema: z7.string(),
|
|
481
|
+
tableName: z7.string(),
|
|
482
|
+
recordCount: z7.number()
|
|
483
|
+
})),
|
|
484
|
+
totalSizeInGB: z7.number(),
|
|
485
|
+
hint: z7.string().optional()
|
|
467
486
|
});
|
|
468
487
|
var bucketMetadataSchema = storageBucketSchema.extend({
|
|
469
488
|
objectCount: z7.number().optional()
|
|
470
489
|
});
|
|
471
490
|
var storageMetadataSchema = z7.object({
|
|
472
491
|
buckets: z7.array(bucketMetadataSchema),
|
|
473
|
-
|
|
492
|
+
totalSizeInGB: z7.number()
|
|
474
493
|
});
|
|
475
494
|
var edgeFunctionMetadataSchema = z7.object({
|
|
476
495
|
slug: z7.string(),
|
|
@@ -583,44 +602,13 @@ var imageGenerationResponseSchema = z9.object({
|
|
|
583
602
|
}).optional()
|
|
584
603
|
}).optional()
|
|
585
604
|
});
|
|
586
|
-
var
|
|
605
|
+
var aiModelSchema = z9.object({
|
|
587
606
|
id: z9.string(),
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
outputModalities: z9.array(z9.string()),
|
|
594
|
-
tokenizer: z9.string(),
|
|
595
|
-
instructType: z9.string()
|
|
596
|
-
}).optional(),
|
|
597
|
-
topProvider: z9.object({
|
|
598
|
-
isModerated: z9.boolean(),
|
|
599
|
-
contextLength: z9.number(),
|
|
600
|
-
maxCompletionTokens: z9.number()
|
|
601
|
-
}).optional(),
|
|
602
|
-
pricing: z9.object({
|
|
603
|
-
prompt: z9.string(),
|
|
604
|
-
completion: z9.string(),
|
|
605
|
-
image: z9.string().optional(),
|
|
606
|
-
request: z9.string().optional(),
|
|
607
|
-
webSearch: z9.string().optional(),
|
|
608
|
-
internalReasoning: z9.string().optional(),
|
|
609
|
-
inputCacheRead: z9.string().optional(),
|
|
610
|
-
inputCacheWrite: z9.string().optional()
|
|
611
|
-
})
|
|
612
|
-
});
|
|
613
|
-
var listModelsResponseSchema = z9.object({
|
|
614
|
-
text: z9.array(z9.object({
|
|
615
|
-
provider: z9.string(),
|
|
616
|
-
configured: z9.boolean(),
|
|
617
|
-
models: z9.array(openRouterModelSchema)
|
|
618
|
-
})),
|
|
619
|
-
image: z9.array(z9.object({
|
|
620
|
-
provider: z9.string(),
|
|
621
|
-
configured: z9.boolean(),
|
|
622
|
-
models: z9.array(openRouterModelSchema)
|
|
623
|
-
}))
|
|
607
|
+
inputModality: z9.array(modalitySchema).min(1),
|
|
608
|
+
outputModality: z9.array(modalitySchema).min(1),
|
|
609
|
+
provider: z9.string(),
|
|
610
|
+
modelId: z9.string(),
|
|
611
|
+
priceLevel: z9.number().min(0).max(3).optional()
|
|
624
612
|
});
|
|
625
613
|
var createAIConfigurationRequestSchema = aiConfigurationSchema.omit({
|
|
626
614
|
id: true
|
|
@@ -656,6 +644,23 @@ var auditLogSchema = z10.object({
|
|
|
656
644
|
createdAt: z10.string(),
|
|
657
645
|
updatedAt: z10.string()
|
|
658
646
|
});
|
|
647
|
+
var logSourceSchema = z10.object({
|
|
648
|
+
id: z10.string(),
|
|
649
|
+
name: z10.string(),
|
|
650
|
+
token: z10.string()
|
|
651
|
+
});
|
|
652
|
+
var logSchema = z10.object({
|
|
653
|
+
id: z10.string(),
|
|
654
|
+
eventMessage: z10.string(),
|
|
655
|
+
timestamp: z10.string(),
|
|
656
|
+
body: z10.record(z10.string(), z10.unknown()),
|
|
657
|
+
source: z10.string().optional()
|
|
658
|
+
});
|
|
659
|
+
var logStatsSchema = z10.object({
|
|
660
|
+
source: z10.string(),
|
|
661
|
+
count: z10.number(),
|
|
662
|
+
lastActivity: z10.string()
|
|
663
|
+
});
|
|
659
664
|
|
|
660
665
|
// node_modules/@insforge/shared-schemas/dist/logs-api.schema.js
|
|
661
666
|
import { z as z11 } from "zod";
|
|
@@ -693,6 +698,10 @@ var clearAuditLogsResponseSchema = z11.object({
|
|
|
693
698
|
message: z11.string(),
|
|
694
699
|
deleted: z11.number()
|
|
695
700
|
});
|
|
701
|
+
var getLogsResponseSchema = z11.object({
|
|
702
|
+
logs: z11.array(logSchema),
|
|
703
|
+
total: z11.number()
|
|
704
|
+
});
|
|
696
705
|
|
|
697
706
|
// node_modules/@insforge/shared-schemas/dist/functions.schema.js
|
|
698
707
|
import { z as z12 } from "zod";
|
|
@@ -747,16 +756,11 @@ function registerInsforgeTools(server, config = {}) {
|
|
|
747
756
|
}
|
|
748
757
|
};
|
|
749
758
|
}
|
|
750
|
-
const getApiKey = (
|
|
751
|
-
if (GLOBAL_API_KEY) {
|
|
752
|
-
|
|
753
|
-
}
|
|
754
|
-
if (toolApiKey) {
|
|
755
|
-
return toolApiKey;
|
|
759
|
+
const getApiKey = (_toolApiKey) => {
|
|
760
|
+
if (!GLOBAL_API_KEY) {
|
|
761
|
+
throw new Error("API key is required. Pass --api_key when starting the MCP server.");
|
|
756
762
|
}
|
|
757
|
-
|
|
758
|
-
"API key is required. Either pass --api_key as command line argument or provide api_key in tool calls."
|
|
759
|
-
);
|
|
763
|
+
return GLOBAL_API_KEY;
|
|
760
764
|
};
|
|
761
765
|
const fetchDocumentation = async (docType) => {
|
|
762
766
|
try {
|
|
@@ -778,28 +782,6 @@ function registerInsforgeTools(server, config = {}) {
|
|
|
778
782
|
throw new Error(`Unable to retrieve ${docType} documentation: ${errMsg}`);
|
|
779
783
|
}
|
|
780
784
|
};
|
|
781
|
-
const fetchInsforgeInstructionsContext = async () => {
|
|
782
|
-
try {
|
|
783
|
-
return await fetchDocumentation("instructions");
|
|
784
|
-
} catch (error) {
|
|
785
|
-
console.error("Failed to fetch insforge-instructions.md:", error);
|
|
786
|
-
return null;
|
|
787
|
-
}
|
|
788
|
-
};
|
|
789
|
-
const addBackgroundContext = async (response) => {
|
|
790
|
-
const context = await fetchInsforgeInstructionsContext();
|
|
791
|
-
if (context && response.content && Array.isArray(response.content)) {
|
|
792
|
-
response.content.push({
|
|
793
|
-
type: "text",
|
|
794
|
-
text: `
|
|
795
|
-
|
|
796
|
-
---
|
|
797
|
-
\u{1F527} INSFORGE DEVELOPMENT RULES (Auto-loaded):
|
|
798
|
-
${context}`
|
|
799
|
-
});
|
|
800
|
-
}
|
|
801
|
-
return response;
|
|
802
|
-
};
|
|
803
785
|
server.tool(
|
|
804
786
|
"get-instructions",
|
|
805
787
|
"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>",
|
|
@@ -807,7 +789,7 @@ ${context}`
|
|
|
807
789
|
withUsageTracking("get-instructions", async () => {
|
|
808
790
|
try {
|
|
809
791
|
const content = await fetchDocumentation("instructions");
|
|
810
|
-
|
|
792
|
+
return {
|
|
811
793
|
content: [
|
|
812
794
|
{
|
|
813
795
|
type: "text",
|
|
@@ -815,33 +797,14 @@ ${context}`
|
|
|
815
797
|
}
|
|
816
798
|
]
|
|
817
799
|
};
|
|
818
|
-
return await addBackgroundContext(response);
|
|
819
800
|
} catch (error) {
|
|
820
801
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
821
|
-
|
|
802
|
+
return {
|
|
822
803
|
content: [{ type: "text", text: `Error: ${errMsg}` }]
|
|
823
804
|
};
|
|
824
|
-
return await addBackgroundContext(errorResponse);
|
|
825
805
|
}
|
|
826
806
|
})
|
|
827
807
|
);
|
|
828
|
-
server.tool(
|
|
829
|
-
"get-api-key",
|
|
830
|
-
"Retrieves the API key for the Insforge OSS backend. This is used to authenticate all requests to the backend.",
|
|
831
|
-
{},
|
|
832
|
-
async () => {
|
|
833
|
-
try {
|
|
834
|
-
return await addBackgroundContext({
|
|
835
|
-
content: [{ type: "text", text: `API key: ${getApiKey()}` }]
|
|
836
|
-
});
|
|
837
|
-
} catch (error) {
|
|
838
|
-
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
839
|
-
return await addBackgroundContext({
|
|
840
|
-
content: [{ type: "text", text: `Error: ${errMsg}` }]
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
);
|
|
845
808
|
server.tool(
|
|
846
809
|
"get-table-schema",
|
|
847
810
|
"Returns the detailed schema(including RLS, indexes, constraints, etc.) of a specific table",
|
|
@@ -859,17 +822,17 @@ ${context}`
|
|
|
859
822
|
}
|
|
860
823
|
});
|
|
861
824
|
const result = await handleApiResponse(response);
|
|
862
|
-
return
|
|
825
|
+
return {
|
|
863
826
|
content: [
|
|
864
827
|
{
|
|
865
828
|
type: "text",
|
|
866
829
|
text: formatSuccessMessage("Schema retrieved", result)
|
|
867
830
|
}
|
|
868
831
|
]
|
|
869
|
-
}
|
|
832
|
+
};
|
|
870
833
|
} catch (error) {
|
|
871
834
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
872
|
-
return
|
|
835
|
+
return {
|
|
873
836
|
content: [
|
|
874
837
|
{
|
|
875
838
|
type: "text",
|
|
@@ -877,7 +840,7 @@ ${context}`
|
|
|
877
840
|
}
|
|
878
841
|
],
|
|
879
842
|
isError: true
|
|
880
|
-
}
|
|
843
|
+
};
|
|
881
844
|
}
|
|
882
845
|
})
|
|
883
846
|
);
|
|
@@ -897,7 +860,7 @@ ${context}`
|
|
|
897
860
|
}
|
|
898
861
|
});
|
|
899
862
|
const metadata = await handleApiResponse(response);
|
|
900
|
-
return
|
|
863
|
+
return {
|
|
901
864
|
content: [
|
|
902
865
|
{
|
|
903
866
|
type: "text",
|
|
@@ -906,10 +869,10 @@ ${context}`
|
|
|
906
869
|
${JSON.stringify(metadata, null, 2)}`
|
|
907
870
|
}
|
|
908
871
|
]
|
|
909
|
-
}
|
|
872
|
+
};
|
|
910
873
|
} catch (error) {
|
|
911
874
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
912
|
-
return
|
|
875
|
+
return {
|
|
913
876
|
content: [
|
|
914
877
|
{
|
|
915
878
|
type: "text",
|
|
@@ -917,7 +880,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
917
880
|
}
|
|
918
881
|
],
|
|
919
882
|
isError: true
|
|
920
|
-
}
|
|
883
|
+
};
|
|
921
884
|
}
|
|
922
885
|
})
|
|
923
886
|
);
|
|
@@ -944,17 +907,17 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
944
907
|
body: JSON.stringify(requestBody)
|
|
945
908
|
});
|
|
946
909
|
const result = await handleApiResponse(response);
|
|
947
|
-
return
|
|
910
|
+
return {
|
|
948
911
|
content: [
|
|
949
912
|
{
|
|
950
913
|
type: "text",
|
|
951
914
|
text: formatSuccessMessage("SQL query executed", result)
|
|
952
915
|
}
|
|
953
916
|
]
|
|
954
|
-
}
|
|
917
|
+
};
|
|
955
918
|
} catch (error) {
|
|
956
919
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
957
|
-
return
|
|
920
|
+
return {
|
|
958
921
|
content: [
|
|
959
922
|
{
|
|
960
923
|
type: "text",
|
|
@@ -962,7 +925,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
962
925
|
}
|
|
963
926
|
],
|
|
964
927
|
isError: true
|
|
965
|
-
}
|
|
928
|
+
};
|
|
966
929
|
}
|
|
967
930
|
})
|
|
968
931
|
);
|
|
@@ -995,7 +958,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
995
958
|
});
|
|
996
959
|
const result = await handleApiResponse(response);
|
|
997
960
|
const message = result.success ? `Successfully processed ${result.rowsAffected} of ${result.totalRecords} records into table "${result.table}"` : result.message || "Bulk upsert operation completed";
|
|
998
|
-
return
|
|
961
|
+
return {
|
|
999
962
|
content: [
|
|
1000
963
|
{
|
|
1001
964
|
type: "text",
|
|
@@ -1008,10 +971,10 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1008
971
|
})
|
|
1009
972
|
}
|
|
1010
973
|
]
|
|
1011
|
-
}
|
|
974
|
+
};
|
|
1012
975
|
} catch (error) {
|
|
1013
976
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1014
|
-
return
|
|
977
|
+
return {
|
|
1015
978
|
content: [
|
|
1016
979
|
{
|
|
1017
980
|
type: "text",
|
|
@@ -1019,7 +982,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1019
982
|
}
|
|
1020
983
|
],
|
|
1021
984
|
isError: true
|
|
1022
|
-
}
|
|
985
|
+
};
|
|
1023
986
|
}
|
|
1024
987
|
})
|
|
1025
988
|
);
|
|
@@ -1042,17 +1005,17 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1042
1005
|
body: JSON.stringify({ bucketName, isPublic })
|
|
1043
1006
|
});
|
|
1044
1007
|
const result = await handleApiResponse(response);
|
|
1045
|
-
return
|
|
1008
|
+
return {
|
|
1046
1009
|
content: [
|
|
1047
1010
|
{
|
|
1048
1011
|
type: "text",
|
|
1049
1012
|
text: formatSuccessMessage("Bucket created", result)
|
|
1050
1013
|
}
|
|
1051
1014
|
]
|
|
1052
|
-
}
|
|
1015
|
+
};
|
|
1053
1016
|
} catch (error) {
|
|
1054
1017
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1055
|
-
return
|
|
1018
|
+
return {
|
|
1056
1019
|
content: [
|
|
1057
1020
|
{
|
|
1058
1021
|
type: "text",
|
|
@@ -1060,7 +1023,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1060
1023
|
}
|
|
1061
1024
|
],
|
|
1062
1025
|
isError: true
|
|
1063
|
-
}
|
|
1026
|
+
};
|
|
1064
1027
|
}
|
|
1065
1028
|
})
|
|
1066
1029
|
);
|
|
@@ -1077,17 +1040,17 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1077
1040
|
}
|
|
1078
1041
|
});
|
|
1079
1042
|
const result = await handleApiResponse(response);
|
|
1080
|
-
return
|
|
1043
|
+
return {
|
|
1081
1044
|
content: [
|
|
1082
1045
|
{
|
|
1083
1046
|
type: "text",
|
|
1084
1047
|
text: formatSuccessMessage("Buckets retrieved", result)
|
|
1085
1048
|
}
|
|
1086
1049
|
]
|
|
1087
|
-
}
|
|
1050
|
+
};
|
|
1088
1051
|
} catch (error) {
|
|
1089
1052
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1090
|
-
return
|
|
1053
|
+
return {
|
|
1091
1054
|
content: [
|
|
1092
1055
|
{
|
|
1093
1056
|
type: "text",
|
|
@@ -1095,7 +1058,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1095
1058
|
}
|
|
1096
1059
|
],
|
|
1097
1060
|
isError: true
|
|
1098
|
-
}
|
|
1061
|
+
};
|
|
1099
1062
|
}
|
|
1100
1063
|
})
|
|
1101
1064
|
);
|
|
@@ -1116,17 +1079,17 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1116
1079
|
}
|
|
1117
1080
|
});
|
|
1118
1081
|
const result = await handleApiResponse(response);
|
|
1119
|
-
return
|
|
1082
|
+
return {
|
|
1120
1083
|
content: [
|
|
1121
1084
|
{
|
|
1122
1085
|
type: "text",
|
|
1123
1086
|
text: formatSuccessMessage("Bucket deleted", result)
|
|
1124
1087
|
}
|
|
1125
1088
|
]
|
|
1126
|
-
}
|
|
1089
|
+
};
|
|
1127
1090
|
} catch (error) {
|
|
1128
1091
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1129
|
-
return
|
|
1092
|
+
return {
|
|
1130
1093
|
content: [
|
|
1131
1094
|
{
|
|
1132
1095
|
type: "text",
|
|
@@ -1134,7 +1097,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1134
1097
|
}
|
|
1135
1098
|
],
|
|
1136
1099
|
isError: true
|
|
1137
|
-
}
|
|
1100
|
+
};
|
|
1138
1101
|
}
|
|
1139
1102
|
})
|
|
1140
1103
|
);
|
|
@@ -1172,7 +1135,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1172
1135
|
})
|
|
1173
1136
|
});
|
|
1174
1137
|
const result = await handleApiResponse(response);
|
|
1175
|
-
return
|
|
1138
|
+
return {
|
|
1176
1139
|
content: [
|
|
1177
1140
|
{
|
|
1178
1141
|
type: "text",
|
|
@@ -1182,10 +1145,10 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1182
1145
|
)
|
|
1183
1146
|
}
|
|
1184
1147
|
]
|
|
1185
|
-
}
|
|
1148
|
+
};
|
|
1186
1149
|
} catch (error) {
|
|
1187
1150
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1188
|
-
return
|
|
1151
|
+
return {
|
|
1189
1152
|
content: [
|
|
1190
1153
|
{
|
|
1191
1154
|
type: "text",
|
|
@@ -1193,7 +1156,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1193
1156
|
}
|
|
1194
1157
|
],
|
|
1195
1158
|
isError: true
|
|
1196
|
-
}
|
|
1159
|
+
};
|
|
1197
1160
|
}
|
|
1198
1161
|
})
|
|
1199
1162
|
);
|
|
@@ -1212,17 +1175,17 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1212
1175
|
}
|
|
1213
1176
|
});
|
|
1214
1177
|
const result = await handleApiResponse(response);
|
|
1215
|
-
return
|
|
1178
|
+
return {
|
|
1216
1179
|
content: [
|
|
1217
1180
|
{
|
|
1218
1181
|
type: "text",
|
|
1219
1182
|
text: formatSuccessMessage(`Edge function '${args.slug}' details`, result)
|
|
1220
1183
|
}
|
|
1221
1184
|
]
|
|
1222
|
-
}
|
|
1185
|
+
};
|
|
1223
1186
|
} catch (error) {
|
|
1224
1187
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1225
|
-
return
|
|
1188
|
+
return {
|
|
1226
1189
|
content: [
|
|
1227
1190
|
{
|
|
1228
1191
|
type: "text",
|
|
@@ -1230,7 +1193,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1230
1193
|
}
|
|
1231
1194
|
],
|
|
1232
1195
|
isError: true
|
|
1233
|
-
}
|
|
1196
|
+
};
|
|
1234
1197
|
}
|
|
1235
1198
|
})
|
|
1236
1199
|
);
|
|
@@ -1275,7 +1238,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1275
1238
|
});
|
|
1276
1239
|
const result = await handleApiResponse(response);
|
|
1277
1240
|
const fileInfo = args.codeFile ? ` from ${args.codeFile}` : "";
|
|
1278
|
-
return
|
|
1241
|
+
return {
|
|
1279
1242
|
content: [
|
|
1280
1243
|
{
|
|
1281
1244
|
type: "text",
|
|
@@ -1285,10 +1248,10 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1285
1248
|
)
|
|
1286
1249
|
}
|
|
1287
1250
|
]
|
|
1288
|
-
}
|
|
1251
|
+
};
|
|
1289
1252
|
} catch (error) {
|
|
1290
1253
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1291
|
-
return
|
|
1254
|
+
return {
|
|
1292
1255
|
content: [
|
|
1293
1256
|
{
|
|
1294
1257
|
type: "text",
|
|
@@ -1296,7 +1259,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1296
1259
|
}
|
|
1297
1260
|
],
|
|
1298
1261
|
isError: true
|
|
1299
|
-
}
|
|
1262
|
+
};
|
|
1300
1263
|
}
|
|
1301
1264
|
})
|
|
1302
1265
|
);
|
|
@@ -1315,17 +1278,17 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1315
1278
|
}
|
|
1316
1279
|
});
|
|
1317
1280
|
const result = await handleApiResponse(response);
|
|
1318
|
-
return
|
|
1281
|
+
return {
|
|
1319
1282
|
content: [
|
|
1320
1283
|
{
|
|
1321
1284
|
type: "text",
|
|
1322
1285
|
text: formatSuccessMessage(`Edge function '${args.slug}' deleted successfully`, result)
|
|
1323
1286
|
}
|
|
1324
1287
|
]
|
|
1325
|
-
}
|
|
1288
|
+
};
|
|
1326
1289
|
} catch (error) {
|
|
1327
1290
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1328
|
-
return
|
|
1291
|
+
return {
|
|
1329
1292
|
content: [
|
|
1330
1293
|
{
|
|
1331
1294
|
type: "text",
|
|
@@ -1333,7 +1296,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1333
1296
|
}
|
|
1334
1297
|
],
|
|
1335
1298
|
isError: true
|
|
1336
|
-
}
|
|
1299
|
+
};
|
|
1337
1300
|
}
|
|
1338
1301
|
})
|
|
1339
1302
|
);
|
|
@@ -1350,32 +1313,24 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1350
1313
|
const actualApiKey = getApiKey(apiKey);
|
|
1351
1314
|
const queryParams = new URLSearchParams();
|
|
1352
1315
|
if (limit) queryParams.append("limit", limit.toString());
|
|
1353
|
-
|
|
1316
|
+
const response = await fetch2(`${API_BASE_URL}/api/logs/analytics/${source}?${queryParams}`, {
|
|
1354
1317
|
method: "GET",
|
|
1355
1318
|
headers: {
|
|
1356
1319
|
"x-api-key": actualApiKey
|
|
1357
1320
|
}
|
|
1358
1321
|
});
|
|
1359
|
-
if (response.status === 404) {
|
|
1360
|
-
response = await fetch2(`${API_BASE_URL}/api/logs/analytics/${source}?${queryParams}`, {
|
|
1361
|
-
method: "GET",
|
|
1362
|
-
headers: {
|
|
1363
|
-
"x-api-key": actualApiKey
|
|
1364
|
-
}
|
|
1365
|
-
});
|
|
1366
|
-
}
|
|
1367
1322
|
const result = await handleApiResponse(response);
|
|
1368
|
-
return
|
|
1323
|
+
return {
|
|
1369
1324
|
content: [
|
|
1370
1325
|
{
|
|
1371
1326
|
type: "text",
|
|
1372
1327
|
text: formatSuccessMessage(`Latest logs from ${source}`, result)
|
|
1373
1328
|
}
|
|
1374
1329
|
]
|
|
1375
|
-
}
|
|
1330
|
+
};
|
|
1376
1331
|
} catch (error) {
|
|
1377
1332
|
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1378
|
-
return
|
|
1333
|
+
return {
|
|
1379
1334
|
content: [
|
|
1380
1335
|
{
|
|
1381
1336
|
type: "text",
|
|
@@ -1383,7 +1338,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1383
1338
|
}
|
|
1384
1339
|
],
|
|
1385
1340
|
isError: true
|
|
1386
|
-
}
|
|
1341
|
+
};
|
|
1387
1342
|
}
|
|
1388
1343
|
})
|
|
1389
1344
|
);
|
package/dist/http-server.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insforge/mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7-dev.2",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
|
|
5
|
-
"mcpName": "io.github.insforge/insforge-mcp",
|
|
6
5
|
"type": "module",
|
|
7
6
|
"main": "dist/index.js",
|
|
8
7
|
"bin": {
|
|
@@ -32,11 +31,10 @@
|
|
|
32
31
|
},
|
|
33
32
|
"files": [
|
|
34
33
|
"dist",
|
|
35
|
-
"mcp.json"
|
|
36
|
-
"server.json"
|
|
34
|
+
"mcp.json"
|
|
37
35
|
],
|
|
38
36
|
"dependencies": {
|
|
39
|
-
"@insforge/shared-schemas": "^1.1.
|
|
37
|
+
"@insforge/shared-schemas": "^1.1.6",
|
|
40
38
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
|
41
39
|
"@types/express": "^5.0.3",
|
|
42
40
|
"commander": "^14.0.0",
|
package/server.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
|
|
3
|
-
"name": "io.github.InsForge/insforge-mcp",
|
|
4
|
-
"title": "Insforge",
|
|
5
|
-
"description": "MCP server for Insforge BaaS - database, auth, storage, edge functions, and container logs",
|
|
6
|
-
"version": "1.1.5",
|
|
7
|
-
"packages": [
|
|
8
|
-
{
|
|
9
|
-
"registryType": "npm",
|
|
10
|
-
"identifier": "@insforge/mcp",
|
|
11
|
-
"version": "1.1.5",
|
|
12
|
-
"transport": {
|
|
13
|
-
"type": "stdio"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|