@mgsoftwarebv/mg-dashboard-mcp 3.0.4 → 3.0.5

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 CHANGED
@@ -2197,6 +2197,11 @@ async function mijnhostFetch(path, options = {}) {
2197
2197
  return body;
2198
2198
  }
2199
2199
  var TOOLS = [
2200
+ {
2201
+ name: "mcp-debug",
2202
+ description: "Returns MCP server version, security state, and diagnostics. Use to verify which version is running.",
2203
+ inputSchema: { type: "object", properties: {}, required: [] }
2204
+ },
2200
2205
  {
2201
2206
  name: "list-servers",
2202
2207
  description: "List all SSH servers you have access to. Returns id, name, hostname, and tags for each server.",
@@ -2476,7 +2481,7 @@ var TOOLS = [
2476
2481
  // ----- Agent Reporting -----
2477
2482
  ...AGENT_TOOLS
2478
2483
  ];
2479
- var MCP_VERSION = "3.0.4";
2484
+ var MCP_VERSION = "3.0.5";
2480
2485
  async function handleListTools() {
2481
2486
  if (!authContext) return { tools: TOOLS };
2482
2487
  const accessible = TOOLS.filter((tool) => {
@@ -2537,6 +2542,37 @@ async function executeToolCall(name, a, _serverId) {
2537
2542
  const ctx = authContext;
2538
2543
  try {
2539
2544
  switch (name) {
2545
+ // ----- Debug -----
2546
+ case "mcp-debug": {
2547
+ const { count: auditCount } = await supabase.from("mcp_audit_log").select("*", { count: "exact", head: true });
2548
+ const { count: sessionCount } = await supabase.from("mcp_session").select("*", { count: "exact", head: true });
2549
+ const { count: allowlistCount } = await supabase.from("mcp_ip_allowlist").select("*", { count: "exact", head: true });
2550
+ const { count: approvalCount } = await supabase.from("mcp_ip_approval_request").select("*", { count: "exact", head: true });
2551
+ let publicIp = "not resolved";
2552
+ try {
2553
+ publicIp = await resolvePublicIp();
2554
+ } catch {
2555
+ }
2556
+ const debug = {
2557
+ version: MCP_VERSION,
2558
+ nodeVersion: process.version,
2559
+ httpMode,
2560
+ apiKey: {
2561
+ id: ctx.apiKeyId,
2562
+ name: ctx.apiKeyName,
2563
+ requireIpApproval: ctx.requireIpApproval
2564
+ },
2565
+ publicIp,
2566
+ tables: {
2567
+ mcp_audit_log: auditCount ?? 0,
2568
+ mcp_session: sessionCount ?? 0,
2569
+ mcp_ip_allowlist: allowlistCount ?? 0,
2570
+ mcp_ip_approval_request: approvalCount ?? 0
2571
+ },
2572
+ uptime: `${Math.round(process.uptime())}s`
2573
+ };
2574
+ return { content: [{ type: "text", text: JSON.stringify(debug, null, 2) }] };
2575
+ }
2540
2576
  // ----- Servers -----
2541
2577
  case "list-servers": {
2542
2578
  let query = supabase.from("ssh_server").select("id, name, hostname, port, username, tags, hosted_by, os_type, created_at").order("name");