@mgsoftwarebv/mg-dashboard-mcp 7.4.25 → 7.4.26

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 +94 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -724,10 +724,10 @@ var TRIGGER_TOOL_MODULE_MAP = {
724
724
  "trigger-env": "settings"
725
725
  };
726
726
  async function discoverInstance(projectSlug, conn, proxy, sshExec2) {
727
- const sql36 = `SELECT re.\\"apiKey\\" || '~~' || p.\\"externalRef\\" FROM \\"RuntimeEnvironment\\" re JOIN \\"Project\\" p ON re.\\"projectId\\" = p.id WHERE p.slug='${projectSlug}' AND re.slug='prod' LIMIT 1`;
727
+ const sql37 = `SELECT re.\\"apiKey\\" || '~~' || p.\\"externalRef\\" FROM \\"RuntimeEnvironment\\" re JOIN \\"Project\\" p ON re.\\"projectId\\" = p.id WHERE p.slug='${projectSlug}' AND re.slug='prod' LIMIT 1`;
728
728
  const cmd = [
729
729
  `PORT=$(docker port "${WA_CONTAINER}" 3000/tcp 2>/dev/null | head -1 | sed 's/.*://')`,
730
- `ROW=$(docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql36}" 2>/dev/null | tr -d '[:space:]')`,
730
+ `ROW=$(docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql37}" 2>/dev/null | tr -d '[:space:]')`,
731
731
  'echo "$PORT|$ROW"'
732
732
  ].join(" && ");
733
733
  const result = await sshExec2(conn, cmd, proxy);
@@ -749,8 +749,8 @@ async function discoverInstance(projectSlug, conn, proxy, sshExec2) {
749
749
  return { port, apiKey: apiKey2, projectRef: projectRef || "" };
750
750
  }
751
751
  async function fetchRunLogs(runId, conn, proxy, sshExec2) {
752
- const sql36 = `SELECT level, message, \\"isError\\", \\"createdAt\\" FROM \\"TaskEvent\\" WHERE \\"runId\\" = '${runId}' AND level IN ('INFO','WARN','ERROR','DEBUG','LOG','TRACE') ORDER BY \\"startTime\\" ASC LIMIT 200`;
753
- const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql36}" 2>/dev/null`;
752
+ const sql37 = `SELECT level, message, \\"isError\\", \\"createdAt\\" FROM \\"TaskEvent\\" WHERE \\"runId\\" = '${runId}' AND level IN ('INFO','WARN','ERROR','DEBUG','LOG','TRACE') ORDER BY \\"startTime\\" ASC LIMIT 200`;
753
+ const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql37}" 2>/dev/null`;
754
754
  const result = await sshExec2(conn, cmd, proxy);
755
755
  const output = result.stdout.trim();
756
756
  if (!output) return "";
