@aicommander/mcp 1.0.14 → 1.0.16

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @aicommander/mcp
1
+ # @aicommander/mcp — MCP server for remote command execution (SSH / Ansible alternative)
2
2
 
3
- Universal **stdio MCP server** for [AI Commander](https://aicommander.dev) — run shell commands on remote machines by talking to your AI client.
3
+ Universal **stdio MCP server** for [AI Commander](https://aicommander.dev) — **remote command execution / remote shell** that lets your AI client run shell/bash commands on remote machines, servers and laptops. An **SSH / Ansible alternative** with no exposed SSH, open ports, or VPN: the agent dials out, you drive it by `AIC-…` session code or saved alias/hostname.
4
4
 
5
5
  Use this package to connect any MCP client that speaks **stdio** (Codex CLI, Claude Desktop's config file, Cursor, Windsurp, …) to your AI Commander relay. It wraps the remote HTTPS/SSE MCP endpoint so clients that can only launch a local process get the same `remote_exec` and `session_status` tools.
6
6
 
@@ -15,6 +15,7 @@ Use this package to connect any MCP client that speaks **stdio** (Codex CLI, Cla
15
15
  |---|---|
16
16
  | `remote_exec` | Run a shell command on one of your machines — the tool for any "connect to / remote shell / run X on" request. Name the machine by its `AIC-…` session code or (with an API key) a saved alias/hostname like `wearfits-m3`; streams stdout/stderr back. |
17
17
  | `session_status` | Check whether a machine is online/active/reachable (e.g. "is wearfits-m3 up?"). Same machine naming as above. |
18
+ | `list_machines` | List all of your machines with their live online status (e.g. "what machines do I have?", "which of my computers are online?"). Requires an API key (`AICOMMANDER_TOKEN`); takes no arguments. |
18
19
 
19
20
  These are the canonical way to reach your machines — your AI client should use them rather than probing the local network, DNS/`.local`, or SSH. A string containing `aic-`/`AIC-` is almost certainly one of your machines.
20
21
 
@@ -78,6 +79,29 @@ Then just name a machine in chat — by session code or saved alias:
78
79
 
79
80
  The client routes it to `session_status` / `remote_exec` for you.
80
81
 
82
+ ## Publishing
83
+
84
+ **Re-publish this package whenever you change code that ships in it** — e.g. a new
85
+ tool, an edited tool description, or anything under `bin/`. The version in
86
+ `package.json` / `server.json` is NOT auto-bumped, so a code change without a
87
+ publish silently leaves npm + the registry stale (clients keep getting the old
88
+ tools). Easy to forget — don't.
89
+
90
+ Steps:
91
+
92
+ 1. Bump `version` in **both** `package.json` and `server.json` (keep them in sync).
93
+ 2. `npm publish` — needs npm 2FA OTP; `prepublishOnly: tsc` builds automatically.
94
+ 3. Publish to the official MCP Registry (domain ownership proven over HTTP via
95
+ `https://aicommander.dev/.well-known/mcp-registry-auth`, served by the Worker):
96
+
97
+ ```sh
98
+ mcp-publisher login http --domain=aicommander.dev \
99
+ --private-key=$(cat ~/.config/aicommander-mcp-publish/privkey.hex)
100
+ mcp-publisher publish
101
+ ```
102
+
103
+ The Worker must be deployed first so the well-known endpoint is live.
104
+
81
105
  ## License
82
106
 
83
107
  MIT
package/dist/bin/mcp.js CHANGED
@@ -10,7 +10,15 @@ const SERVER_URL = process.env["AICOMMANDER_SERVER"] ?? "https://aicommander.dev
10
10
  const ACCOUNT_TOKEN = process.env["AICOMMANDER_TOKEN"];
11
11
  const server = new McpServer({
12
12
  name: "aicommander",
13
- version: "1.0.12",
13
+ version: "1.0.15",
14
+ }, {
15
+ instructions: "AI Commander — remote command execution / remote shell over an outbound-only agent. " +
16
+ "Use these tools for any SSH-style remote access: connect to a computer/machine/server, " +
17
+ "open a remote shell, remote bash, remote terminal, or run/check/install/fix something ON " +
18
+ "another machine. An SSH / Ansible alternative that needs no exposed SSH, open ports, or VPN. " +
19
+ "Name the machine by its AIC-… session code or (with an API key) a saved alias/hostname; a " +
20
+ "string containing 'aic-' is almost certainly one of the user's machines. Do NOT probe the " +
21
+ "local network, DNS, mDNS/.local, ping, or a raw ssh client — these tools ARE the remote connection.",
14
22
  });
15
23
  // Tool: remote_exec
16
24
  server.registerTool("remote_exec", {
@@ -160,5 +168,38 @@ server.registerTool("session_status", {
160
168
  content: content,
161
169
  };
162
170
  });
171
+ // Tool: list_machines
172
+ server.registerTool("list_machines", {
173
+ description: "List ALL of the user's machines (the computers/servers linked to their AI Commander account) with each one's live status. USE THIS for fleet-wide questions rather than one named machine — e.g. \"what machines do I have?\", \"which of my computers are online?\", \"list my servers/hosts\" — or when the user wants to act on a machine but hasn't said which yet (call this first to discover the options). Requires an API key (set AICOMMANDER_TOKEN); without it there is no account to list and it returns an error — fall back to session_status with a specific AIC- code. Each entry gives the machine's alias (pass it as `code` to the other tools), whether its agent is online right now, when it was last seen, and whether the link is still awaiting the machine operator's approval. Takes no arguments.",
174
+ inputSchema: {},
175
+ }, async () => {
176
+ const res = await fetch(`${SERVER_URL}/mcp`, {
177
+ method: "POST",
178
+ headers: {
179
+ "Content-Type": "application/json",
180
+ ...(ACCOUNT_TOKEN ? { Authorization: `Bearer ${ACCOUNT_TOKEN}` } : {}),
181
+ },
182
+ body: JSON.stringify({
183
+ jsonrpc: "2.0",
184
+ id: 1,
185
+ method: "tools/call",
186
+ params: { name: "list_machines", arguments: {} },
187
+ }),
188
+ });
189
+ if (!res.ok) {
190
+ const text = await res.text();
191
+ return {
192
+ content: [{ type: "text", text: `Error ${res.status}: ${text}` }],
193
+ isError: true,
194
+ };
195
+ }
196
+ const data = (await res.json());
197
+ const content = data?.result?.content ?? [
198
+ { type: "text", text: JSON.stringify(data) },
199
+ ];
200
+ return {
201
+ content: content,
202
+ };
203
+ });
163
204
  const transport = new StdioServerTransport();
164
205
  await server.connect(transport);
package/package.json CHANGED
@@ -1,16 +1,32 @@
1
1
  {
2
2
  "name": "@aicommander/mcp",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "mcpName": "dev.aicommander/mcp",
5
- "description": "Universal stdio MCP server for AI Commander — connect Codex CLI, Claude Desktop, or any stdio MCP client to your remote machines by session code (AIC-…) or saved alias/hostname.",
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": [
7
+ "ssh",
8
+ "remote",
9
+ "remote-execution",
10
+ "remote-command",
11
+ "remote-access",
12
+ "remote-management",
13
+ "remote-shell",
14
+ "shell",
15
+ "bash",
16
+ "terminal",
17
+ "command-execution",
18
+ "ssh-alternative",
19
+ "ansible-alternative",
20
+ "devops",
21
+ "sysadmin",
22
+ "server-management",
23
+ "fleet",
7
24
  "mcp",
8
25
  "model-context-protocol",
9
- "aicommander",
10
- "remote-shell",
26
+ "ai-agent",
11
27
  "claude",
12
28
  "codex",
13
- "ai-agent"
29
+ "aicommander"
14
30
  ],
15
31
  "homepage": "https://aicommander.dev",
16
32
  "license": "MIT",