@mgsoftwarebv/mg-dashboard-mcp 7.4.17 → 7.4.19
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 +21 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawn } from 'child_process';
|
|
3
|
-
import { existsSync, statSync, createReadStream
|
|
4
|
-
import {
|
|
3
|
+
import { readFileSync, existsSync, statSync, createReadStream } from 'fs';
|
|
4
|
+
import { dirname, sep, join, isAbsolute } from 'path';
|
|
5
5
|
import { Client as Client$1 } from '@modelcontextprotocol/sdk/client/index.js';
|
|
6
6
|
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
7
7
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
@@ -13,6 +13,7 @@ import crypto, { randomUUID, createHash, randomBytes, createCipheriv, createDeci
|
|
|
13
13
|
import { readFile, mkdtemp, writeFile, rm } from 'fs/promises';
|
|
14
14
|
import { createServer } from 'http';
|
|
15
15
|
import { tmpdir } from 'os';
|
|
16
|
+
import { fileURLToPath } from 'url';
|
|
16
17
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
17
18
|
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
18
19
|
import postgres from 'postgres';
|
|
@@ -839,13 +840,13 @@ async function handleTriggerTool(name, args2, deps) {
|
|
|
839
840
|
return { content: [{ type: "text", text: "No Trigger.dev projects found." }] };
|
|
840
841
|
}
|
|
841
842
|
const header = `${"SLUG".padEnd(25)} NAME`;
|
|
842
|
-
const
|
|
843
|
+
const sep2 = "-".repeat(55);
|
|
843
844
|
const lines = output.split("\n").map((line) => {
|
|
844
845
|
const [slug, name2] = line.split("|");
|
|
845
846
|
return `${(slug || "").padEnd(25)} ${name2 || ""}`;
|
|
846
847
|
});
|
|
847
848
|
return { content: [{ type: "text", text: `${header}
|
|
848
|
-
${
|
|
849
|
+
${sep2}
|
|
849
850
|
${lines.join("\n")}` }] };
|
|
850
851
|
}
|
|
851
852
|
// -----------------------------------------------------------------
|
|
@@ -13630,7 +13631,20 @@ var TOOLS = [
|
|
|
13630
13631
|
// ----- Trigger.dev -----
|
|
13631
13632
|
...TRIGGER_TOOLS
|
|
13632
13633
|
];
|
|
13633
|
-
|
|
13634
|
+
function readInstalledMcpVersion() {
|
|
13635
|
+
try {
|
|
13636
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
13637
|
+
const base = here.split(sep).pop();
|
|
13638
|
+
const packageRoot = base === "dist" || base === "src" ? join(here, "..") : here;
|
|
13639
|
+
const parsed = JSON.parse(
|
|
13640
|
+
readFileSync(join(packageRoot, "package.json"), "utf8")
|
|
13641
|
+
);
|
|
13642
|
+
return typeof parsed.version === "string" ? parsed.version : null;
|
|
13643
|
+
} catch {
|
|
13644
|
+
return null;
|
|
13645
|
+
}
|
|
13646
|
+
}
|
|
13647
|
+
var MCP_VERSION = readInstalledMcpVersion() ?? "0.0.0";
|
|
13634
13648
|
async function handleListTools() {
|
|
13635
13649
|
if (!authContext) return { tools: TOOLS };
|
|
13636
13650
|
const allowedTools = authContext.allowedTools;
|
|
@@ -17042,7 +17056,7 @@ ${lines.join("\n")}`
|
|
|
17042
17056
|
};
|
|
17043
17057
|
}
|
|
17044
17058
|
const header = "TYPE NAME VALUE TTL";
|
|
17045
|
-
const
|
|
17059
|
+
const sep2 = "-".repeat(90);
|
|
17046
17060
|
const lines = records.map(
|
|
17047
17061
|
(r) => `${r.type.padEnd(10)}${r.name.padEnd(31)}${r.value.substring(0, 40).padEnd(41)}${r.ttl}`
|
|
17048
17062
|
);
|
|
@@ -17053,7 +17067,7 @@ ${lines.join("\n")}`
|
|
|
17053
17067
|
text: `DNS records for ${domain} (${records.length}):
|
|
17054
17068
|
|
|
17055
17069
|
${header}
|
|
17056
|
-
${
|
|
17070
|
+
${sep2}
|
|
17057
17071
|
${lines.join("\n")}`
|
|
17058
17072
|
}
|
|
17059
17073
|
]
|
package/package.json
CHANGED