@aicommander/mcp 1.0.30 → 1.0.33

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/bin/mcp.js +29 -3
  2. package/package.json +1 -1
package/dist/bin/mcp.js CHANGED
@@ -2,6 +2,28 @@
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
+ import { readFileSync } from "node:fs";
6
+ import { fileURLToPath } from "node:url";
7
+ import path from "node:path";
8
+ // serverInfo.version must track package.json instead of a hardcoded literal
9
+ // (1.0.17 shipped as far as 1.0.30 because nothing bumped or verified it).
10
+ // The published bin runs from dist/bin/mcp.js (manifest two levels up); from
11
+ // source (bin/mcp.ts) it is one level up — name-check so no stray package.json
12
+ // can ever win.
13
+ function ownVersion() {
14
+ const here = path.dirname(fileURLToPath(import.meta.url));
15
+ for (const rel of ["../../package.json", "../package.json"]) {
16
+ try {
17
+ const pkg = JSON.parse(readFileSync(path.resolve(here, rel), "utf8"));
18
+ if (pkg.name === "@aicommander/mcp" && pkg.version)
19
+ return pkg.version;
20
+ }
21
+ catch {
22
+ // candidate missing/unreadable — try the next layout
23
+ }
24
+ }
25
+ return "0.0.0";
26
+ }
5
27
  const SERVER_URL = process.env["AICOMMANDER_SERVER"] ?? "https://aicommander.dev";
6
28
  // Optional ACCOUNT token (an account API key or OAuth access token). If set, it
7
29
  // signs you into your AI Commander account — saved machines, aliases, account
@@ -15,7 +37,7 @@ const ACCOUNT_TOKEN = process.env["AICOMMANDER_TOKEN"];
15
37
  const MCP_URL = ACCOUNT_TOKEN ? `${SERVER_URL}/mcp` : `${SERVER_URL}/mcp?anonymous=1`;
16
38
  const server = new McpServer({
17
39
  name: "aicommander",
18
- version: "1.0.17",
40
+ version: ownVersion(),
19
41
  }, {
20
42
  instructions: "AI Commander — remote command execution / remote shell over an outbound-only agent. " +
21
43
  "Use these tools for any SSH-style remote access: connect to a computer/machine/server, " +
@@ -69,8 +91,12 @@ server.registerTool("remote_exec", {
69
91
  .number()
70
92
  .optional()
71
93
  .describe("Timeout in milliseconds. Default 300000 (5 min), max 3600000 (1 hr)"),
94
+ elevated: z
95
+ .boolean()
96
+ .optional()
97
+ .describe("Run as root (macOS) / LocalSystem (Windows) via the privileged helper. Account-only; only works on mac/Windows machines with the helper installed. Most commands do NOT need this."),
72
98
  },
73
- }, async ({ code, command, cwd, timeout_ms }) => {
99
+ }, async ({ code, command, cwd, timeout_ms, elevated }) => {
74
100
  const res = await fetch(MCP_URL, {
75
101
  method: "POST",
76
102
  headers: {
@@ -84,7 +110,7 @@ server.registerTool("remote_exec", {
84
110
  method: "tools/call",
85
111
  params: {
86
112
  name: "remote_exec",
87
- arguments: { code, command, cwd, timeout_ms },
113
+ arguments: { code, command, cwd, timeout_ms, elevated },
88
114
  },
89
115
  }),
90
116
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicommander/mcp",
3
- "version": "1.0.30",
3
+ "version": "1.0.33",
4
4
  "mcpName": "dev.aicommander/mcp",
5
5
  "description": "MCP server for remote command execution — run shell/bash commands on remote machines, servers and laptops from your AI agent (Claude, Codex, any stdio MCP client). An SSH / Ansible alternative with no exposed SSH, open ports or VPN; drive machines by AIC-… session code or saved alias/hostname.",
6
6
  "keywords": [