@insforge/mcp 1.2.4-deployment.0 → 1.2.4-deployment.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.
@@ -744,9 +744,7 @@ var realtimePermissionsResponseSchema = z8.object({
744
744
  });
745
745
 
746
746
  // node_modules/@insforge/shared-schemas/dist/metadata.schema.js
747
- var authMetadataSchema = z9.object({
748
- oauths: z9.array(oAuthConfigSchema)
749
- });
747
+ var authMetadataSchema = getPublicAuthConfigResponseSchema;
750
748
  var databaseMetadataSchema = z9.object({
751
749
  tables: z9.array(z9.object({
752
750
  tableName: z9.string(),
@@ -1079,23 +1077,27 @@ var cloudEventSchema = z16.discriminatedUnion("type", [
1079
1077
  import { z as z17 } from "zod";
1080
1078
  var docTypeSchema = z17.enum([
1081
1079
  "instructions",
1080
+ "auth-sdk",
1082
1081
  "db-sdk",
1083
1082
  "storage-sdk",
1084
1083
  "functions-sdk",
1085
1084
  "ai-integration-sdk",
1086
1085
  "auth-components-react",
1087
1086
  "auth-components-nextjs",
1088
- "real-time"
1087
+ "real-time",
1088
+ "deployment"
1089
1089
  ]).describe(`
1090
- Documentation type:
1090
+ Documentation type:
1091
1091
  "instructions" (essential backend setup - use FIRST),
1092
1092
  "db-sdk" (database operations),
1093
1093
  "storage-sdk" (file storage),
1094
1094
  "functions-sdk" (edge functions),
1095
+ "auth-sdk" (direct SDK methods for custom auth flows),
1095
1096
  "auth-components-react" (authentication components for React+Vite applications),
1096
1097
  "auth-components-nextjs" (authentication components for Next.js applications),
1097
1098
  "ai-integration-sdk" (AI features),
1098
- "real-time" (real-time pub/sub through WebSockets)
1099
+ "real-time" (real-time pub/sub through WebSockets),
1100
+ "deployment" (deploy frontend applications via MCP tool)
1099
1101
  `);
1100
1102
 
1101
1103
  // node_modules/@insforge/shared-schemas/dist/email-api.schema.js
@@ -1117,11 +1119,28 @@ var sendEmailResponseSchema = z18.object({});
1117
1119
 
1118
1120
  // node_modules/@insforge/shared-schemas/dist/deployments.schema.js
1119
1121
  import { z as z19 } from "zod";
1122
+ var deploymentStatusSchema = z19.enum([
1123
+ "WAITING",
1124
+ // Record created, waiting for client to upload zip to S3
1125
+ "UPLOADING",
1126
+ // Server is downloading from S3 and uploading to Vercel
1127
+ "QUEUED",
1128
+ // Vercel: deployment queued
1129
+ "BUILDING",
1130
+ // Vercel: deployment building
1131
+ "READY",
1132
+ // Vercel: deployment ready
1133
+ "ERROR",
1134
+ // Vercel: deployment failed
1135
+ "CANCELED"
1136
+ // Vercel: deployment canceled
1137
+ ]);
1120
1138
  var deploymentSchema = z19.object({
1121
1139
  id: z19.string().uuid(),
1122
- deploymentId: z19.string(),
1140
+ providerDeploymentId: z19.string().nullable(),
1141
+ // Provider's deployment ID, null until deployment starts
1123
1142
  provider: z19.string(),
1124
- status: z19.string(),
1143
+ status: deploymentStatusSchema,
1125
1144
  url: z19.string().nullable(),
1126
1145
  metadata: z19.record(z19.unknown()).nullable(),
1127
1146
  createdAt: z19.string(),
@@ -1137,20 +1156,20 @@ var projectSettingsSchema = z20.object({
1137
1156
  devCommand: z20.string().nullable().optional(),
1138
1157
  rootDirectory: z20.string().nullable().optional()
1139
1158
  });
1140
- var deploymentFileSchema = z20.object({
1141
- file: z20.string(),
1142
- data: z20.string()
1143
- });
1144
1159
  var envVarSchema = z20.object({
1145
1160
  key: z20.string(),
1146
1161
  value: z20.string()
1147
1162
  });
1148
- var createDeploymentRequestSchema = z20.object({
1149
- name: z20.string().optional(),
1150
- files: z20.array(deploymentFileSchema).optional(),
1163
+ var createDeploymentResponseSchema = z20.object({
1164
+ id: z20.string().uuid(),
1165
+ uploadUrl: z20.string().url(),
1166
+ uploadFields: z20.record(z20.string())
1167
+ // Required for S3 presigned POST (policy, signature, key, etc.)
1168
+ });
1169
+ var startDeploymentRequestSchema = z20.object({
1151
1170
  projectSettings: projectSettingsSchema.optional(),
1152
- meta: z20.record(z20.string()).optional(),
1153
- envVars: z20.array(envVarSchema).optional()
1171
+ envVars: z20.array(envVarSchema).optional(),
1172
+ meta: z20.record(z20.string()).optional()
1154
1173
  });
1155
1174
  var listDeploymentsResponseSchema = z20.object({
1156
1175
  deployments: z20.array(deploymentSchema)
@@ -2001,32 +2020,71 @@ To: Your current project directory
2001
2020
  );
2002
2021
  server.tool(
2003
2022
  "create-deployment",
2004
- "Create a new deployment with files, project settings, and environment variables",
2023
+ "Deploy source code from a directory. This tool zips files, uploads to cloud storage, and triggers deployment with optional environment variables and project settings.",
2005
2024
  {
2006
- ...createDeploymentRequestSchema.shape
2025
+ sourceDirectory: z21.string().describe("Path to the source directory containing files to deploy"),
2026
+ ...startDeploymentRequestSchema.shape
2007
2027
  },
2008
- withUsageTracking("create-deployment", async ({ name, files, projectSettings, meta, envVars }) => {
2028
+ withUsageTracking("create-deployment", async ({ sourceDirectory, projectSettings, envVars, meta }) => {
2009
2029
  try {
2010
- const requestBody = {};
2011
- if (name) requestBody.name = name;
2012
- if (files) requestBody.files = files;
2013
- if (projectSettings) requestBody.projectSettings = projectSettings;
2014
- if (meta) requestBody.meta = meta;
2015
- if (envVars) requestBody.envVars = envVars;
2016
- const response = await fetch2(`${API_BASE_URL}/api/deployments`, {
2030
+ const createResponse = await fetch2(`${API_BASE_URL}/api/deployments`, {
2031
+ method: "POST",
2032
+ headers: {
2033
+ "x-api-key": getApiKey(),
2034
+ "Content-Type": "application/json"
2035
+ }
2036
+ });
2037
+ const createResult = await handleApiResponse(createResponse);
2038
+ const { id: deploymentId, uploadUrl, uploadFields } = createResult;
2039
+ const zipPath = `${tmpdir()}/deployment-${deploymentId}.zip`;
2040
+ const excludePatterns = [
2041
+ "node_modules/*",
2042
+ ".git/*",
2043
+ ".next/*",
2044
+ "dist/*",
2045
+ ".env.local",
2046
+ ".DS_Store"
2047
+ ];
2048
+ const excludeArgs = excludePatterns.map((p) => `-x "${p}"`).join(" ");
2049
+ await execAsync(`cd "${sourceDirectory}" && zip -r "${zipPath}" . ${excludeArgs}`);
2050
+ const zipBuffer = await fs.readFile(zipPath);
2051
+ const uploadFormData = new FormData();
2052
+ for (const [key, value] of Object.entries(uploadFields)) {
2053
+ uploadFormData.append(key, value);
2054
+ }
2055
+ uploadFormData.append("file", zipBuffer, {
2056
+ filename: "deployment.zip",
2057
+ contentType: "application/zip"
2058
+ });
2059
+ const uploadResponse = await fetch2(uploadUrl, {
2060
+ method: "POST",
2061
+ body: uploadFormData,
2062
+ headers: uploadFormData.getHeaders()
2063
+ });
2064
+ if (!uploadResponse.ok) {
2065
+ const uploadError = await uploadResponse.text();
2066
+ throw new Error(`Failed to upload zip file: ${uploadError}`);
2067
+ }
2068
+ await fs.unlink(zipPath).catch(() => {
2069
+ });
2070
+ const startBody = {};
2071
+ if (projectSettings) startBody.projectSettings = projectSettings;
2072
+ if (envVars) startBody.envVars = envVars;
2073
+ if (meta) startBody.meta = meta;
2074
+ const startResponse = await fetch2(`${API_BASE_URL}/api/deployments/${deploymentId}/start`, {
2017
2075
  method: "POST",
2018
2076
  headers: {
2019
2077
  "x-api-key": getApiKey(),
2020
2078
  "Content-Type": "application/json"
2021
2079
  },
2022
- body: JSON.stringify(requestBody)
2080
+ body: JSON.stringify(startBody)
2023
2081
  });
2024
- const result = await handleApiResponse(response);
2082
+ const startResult = await handleApiResponse(startResponse);
2025
2083
  return await addBackgroundContext({
2026
2084
  content: [
2027
2085
  {
2028
2086
  type: "text",
2029
- text: formatSuccessMessage("Deployment created", result) + "\n\nNote: You can check deployment status by querying the system.deployments table."
2087
+ text: formatSuccessMessage("Deployment started", startResult) + "\n\nNote: You can check deployment status by querying the system.deployments table."
2030
2088
  }
2031
2089
  ]
2032
2090
  });
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-ELPXCUYK.js";
4
+ } from "./chunk-CMGN6RVN.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-ELPXCUYK.js";
4
+ } from "./chunk-CMGN6RVN.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.4-deployment.0",
3
+ "version": "1.2.4-deployment.2",
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.36-deployment.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
42
  "commander": "^14.0.0",