@tupaas/mcp 1.3.0 → 1.3.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.
Files changed (2) hide show
  1. package/dist/index.js +7 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import fs from "fs";
6
6
  import path from "path";
7
7
  import os from "os";
8
8
  import { execSync } from "child_process";
9
- const VERSION = "1.3.0";
9
+ const VERSION = "1.3.2";
10
10
  const API_URL = process.env.TUPAAS_API_URL ?? "https://tupaas.dev/api";
11
11
  const API_KEY = process.env.TUPAAS_API_KEY ?? "";
12
12
  const CONFIG_FILE = ".tupaas.json";
@@ -31,7 +31,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
31
31
  tools: [
32
32
  {
33
33
  name: "deploy",
34
- description: "Deploy a project folder to TuPaaS. Reads .tupaas.json from the project root to determine if this is a redeploy. After a successful deploy, writes/updates .tupaas.json with project info. IMPORTANT: If the project requires a database (e.g. has prisma, pg, DATABASE_URL in .env), call list_databases first and ask the user which database to use or whether to create a new one. Do not decide on your own. Before deploying, if no .tupaas.json exists, call list_projects to check if the project already exists to avoid creating duplicates.",
34
+ description: "Deploy a project folder to TuPaaS. Reads .tupaas.json from the project root to determine if this is a redeploy. After a successful deploy, writes/updates .tupaas.json with project info.\n\nBEFORE calling this tool, you MUST:\n1. Read the project's package.json, .env, .env.example, and check for prisma/ directory\n2. If the project uses a database (prisma, pg, postgres, mysql2, knex, drizzle, typeorm, sequelize, DATABASE_URL in .env): call list_databases and ASK the user which database to use or whether to create a new one. NEVER skip this step, even if .tupaas.json exists check if .tupaas.json has a databaseId field. If it does NOT have databaseId, the database has not been configured yet.\n3. If no .tupaas.json exists, call list_projects to check if the project already exists.",
35
35
  inputSchema: {
36
36
  type: "object",
37
37
  properties: {
@@ -245,12 +245,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
245
245
  };
246
246
  }
247
247
  const result = (await res.json());
248
- // Write .tupaas.json
248
+ // Write .tupaas.json — preserve databaseId if env_vars has DATABASE_URL
249
249
  const newConfig = {
250
250
  ...config,
251
251
  projectSlug: result.projectSlug,
252
252
  appName,
253
253
  lastDeployId: result.deployId,
254
+ ...(args.env_vars?.DATABASE_URL && !config?.databaseId
255
+ ? { databaseId: "configured-via-env" }
256
+ : {}),
254
257
  };
255
258
  writeConfig(projectPath, newConfig);
256
259
  // Poll until done
@@ -302,7 +305,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
302
305
  content: [
303
306
  {
304
307
  type: "text",
305
- text: `Deploy ended with status: ${finalStatus}\n\nDeploy ID: ${result.deployId}\nProject: ${result.projectSlug}\n\n--- Build Logs ---\n${lastLogs || "No logs available"}\n\n--- End Logs ---`,
308
+ text: `Deploy FAILED\n\nDeploy ID: ${result.deployId}\nProject: ${result.projectSlug}\nStatus: ${finalStatus}\n\n--- Logs ---\n${lastLogs || "No logs available"}\n--- End Logs ---\n\nAnalyze the logs above to identify the error. Common causes: missing environment variables, wrong start command, port mismatch, or missing dependencies. Fix the issue in the source code and redeploy.`,
306
309
  },
307
310
  ],
308
311
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tupaas/mcp",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "MCP server for deploying to TuPaaS from Claude Code",
5
5
  "type": "module",
6
6
  "bin": {