@tupaas/mcp 1.3.1 → 1.3.3

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 +6 -3
  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.1";
9
+ const VERSION = "1.3.3";
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 .tupaas.json if it exists. If it has a projectSlug, call list_projects to VERIFY the project still exists on the server. If it was deleted, treat as a new deploy. If it has a databaseId, call get_database to VERIFY the database still exists. If it was deleted, remove it from .tupaas.json and re-ask the user about database setup.\n2. Read the project's package.json, .env, .env.example, and check for prisma/ directory.\n3. If the project uses a database (prisma, pg, postgres, mysql2, knex, drizzle, typeorm, sequelize, DATABASE_URL in .env) AND .tupaas.json does NOT have a databaseId: call list_databases and ASK the user which database to use or whether to create a new one. NEVER skip this step. NEVER choose automatically.\n4. If no .tupaas.json exists, call list_projects to check if the project already exists to avoid duplicates.",
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tupaas/mcp",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "MCP server for deploying to TuPaaS from Claude Code",
5
5
  "type": "module",
6
6
  "bin": {