@aicommander/mcp 1.0.15 → 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 +24 -0
- package/dist/bin/mcp.js +33 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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
|
@@ -168,5 +168,38 @@ server.registerTool("session_status", {
|
|
|
168
168
|
content: content,
|
|
169
169
|
};
|
|
170
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
|
+
});
|
|
171
204
|
const transport = new StdioServerTransport();
|
|
172
205
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aicommander/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
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": [
|