@aicommander/mcp 1.0.16 → 1.0.17

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
@@ -7,7 +7,7 @@ Use this package to connect any MCP client that speaks **stdio** (Codex CLI, Cla
7
7
  > Using **Claude Code**? You don't need this package — add the relay directly:
8
8
  > `claude mcp add --transport http aicommander https://aicommander.dev/mcp`
9
9
  >
10
- > No login or token is required to connect. Only add `--header "Authorization: Bearer <api-key>"` if you want the optional accounts/alias features — generate an **account API key** for free at [aicommander.dev](https://aicommander.dev). By default an API key only works while its owner has signed in to the dashboard within the last **24h** (a sign-in or the dashboard "Reactivate" button re-arms it; opt-out per account) — if it lapses, tool calls return a friendly "sign in to reactivate" message instead of acting.
10
+ > No login or token is required to connect. Only add `--header "Authorization: Bearer <api-key>"` if you want the optional accounts/alias features — generate an **account API key** for free at [aicommander.dev](https://aicommander.dev). By default an API key only works while its owner has opened the dashboard within the last **24h** (just opening it — or a fresh sign-in, or the dashboard "Reactivate" button — re-arms it; opt-out per account) — if it lapses, tool calls return a friendly "open the dashboard to reactivate" message instead of acting.
11
11
 
12
12
  ## Tools
13
13
 
@@ -25,7 +25,7 @@ Two environment variables:
25
25
 
26
26
  | Variable | Required | Default | Description |
27
27
  |---|---|---|---|
28
- | `AICOMMANDER_TOKEN` | no | — | **Account API key** (or OAuth access token) for the optional accounts/alias features — saved machines, aliases, account access. Generate one for free at [aicommander.dev](https://aicommander.dev). An API key stays active only while its account has signed in to the dashboard within the last 24h (default; opt-out per account); OAuth access tokens are not gated this way. |
28
+ | `AICOMMANDER_TOKEN` | no | — | **Account API key** (or OAuth access token) for the optional accounts/alias features — saved machines, aliases, account access. Generate one for free at [aicommander.dev](https://aicommander.dev). An API key stays active only while its account has opened the dashboard within the last 24h (default; opt-out per account); OAuth access tokens are not gated this way. |
29
29
  | `AICOMMANDER_SERVER` | no | `https://aicommander.dev` | Base URL of the AI Commander relay. Defaults to the hosted service; only set this to point at a different endpoint. |
30
30
 
31
31
  ## Usage
package/dist/bin/mcp.js CHANGED
@@ -8,9 +8,14 @@ const SERVER_URL = process.env["AICOMMANDER_SERVER"] ?? "https://aicommander.dev
8
8
  // access. Without it the bridge works anonymously and you drive machines by their
9
9
  // session code (AIC-…) inside the code's 1-hour freshness window.
10
10
  const ACCOUNT_TOKEN = process.env["AICOMMANDER_TOKEN"];
11
+ // The /mcp endpoint is account-bound by default (it 401s an unauthenticated caller
12
+ // to drive the OAuth flow). This stdio bridge authenticates with a Bearer token when
13
+ // AICOMMANDER_TOKEN is set; without one it uses the explicit anonymous opt-in
14
+ // (?anonymous=1) so the AIC-code path keeps working.
15
+ const MCP_URL = ACCOUNT_TOKEN ? `${SERVER_URL}/mcp` : `${SERVER_URL}/mcp?anonymous=1`;
11
16
  const server = new McpServer({
12
17
  name: "aicommander",
13
- version: "1.0.15",
18
+ version: "1.0.17",
14
19
  }, {
15
20
  instructions: "AI Commander — remote command execution / remote shell over an outbound-only agent. " +
16
21
  "Use these tools for any SSH-style remote access: connect to a computer/machine/server, " +
@@ -66,7 +71,7 @@ server.registerTool("remote_exec", {
66
71
  .describe("Timeout in milliseconds. Default 300000 (5 min), max 3600000 (1 hr)"),
67
72
  },
68
73
  }, async ({ code, command, cwd, timeout_ms }) => {
69
- const res = await fetch(`${SERVER_URL}/mcp`, {
74
+ const res = await fetch(MCP_URL, {
70
75
  method: "POST",
71
76
  headers: {
72
77
  "Content-Type": "application/json",
@@ -140,7 +145,7 @@ server.registerTool("session_status", {
140
145
  .describe("How the user named the machine, passed exactly as given: an AIC- session code (e.g. AIC-XYZ-1234), or — with an API key — a saved alias/hostname like 'wearfits-m3' or 'aic-wearfits'."),
141
146
  },
142
147
  }, async ({ code }) => {
143
- const res = await fetch(`${SERVER_URL}/mcp`, {
148
+ const res = await fetch(MCP_URL, {
144
149
  method: "POST",
145
150
  headers: {
146
151
  "Content-Type": "application/json",
@@ -173,7 +178,7 @@ server.registerTool("list_machines", {
173
178
  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
179
  inputSchema: {},
175
180
  }, async () => {
176
- const res = await fetch(`${SERVER_URL}/mcp`, {
181
+ const res = await fetch(MCP_URL, {
177
182
  method: "POST",
178
183
  headers: {
179
184
  "Content-Type": "application/json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicommander/mcp",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
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": [