@tupaas/mcp 1.1.1 → 1.2.1
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/index.js +22 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,9 +6,10 @@ 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.2.0";
|
|
9
10
|
const API_URL = process.env.TUPAAS_API_URL ?? "https://tupaas.dev/api";
|
|
10
11
|
const API_KEY = process.env.TUPAAS_API_KEY ?? "";
|
|
11
|
-
const server = new Server({ name: "tupaas-mcp", version:
|
|
12
|
+
const server = new Server({ name: "tupaas-mcp", version: VERSION }, { capabilities: { tools: {} } });
|
|
12
13
|
function authHeaders() {
|
|
13
14
|
return { "x-api-key": API_KEY };
|
|
14
15
|
}
|
|
@@ -87,6 +88,14 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
87
88
|
required: ["database_id"],
|
|
88
89
|
},
|
|
89
90
|
},
|
|
91
|
+
{
|
|
92
|
+
name: "version",
|
|
93
|
+
description: "Returns the current version of the TuPaaS MCP server and the API URL it is configured to use.",
|
|
94
|
+
inputSchema: {
|
|
95
|
+
type: "object",
|
|
96
|
+
properties: {},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
90
99
|
],
|
|
91
100
|
}));
|
|
92
101
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
@@ -295,7 +304,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
295
304
|
content: [
|
|
296
305
|
{
|
|
297
306
|
type: "text",
|
|
298
|
-
text: `Database created!\n\nName: ${database.name}\nID: ${database.id}\nConnection URL: ${database.internalDbUrl}\n\nUse this URL as DATABASE_URL when deploying:\n deploy(env_vars: {"DATABASE_URL": "${database.internalDbUrl}"})
|
|
307
|
+
text: `Database created!\n\nName: ${database.name}\nID: ${database.id}\nConnection URL: ${database.internalDbUrl}\n\nUse this URL as DATABASE_URL when deploying:\n deploy(env_vars: {"DATABASE_URL": "${database.internalDbUrl}"})\n\nIMPORTANT: If the project has a .env file with a DATABASE_URL, update it with this new URL before deploying, as dotenv may override the env_vars passed at deploy time.`,
|
|
299
308
|
},
|
|
300
309
|
],
|
|
301
310
|
};
|
|
@@ -320,7 +329,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
320
329
|
content: [
|
|
321
330
|
{
|
|
322
331
|
type: "text",
|
|
323
|
-
text: `Database: ${database.name}\nType: ${database.type}\nStatus: ${database.status}\nConnection URL: ${database.internalDbUrl}\n\nUse as DATABASE_URL in deploy env_vars.`,
|
|
332
|
+
text: `Database: ${database.name}\nType: ${database.type}\nStatus: ${database.status}\nConnection URL: ${database.internalDbUrl}\n\nUse as DATABASE_URL in deploy env_vars.\n\nIMPORTANT: If the project has a .env file with a DATABASE_URL, update it with this URL before deploying, as dotenv may override the env_vars passed at deploy time.`,
|
|
333
|
+
},
|
|
334
|
+
],
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
case "version": {
|
|
338
|
+
return {
|
|
339
|
+
content: [
|
|
340
|
+
{
|
|
341
|
+
type: "text",
|
|
342
|
+
text: `TuPaaS MCP v${VERSION}\nAPI URL: ${API_URL}\nAPI Key: ${API_KEY ? `${API_KEY.slice(0, 12)}...` : "NOT SET"}`,
|
|
324
343
|
},
|
|
325
344
|
],
|
|
326
345
|
};
|