@@ -832,8 +832,8 @@ async function handleTriggerTool(name, args2, deps) {
832
832
  switch (name) {
833
833
  // -----------------------------------------------------------------
834
834
  case "trigger-list": {
835
- const sql36 = 'SELECT slug, name FROM \\"Project\\" ORDER BY name';
836
- const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql36}" 2>/dev/null`;
835
+ const sql37 = 'SELECT slug, name FROM \\"Project\\" ORDER BY name';
836
+ const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql37}" 2>/dev/null`;
837
837
  const result = await sshExec2(conn, cmd, proxy);
838
838
  const output = result.stdout.trim();
839
839
  if (!output) {
@@ -6341,6 +6341,52 @@ pgTable("two_factor", {
6341
6341
  secret: text("secret").notNull(),
6342
6342
  backupCodes: text("backup_codes")
6343
6343
  });
6344
+ var oauthApplications = pgTable("oauth_application", {
6345
+ id: uuid("id").primaryKey().defaultRandom(),
6346
+ clientId: text("client_id").notNull().unique(),
6347
+ clientSecret: text("client_secret"),
6348
+ name: text("name").notNull(),
6349
+ icon: text("icon"),
6350
+ metadata: text("metadata"),
6351
+ redirectUrls: text("redirect_urls").notNull(),
6352
+ type: text("type").notNull(),
6353
+ disabled: boolean("disabled").notNull().default(false),
6354
+ userId: uuid("user_id").references(() => users.id, { onDelete: "cascade" }),
6355
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
6356
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
6357
+ });
6358
+ pgTable("oauth_access_token", {
6359
+ id: uuid("id").primaryKey().defaultRandom(),
6360
+ accessToken: text("access_token").notNull().unique(),
6361
+ refreshToken: text("refresh_token").unique(),
6362
+ accessTokenExpiresAt: timestamp("access_token_expires_at", {
6363
+ withTimezone: true
6364
+ }).notNull(),
6365
+ refreshTokenExpiresAt: timestamp("refresh_token_expires_at", {
6366
+ withTimezone: true
6367
+ }),
6368
+ clientId: text("client_id").notNull().references(() => oauthApplications.clientId, { onDelete: "cascade" }),
6369
+ userId: uuid("user_id").references(() => users.id, { onDelete: "cascade" }),
6370
+ scopes: text("scopes").notNull().default(""),
6371
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
6372
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
6373
+ });
6374
+ pgTable("oauth_consent", {
6375
+ id: uuid("id").primaryKey().defaultRandom(),
6376
+ clientId: text("client_id").notNull().references(() => oauthApplications.clientId, { onDelete: "cascade" }),
6377
+ userId: uuid("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
6378
+ scopes: text("scopes").notNull().default(""),
6379
+ consentGiven: boolean("consent_given").notNull().default(false),
6380
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
6381
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
6382
+ });
6383
+ pgTable("jwks", {
6384
+ id: uuid("id").primaryKey().defaultRandom(),
6385
+ publicKey: text("public_key").notNull(),
6386
+ privateKey: text("private_key").notNull(),
6387
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
6388
+ expiresAt: timestamp("expires_at", { withTimezone: true })
6389
+ });
6344
6390
  var WIKI_EMBEDDING_DIMENSIONS = 1536;
6345
6391
  var vector = customType({
6346
6392
  dataType(config) {
@@ -7387,7 +7433,8 @@ pgTable(
7387
7433
  id: uuid("id").primaryKey().defaultRandom(),
7388
7434
  tokenHash: text("token_hash").notNull(),
7389
7435
  userId: uuid("user_id").notNull(),
7390
- apiKeyId: uuid("api_key_id").notNull(),
7436
+ apiKeyId: uuid("api_key_id"),
7437
+ helperDeviceId: uuid("helper_device_id"),
7391
7438
  repo: text("repo").notNull(),
7392
7439
  write: boolean("write").notNull().default(true),
7393
7440
  principal: text("principal").notNull(),
@@ -7398,7 +7445,42 @@ pgTable(
7398
7445
  (table) => [
7399
7446
  uniqueIndex("git_credential_grant_token_hash_uidx").on(table.tokenHash),
7400
7447
  index("git_credential_grant_expires_idx").on(table.expiresAt),
7401
- index("git_credential_grant_user_idx").on(table.userId, table.expiresAt)
7448
+ index("git_credential_grant_user_idx").on(table.userId, table.expiresAt),
7449
+ index("git_credential_grant_helper_device_idx").on(table.helperDeviceId)
7450
+ ]
7451
+ );
7452
+ pgTable(
7453
+ "git_helper_enroll",
7454
+ {
7455
+ id: uuid("id").primaryKey().defaultRandom(),
7456
+ userId: uuid("user_id").notNull(),
7457
+ codeHash: text("code_hash").notNull(),
7458
+ expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
7459
+ usedAt: timestamp("used_at", { withTimezone: true }),
7460
+ issuedIp: text("issued_ip").notNull().default(""),
7461
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
7462
+ },
7463
+ (table) => [
7464
+ uniqueIndex("git_helper_enroll_code_hash_uidx").on(table.codeHash),
7465
+ index("git_helper_enroll_user_idx").on(table.userId, table.expiresAt)
7466
+ ]
7467
+ );
7468
+ pgTable(
7469
+ "git_helper_device",
7470
+ {
7471
+ id: uuid("id").primaryKey().defaultRandom(),
7472
+ userId: uuid("user_id").notNull(),
7473
+ tokenHash: text("token_hash").notNull(),
7474
+ expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
7475
+ revokedAt: timestamp("revoked_at", { withTimezone: true }),
7476
+ lastUsedAt: timestamp("last_used_at", { withTimezone: true }),
7477
+ issuedIp: text("issued_ip").notNull().default(""),
7478
+ userAgent: text("user_agent").notNull().default(""),
7479
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
7480
+ },
7481
+ (table) => [
7482
+ uniqueIndex("git_helper_device_token_hash_uidx").on(table.tokenHash),
7483
+ index("git_helper_device_user_idx").on(table.userId, table.expiresAt)
7402
7484
  ]
7403
7485
  );
7404
7486
  var directoryLinkType = pgEnum("directory_link_type", [
@@ -13540,11 +13622,11 @@ CREATE TABLE IF NOT EXISTS _mcp_migrations (
13540
13622
  applied_by TEXT
13541
13623
  );
13542
13624
  `.trim();
13543
- function normaliseMigrationSql(sql36) {
13544
- return sql36.replace(/\r\n/g, "\n").trim() + "\n";
13625
+ function normaliseMigrationSql(sql37) {
13626
+ return sql37.replace(/\r\n/g, "\n").trim() + "\n";
13545
13627
  }
13546
- function migrationSha256(sql36) {
13547
- return createHash("sha256").update(sql36.replace(/\r\n/g, "\n"), "utf8").digest("hex");
13628
+ function migrationSha256(sql37) {
13629
+ return createHash("sha256").update(sql37.replace(/\r\n/g, "\n"), "utf8").digest("hex");
13548
13630
  }
13549
13631
  function dollarQuoteTag(value) {
13550
13632
  let tag = "_mcp";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgsoftwarebv/mg-dashboard-mcp",
3
- "version": "7.4.25",
3
+ "version": "7.4.26",
4
4
  "description": "MCP Server for MG Dashboard - SSH, SFTP, Docker, domains, DNS, and environment config tools for Cursor",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",