@insforge/mcp 1.1.7-dev.16 → 1.1.7-dev.17
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.
|
@@ -1053,9 +1053,71 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1053
1053
|
}
|
|
1054
1054
|
})
|
|
1055
1055
|
);
|
|
1056
|
+
server.tool(
|
|
1057
|
+
"download-template",
|
|
1058
|
+
'Download a React starter template with InsForge integration. Creates a new "insforge-react" directory with React + TypeScript setup and pre-configured with your backend URL and anon key.',
|
|
1059
|
+
{
|
|
1060
|
+
frame: z14.enum(["react"]).describe("Framework to use for the template (currently only React is supported)")
|
|
1061
|
+
},
|
|
1062
|
+
withUsageTracking("download-template", async ({ frame }) => {
|
|
1063
|
+
try {
|
|
1064
|
+
const response = await fetch2(`${API_BASE_URL}/api/auth/tokens/anon`, {
|
|
1065
|
+
method: "POST",
|
|
1066
|
+
headers: {
|
|
1067
|
+
"x-api-key": getApiKey(),
|
|
1068
|
+
"Content-Type": "application/json"
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
const result = await handleApiResponse(response);
|
|
1072
|
+
const anonKey = result.token;
|
|
1073
|
+
if (!anonKey) {
|
|
1074
|
+
throw new Error("Failed to retrieve anon key from backend");
|
|
1075
|
+
}
|
|
1076
|
+
const targetDir = `insforge-${frame}`;
|
|
1077
|
+
const command = `npx create-insforge-app insforge-${frame} --frame ${frame} --base-url ${API_BASE_URL} --anon-key ${anonKey}`;
|
|
1078
|
+
const { stdout, stderr } = await execAsync(command, {
|
|
1079
|
+
maxBuffer: 10 * 1024 * 1024
|
|
1080
|
+
// 10MB buffer
|
|
1081
|
+
});
|
|
1082
|
+
const output = stdout || stderr || "Template downloaded successfully";
|
|
1083
|
+
return {
|
|
1084
|
+
content: [
|
|
1085
|
+
{
|
|
1086
|
+
type: "text",
|
|
1087
|
+
text: formatSuccessMessage(
|
|
1088
|
+
`React template downloaded to ${targetDir}`,
|
|
1089
|
+
{
|
|
1090
|
+
targetDir,
|
|
1091
|
+
baseUrl: API_BASE_URL,
|
|
1092
|
+
command,
|
|
1093
|
+
output: output.trim(),
|
|
1094
|
+
nextSteps: [
|
|
1095
|
+
`cd ${targetDir}`,
|
|
1096
|
+
`npm install`,
|
|
1097
|
+
`npm run dev`
|
|
1098
|
+
]
|
|
1099
|
+
}
|
|
1100
|
+
)
|
|
1101
|
+
}
|
|
1102
|
+
]
|
|
1103
|
+
};
|
|
1104
|
+
} catch (error) {
|
|
1105
|
+
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1106
|
+
return {
|
|
1107
|
+
content: [
|
|
1108
|
+
{
|
|
1109
|
+
type: "text",
|
|
1110
|
+
text: `Error downloading template: ${errMsg}`
|
|
1111
|
+
}
|
|
1112
|
+
],
|
|
1113
|
+
isError: true
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
})
|
|
1117
|
+
);
|
|
1056
1118
|
server.tool(
|
|
1057
1119
|
"bulk-upsert",
|
|
1058
|
-
"Bulk insert or
|
|
1120
|
+
"Bulk insert or updallet data from CSV or JSON file. Supports upsert operations with a unique key.",
|
|
1059
1121
|
{
|
|
1060
1122
|
apiKey: z14.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
1061
1123
|
...bulkUpsertRequestSchema.shape,
|
package/dist/http-server.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED