@mgsoftwarebv/mg-dashboard-mcp 3.13.1 → 3.14.0
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 +87 -77
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1230,7 +1230,7 @@ var VERCEL_TOOLS = [
|
|
|
1230
1230
|
},
|
|
1231
1231
|
{
|
|
1232
1232
|
name: "vercel-deployments",
|
|
1233
|
-
description: "List recent deployments for a Vercel project. Returns deployment ID, state, target, branch, commit and timestamps. Use the deployment ID with vercel-
|
|
1233
|
+
description: "List recent deployments for a Vercel project. Returns deployment ID, state, target, branch, commit and timestamps. Use the deployment ID with vercel-logs.",
|
|
1234
1234
|
inputSchema: {
|
|
1235
1235
|
type: "object",
|
|
1236
1236
|
properties: {
|
|
@@ -1246,46 +1246,40 @@ var VERCEL_TOOLS = [
|
|
|
1246
1246
|
}
|
|
1247
1247
|
},
|
|
1248
1248
|
{
|
|
1249
|
-
name: "vercel-
|
|
1250
|
-
description: "
|
|
1249
|
+
name: "vercel-logs",
|
|
1250
|
+
description: 'Unified log inspector for Vercel. Use `kind` to pick the source:\n- "build" (default): build / deployment console events (stdout, stderr, command, exit). Requires deploymentId.\n- "runtime": runtime / function logs after a successful build. Requires project + deploymentId.\n- "webhooks": our own vercel_webhook_logs table (Telegram / push delivery history). No deployment needed.\nPick deployments via vercel-deployments first.',
|
|
1251
1251
|
inputSchema: {
|
|
1252
1252
|
type: "object",
|
|
1253
1253
|
properties: {
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
description: "Only return logs from the last N minutes (default 60)"
|
|
1272
|
-
}
|
|
1273
|
-
},
|
|
1274
|
-
required: ["project", "deploymentId"]
|
|
1275
|
-
}
|
|
1276
|
-
},
|
|
1277
|
-
{
|
|
1278
|
-
name: "vercel-webhook-history",
|
|
1279
|
-
description: "List recent Vercel deployment webhook deliveries (from the vercel_webhook_logs table). Useful to confirm Telegram / push notifications were sent and to see the original payload metadata.",
|
|
1280
|
-
inputSchema: {
|
|
1281
|
-
type: "object",
|
|
1282
|
-
properties: {
|
|
1283
|
-
projectName: { type: "string", description: "Optional filter on project name" },
|
|
1254
|
+
kind: {
|
|
1255
|
+
type: "string",
|
|
1256
|
+
enum: ["build", "runtime", "webhooks"],
|
|
1257
|
+
description: "Which log stream to fetch (default: build)."
|
|
1258
|
+
},
|
|
1259
|
+
project: {
|
|
1260
|
+
type: "string",
|
|
1261
|
+
description: 'Vercel project ID or name (required for kind="runtime").'
|
|
1262
|
+
},
|
|
1263
|
+
deploymentId: {
|
|
1264
|
+
type: "string",
|
|
1265
|
+
description: 'Vercel deployment ID (required for kind="build" or "runtime").'
|
|
1266
|
+
},
|
|
1267
|
+
projectName: {
|
|
1268
|
+
type: "string",
|
|
1269
|
+
description: 'Optional project_name filter (kind="webhooks" only).'
|
|
1270
|
+
},
|
|
1284
1271
|
status: {
|
|
1285
1272
|
type: "string",
|
|
1286
|
-
description:
|
|
1273
|
+
description: 'Optional status filter (kind="webhooks" only): sent, skipped, error.'
|
|
1287
1274
|
},
|
|
1288
|
-
|
|
1275
|
+
sinceMinutes: {
|
|
1276
|
+
type: "number",
|
|
1277
|
+
description: 'Time window in minutes (kind="runtime" only, default 60, max 7 days).'
|
|
1278
|
+
},
|
|
1279
|
+
limit: {
|
|
1280
|
+
type: "number",
|
|
1281
|
+
description: "Max entries to return. Defaults per kind: build=500 (max 5000), runtime=200 (max 1000), webhooks=25 (max 200)."
|
|
1282
|
+
}
|
|
1289
1283
|
}
|
|
1290
1284
|
}
|
|
1291
1285
|
}
|
|
@@ -1294,9 +1288,7 @@ var VERCEL_TOOL_NAMES = new Set(VERCEL_TOOLS.map((t) => t.name));
|
|
|
1294
1288
|
var VERCEL_TOOL_MODULE_MAP = {
|
|
1295
1289
|
"vercel-projects": "ci_cd",
|
|
1296
1290
|
"vercel-deployments": "ci_cd",
|
|
1297
|
-
"vercel-
|
|
1298
|
-
"vercel-runtime-log": "ci_cd",
|
|
1299
|
-
"vercel-webhook-history": "ci_cd"
|
|
1291
|
+
"vercel-logs": "ci_cd"
|
|
1300
1292
|
};
|
|
1301
1293
|
async function vercelFetch(token, path) {
|
|
1302
1294
|
const res = await fetch(`${VERCEL_API}${path}`, {
|
|
@@ -1544,46 +1536,64 @@ async function handleVercelTool(name, args2, deps) {
|
|
|
1544
1536
|
if (error) return { content: [{ type: "text", text: `Error: ${error}` }] };
|
|
1545
1537
|
return { content: [{ type: "text", text: formatDeploymentsTable(deployments) }] };
|
|
1546
1538
|
}
|
|
1547
|
-
case "vercel-
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1539
|
+
case "vercel-logs": {
|
|
1540
|
+
const kind = (args2.kind ? String(args2.kind) : "build").toLowerCase();
|
|
1541
|
+
if (kind === "build") {
|
|
1542
|
+
if (!args2.deploymentId) {
|
|
1543
|
+
return { content: [{ type: "text", text: 'Error: kind="build" requires deploymentId.' }] };
|
|
1544
|
+
}
|
|
1545
|
+
const token = await getVercelToken(deps);
|
|
1546
|
+
const deploymentId = String(args2.deploymentId);
|
|
1547
|
+
const limit = Math.min(Math.max(Number(args2.limit) || 500, 1), 5e3);
|
|
1548
|
+
const { events, error } = await getDeploymentBuildEvents(token, deploymentId, limit);
|
|
1549
|
+
if (error) return { content: [{ type: "text", text: `Error: ${error}` }] };
|
|
1550
|
+
return { content: [{ type: "text", text: formatBuildEvents(events) }] };
|
|
1551
|
+
}
|
|
1552
|
+
if (kind === "runtime") {
|
|
1553
|
+
if (!args2.project || !args2.deploymentId) {
|
|
1554
|
+
return {
|
|
1555
|
+
content: [
|
|
1556
|
+
{ type: "text", text: 'Error: kind="runtime" requires both project and deploymentId.' }
|
|
1557
|
+
]
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
const token = await getVercelToken(deps);
|
|
1561
|
+
const projectInput = String(args2.project);
|
|
1562
|
+
const deploymentId = String(args2.deploymentId);
|
|
1563
|
+
const limit = Math.min(Math.max(Number(args2.limit) || 200, 1), 1e3);
|
|
1564
|
+
const sinceMinutes = Math.min(Math.max(Number(args2.sinceMinutes) || 60, 1), 7 * 24 * 60);
|
|
1565
|
+
const sinceMs = Date.now() - sinceMinutes * 6e4;
|
|
1566
|
+
const projectId = await resolveProjectId(token, projectInput);
|
|
1567
|
+
const { logs, error } = await getRuntimeLogs(
|
|
1568
|
+
token,
|
|
1569
|
+
projectId,
|
|
1570
|
+
deploymentId,
|
|
1571
|
+
limit,
|
|
1572
|
+
sinceMs
|
|
1573
|
+
);
|
|
1574
|
+
if (error) {
|
|
1575
|
+
const hint = error.includes("404") || error.includes("400") ? '\n\nThis endpoint requires both project ID and deployment ID and may not be available on every Vercel plan. Use kind="webhooks" or the supabase MCP (vercel_deployment_log table) for archived runtime logs.' : "";
|
|
1576
|
+
return { content: [{ type: "text", text: `Error: ${error}${hint}` }] };
|
|
1577
|
+
}
|
|
1578
|
+
return { content: [{ type: "text", text: formatRuntimeLogs(logs) }] };
|
|
1579
|
+
}
|
|
1580
|
+
if (kind === "webhooks") {
|
|
1581
|
+
const limit = Math.min(Math.max(Number(args2.limit) || 25, 1), 200);
|
|
1582
|
+
let query = deps.supabase.from("vercel_webhook_logs").select(
|
|
1583
|
+
"id, event_type, status, project_name, deployment_id, target, message, error_message, created_at"
|
|
1584
|
+
).order("created_at", { ascending: false }).limit(limit);
|
|
1585
|
+
if (args2.projectName) query = query.eq("project_name", String(args2.projectName));
|
|
1586
|
+
if (args2.status) query = query.eq("status", String(args2.status));
|
|
1587
|
+
const { data, error } = await query;
|
|
1588
|
+
if (error) return { content: [{ type: "text", text: `Error: ${error.message}` }] };
|
|
1589
|
+
return {
|
|
1590
|
+
content: [{ type: "text", text: formatWebhookHistory(data ?? []) }]
|
|
1591
|
+
};
|
|
1573
1592
|
}
|
|
1574
|
-
return { content: [{ type: "text", text: formatRuntimeLogs(logs) }] };
|
|
1575
|
-
}
|
|
1576
|
-
case "vercel-webhook-history": {
|
|
1577
|
-
const limit = Math.min(Math.max(Number(args2.limit) || 25, 1), 200);
|
|
1578
|
-
let query = deps.supabase.from("vercel_webhook_logs").select(
|
|
1579
|
-
"id, event_type, status, project_name, deployment_id, target, message, error_message, created_at"
|
|
1580
|
-
).order("created_at", { ascending: false }).limit(limit);
|
|
1581
|
-
if (args2.projectName) query = query.eq("project_name", String(args2.projectName));
|
|
1582
|
-
if (args2.status) query = query.eq("status", String(args2.status));
|
|
1583
|
-
const { data, error } = await query;
|
|
1584
|
-
if (error) return { content: [{ type: "text", text: `Error: ${error.message}` }] };
|
|
1585
1593
|
return {
|
|
1586
|
-
content: [
|
|
1594
|
+
content: [
|
|
1595
|
+
{ type: "text", text: `Error: unknown kind "${kind}". Use build, runtime, or webhooks.` }
|
|
1596
|
+
]
|
|
1587
1597
|
};
|
|
1588
1598
|
}
|
|
1589
1599
|
default:
|
|
@@ -4174,7 +4184,7 @@ var TOOLS = [
|
|
|
4174
4184
|
// ----- Vercel -----
|
|
4175
4185
|
...VERCEL_TOOLS
|
|
4176
4186
|
];
|
|
4177
|
-
var MCP_VERSION = "3.
|
|
4187
|
+
var MCP_VERSION = "3.14.0";
|
|
4178
4188
|
async function handleListTools() {
|
|
4179
4189
|
if (!authContext) return { tools: TOOLS };
|
|
4180
4190
|
const accessible = TOOLS.filter((tool) => {
|