@xns-cloud/relayer-mcp 0.11.1 → 0.13.0

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/PRIVACY.md CHANGED
@@ -28,7 +28,7 @@ Only through the ordinary, visible operation of the tools you ask the agent to r
28
28
  | Creating an account, signing in | Your credentials, entered by you in your own browser | `auth.xns.tech` (Keycloak) |
29
29
  | Claiming a Relayer to your account | The claim session and the installation's identity | `console.xns.tech` |
30
30
  | Reading or changing settings, host selection, backups | The setting values you ask to read or change | `console.xns.tech` |
31
- | Installing or updating the Relayer | An anonymous download of the Docker Compose bundle and images | `releases.scpri.me` |
31
+ | Installing or updating the Relayer | An anonymous download of the Docker Compose bundle and images | `releases.xns.tech`; the `prom/node-exporter` image comes from Docker Hub |
32
32
 
33
33
  The agent never handles your password. Sign-in happens in your browser against our identity
34
34
  service; the extension receives only a short-lived access token.
@@ -48,13 +48,19 @@ Both are yours to delete at any time.
48
48
 
49
49
  ## Network boundary
50
50
 
51
- The extension cannot be pointed at a Relayer on the public internet. Two mechanisms enforce
52
- that: the tools that accept a host or endpoint argument run it through an allowlist that
53
- permits only `localhost`, loopback, RFC 1918 private ranges (`10/8`, `172.16/12`,
54
- `192.168/16`), and `*.local` (`src/lib/hostAllowlist.js`); the remaining tools expose no URL
55
- parameter at all and are fixed to `localhost`. Either way there is no input that reaches a
56
- public Relayer. The only public hosts this software contacts are the three XNS services
57
- named above.
51
+ No tool sends your sign-in token to a Relayer on the public internet. The tools that send it
52
+ to a Relayer (`verify_storage`, `setup_cli_credentials`) run its host through an allowlist
53
+ that permits only `localhost`, loopback, RFC 1918 private ranges (`10/8`, `172.16/12`,
54
+ `192.168/16`), and `*.local` (`src/lib/hostAllowlist.js`). Three inputs are not limited to
55
+ private addresses: the `host` of `check_relayer_health`, which gets plain HTTP health probes;
56
+ the `compose_url` of `install_relayer`, from which the compose file is downloaded; and the S3
57
+ `endpoint` of `verify_storage` (by default port 9000 on the Docker host), which gets the
58
+ round-trip test as S3 requests signed with a throwaway key (or the keys you pass). A signed
59
+ request carries the access key id and a signature, never the secret. The tool deletes a
60
+ throwaway key after the test, pass or fail; if that deletion fails, the reply carries a
61
+ `cleanup_warning` and the key stays until you remove it. Apart from those, the only public hosts contacted are the
62
+ three XNS services named above and, for the `prom/node-exporter` image that an install
63
+ pulls, Docker Hub.
58
64
 
59
65
  ## Stopping it
60
66
 
package/README.md CHANGED
@@ -4,28 +4,49 @@
4
4
  [![license](https://img.shields.io/npm/l/@xns-cloud/relayer-mcp)](./LICENSE)
5
5
  [![node](https://img.shields.io/node/v/@xns-cloud/relayer-mcp)](https://nodejs.org/)
6
6
 
7
- MCP server for [XNS Relayer](https://xns.tech) — S3-compatible decentralized object storage. Provides 15 tools that let an AI agent drive the complete Relayer setup and day-2 management conversationally over stdio transport.
7
+ S3-compatible cloud object storage from XNS, set up and managed by your AI assistant. This is the MCP server for [XNS](https://xns.tech). Provides 15 tools that let an AI agent set up the Relayer, the small gateway that runs on your own machine, and manage it day to day over stdio.
8
+
9
+ In Claude, use the `xns-storage` plugin: it registers this server and adds the step-by-step skills. In Claude Code, run:
10
+
11
+ ```text
12
+ /plugin marketplace add xns-cloud/xns-storage-plugin
13
+ /plugin install xns-storage@xns-cloud
14
+ ```
15
+
16
+ then say: set up XNS storage
17
+
18
+ For any other MCP client, run the server with npx:
8
19
 
9
20
  ```bash
10
21
  npx @xns-cloud/relayer-mcp@latest
11
22
  ```
12
23
 
13
- **Pricing:** [$6.00 per TB-month](https://xns.tech/pricing) — one rate, protection included, [$0 egress uncapped](https://xns.tech/pricing), [30-day minimum retention](https://xns.tech/pricing) with no separate early-delete fee.
24
+ **Pricing:** $6.00 per TB per month. $0 egress, uncapped. 30-day minimum retention, no early-delete fee. See [xns.tech/pricing](https://xns.tech/pricing).
14
25
 
15
26
  ## Requirements
16
27
 
17
- - **Node.js 20+** — see [Installing Node.js 20](#installing-nodejs-20) if your distro ships an older version.
28
+ On Ubuntu 24.04 or Debian 12, one command sets up everything:
29
+
30
+ ```bash
31
+ curl -fsSL https://releases.xns.tech/relayer/install.sh | sh
32
+ ```
33
+
34
+ The script installs Docker Engine and the compose plugin, adds you to the `docker` group, starts the Relayer in `/opt/xns-relayer`, and waits for the dashboard at `http://localhost:8888`. If Claude Code is present, it also installs Node.js 24 when Node is missing or older and registers this MCP. Log out and back in afterward so the `docker` group applies. On macOS or Windows it installs nothing and points you to Docker Desktop.
35
+
36
+ Without the script, the MCP needs:
37
+
38
+ - **Node.js 24+** — see [Installing Node.js 24](#installing-nodejs-24) if your distro ships an older version.
18
39
  - **Docker Engine** — on the same machine that runs the MCP. `install_relayer` refuses when the Docker daemon is on another machine (see [Remote Docker hosts](#remote-docker-hosts)).
19
40
 
20
- ### Installing Node.js 20
41
+ ### Installing Node.js 24
21
42
 
22
- Ubuntu's default apt repository only ships Node 18, which is too old. Two ways to get Node 20:
43
+ Ubuntu's default apt repository only ships Node 18, which is too old. Two ways to get Node 24:
23
44
 
24
45
  **nvm** (recommended — no root required):
25
46
 
26
47
  ```bash
27
48
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
28
- \. "$HOME/.nvm/nvm.sh" && nvm install 20
49
+ \. "$HOME/.nvm/nvm.sh" && nvm install 24
29
50
  ```
30
51
 
31
52
  **NodeSource** (system-wide): follow <https://github.com/nodesource/distributions#installation-instructions>.
@@ -36,16 +57,35 @@ If you start the MCP on an older Node, it exits immediately with this same guida
36
57
 
37
58
  The Relayer runs as a Docker container and persists its data in a Docker volume. If the MCP is running inside an ephemeral environment (a sandbox container, a CI runner, or a throwaway VM), any installation performed there will be lost when that environment exits. `check_prerequisites` detects this automatically and reports it as a warning with a concrete next step — it never blocks the flow.
38
59
 
39
- **If your environment is ephemeral**, run the MCP on a persistent Docker host instead (install Node.js 20 there and point your MCP client at it). Alternatively, hand the install step to a human operator on the target machine and continue onboarding from `check_relayer_health` onwards.
60
+ **If your environment is ephemeral**, run the MCP on a persistent Docker host instead (install Node.js 24 there and point your MCP client at it). Alternatively, hand the install step to a human operator on the target machine and continue onboarding from `check_relayer_health` onwards.
40
61
 
41
62
  ## Install
42
63
 
43
- **Claude Code** (one command):
64
+ On Ubuntu 24.04 or Debian 12, one command installs the Relayer and registers this MCP when Claude Code is present:
44
65
 
45
66
  ```bash
46
- claude mcp add relayer -- npx @xns-cloud/relayer-mcp@latest
67
+ curl -fsSL https://releases.xns.tech/relayer/install.sh | sh
47
68
  ```
48
69
 
70
+ If you use Claude Code with the `xns-storage` plugin, remove the `relayer` registration the script made; the plugin registers its own.
71
+
72
+ To set it up yourself instead:
73
+
74
+ **Claude Code** (with the plugin, which registers this server for you):
75
+
76
+ ```text
77
+ /plugin marketplace add xns-cloud/xns-storage-plugin
78
+ /plugin install xns-storage@xns-cloud
79
+ ```
80
+
81
+ Without the plugin, register it by hand:
82
+
83
+ ```bash
84
+ claude mcp add --scope user relayer -- npx @xns-cloud/relayer-mcp@latest
85
+ ```
86
+
87
+ Do one or the other, not both: with both, the 15 tools load twice.
88
+
49
89
  **Claude Desktop / any MCP client** — add to your `claude_desktop_config.json` (or equivalent):
50
90
 
51
91
  ```json
@@ -78,11 +118,11 @@ No separate install step required — npx fetches the package on demand.
78
118
 
79
119
  | # | Tool | Purpose |
80
120
  |---|------|---------|
81
- | 1 | `check_prerequisites` | Verify Docker (local or remote), ports (8888, 9000), an existing installation, disk, and network connectivity. |
121
+ | 1 | `check_prerequisites` | Verify Docker (local or remote), the compose plugin, Docker socket access (when it is denied, whether the `docker` group membership is missing or not yet live), ports (8888, 9000, 9443), an existing installation, free disk (10 GB on the Docker root and the install directory), and network connectivity. Each failure names the command that fixes it; ports held by a running `xns-relayer` pass. |
82
122
  | 2 | `start_registration` | Get the browser sign-up URL for creating an XNS account — the agent never handles credentials. |
83
123
  | 3 | `check_email_verified` | Poll email verification status (15s interval, 30-min timeout). |
84
- | 4 | `install_relayer` | Fetch the canonical beta channel bundle — relayer + Prometheus/Grafana monitoring stack (`https://releases.scpri.me/relayer/beta/docker-compose.yml`, anonymous pull, no `docker login`) — write the `.env`, and start the containers. Falls back to a bundled service-parity copy if the fetch fails. **Fresh installs only** — see [Fresh installs vs. existing deployments](#fresh-installs-vs-existing-deployments). The user authors nothing; `compose_url` is an optional override for custom installs. |
85
- | 5 | `check_relayer_health` | Poll UI, S3, HostIO, and the monitoring sidecars (10s interval, 300s timeout). A missing monitoring stack reports as degraded without blocking the flow. Targets the Docker host automatically. |
124
+ | 4 | `install_relayer` | Fetch the canonical release channel bundle — relayer + Prometheus/Grafana monitoring stack (`https://releases.xns.tech/relayer/release/docker-compose.yml` and its `.env`, anonymous pull, no `docker login`) — add the ports to that `.env`, and start the containers. If the release files cannot be downloaded or used it stops, says why and what to do, and installs nothing. A failure names its cause (port in use, image pull refused, Docker stopped, out of disk, Docker socket permission) and the fix. **Fresh installs only** — see [Fresh installs vs. existing deployments](#fresh-installs-vs-existing-deployments). The user authors nothing; `compose_url` is an optional override for custom installs. |
125
+ | 5 | `check_relayer_health` | Poll UI, S3, HostIO, and the monitoring sidecars (10s interval, 300s timeout). A missing monitoring stack reports as degraded without blocking the flow. Before the owner claims the Relayer and signs in, the S3 gateway is not started yet, so the tool returns `awaiting_claim: true` when the UI answers, the Docker CLI reaches the checked host, and the `xns-relayer` container holds no Muse token yet. When the token cannot be read (no such container, Docker unreachable), S3 down stays unhealthy. Targets the Docker host automatically. |
86
126
  | 6 | `start_claim` | Initiate a claim session — returns a URL for browser confirmation. |
87
127
  | 7 | `check_claim_status` | Poll claim state (STATE_1 / STATE_2 / STATE_3). |
88
128
  | 8 | `get_host_tags` | Retrieve available host tags for VPD configuration, plus the currently applied data/parity selection (read-back with an `is_default` flag). |
@@ -101,7 +141,8 @@ No separate install step required — npx fetches the package on demand.
101
141
  3. User clicks email verification link; agent polls (Tool 3).
102
142
  4. Agent installs and starts Relayer containers (Tool 4) — it writes the
103
143
  released compose + `.env` itself; the user is never asked for a compose URL.
104
- 5. Agent polls health until UI + S3 are up (Tool 5).
144
+ 5. Agent polls health until the UI is up (Tool 5); the S3 gateway starts once the
145
+ Relayer is claimed and its owner signs in to the Relayer web UI.
105
146
  6. Agent initiates claim; user opens claim URL in browser (Tools 6 + 7).
106
147
  7. Agent signs in via OIDC to configure host preferences (Tools 8 + 9).
107
148
  8. Agent verifies S3 storage is working (Tool 10).
@@ -115,7 +156,7 @@ After onboarding, tools 12-15 cover routine adjustments: `describe_settings` →
115
156
 
116
157
  ## Fresh installs vs. existing deployments
117
158
 
118
- `install_relayer` performs **fresh installs only** — it does not upgrade an existing deployment in place. Docker container names are unique per daemon, so any existing `xns-relayer` container (running **or stopped**, any channel — including an alpha-channel install from `releases.scpri.me`) blocks the install. Both `check_prerequisites` and `install_relayer` detect this and tell you before anything breaks.
159
+ `install_relayer` performs **fresh installs only** — it does not upgrade an existing deployment in place. Docker container names are unique per daemon, so any existing `xns-relayer` container (running **or stopped**, any channel — including an alpha-channel install from `releases.xns.tech`) blocks the install. Both `check_prerequisites` and `install_relayer` detect this and tell you before anything breaks.
119
160
 
120
161
  To replace an existing deployment:
121
162
 
@@ -129,7 +170,7 @@ then run `install_relayer` again. To keep the existing deployment, skip `install
129
170
 
130
171
  `install_relayer` writes `docker-compose.yml` and `.env` on the machine running the MCP, then runs `docker compose up` against whichever daemon the Docker CLI points at. When that daemon is on another machine (`DOCKER_HOST=ssh://…` or `tcp://…`, or an SSH Docker context), it refuses before writing or starting anything, and the error names the Docker host.
131
172
 
132
- To install, run the MCP on the Docker host (Node.js 20 there, MCP client pointed at it) and run `install_relayer` again. Or unset `DOCKER_HOST` / switch to the default Docker context to install on the machine running the MCP.
173
+ To install, run the MCP on the Docker host (Node.js 24 there, MCP client pointed at it) and run `install_relayer` again. Or unset `DOCKER_HOST` / switch to the default Docker context to install on the machine running the MCP.
133
174
 
134
175
  `check_prerequisites` reports the same condition as a failed `install_file_location` check. Health checks still work against a remote daemon: the MCP honors `DOCKER_HOST` and the active Docker context, `check_relayer_health` and `verify_storage` probe the remote host's ports 8888/9000 instead of localhost, and `check_prerequisites` skips the local port probes. `check_relayer_health` accepts a `host` override, and `verify_storage` an `endpoint` override, for setups the auto-detection can't see (port forwards, NAT).
135
176
 
@@ -137,12 +178,18 @@ To install, run the MCP on the Docker host (Node.js 20 there, MCP client pointed
137
178
 
138
179
  | Symptom | Cause | Fix |
139
180
  |---|---|---|
140
- | MCP exits with "requires Node.js 20 or newer" | Distro Node is too old (Ubuntu apt ships Node 18) | [Installing Node.js 20](#installing-nodejs-20) |
181
+ | MCP exits with "requires Node.js 24 or newer" | Distro Node is too old (Ubuntu apt ships Node 18) | [Installing Node.js 24](#installing-nodejs-24) |
141
182
  | `install_relayer` reports an existing `xns-relayer` container | A previous deployment (any channel) owns the container name | [Fresh installs vs. existing deployments](#fresh-installs-vs-existing-deployments) |
142
- | Port 8888/9000 already in use | Another service on the Docker host (another S3-compatible service squatting 9000) | Stop it, or install with custom ports: `install_relayer` `ui_port` / `s3_port` (health checks accept the same) |
183
+ | Port 8888/9000 already in use | Another service on the Docker host (another S3-compatible service squatting 9000) | Stop it, or install with custom ports: `install_relayer` `ui_port` / `s3_port` (health checks accept the same). After a failed `install_relayer`, remove the leftover container with `docker rm -f xns-relayer` before retrying |
184
+ | Port 9443 already in use | Another service on the Docker host holds the S3 HTTPS port the release compose publishes | Stop that service (`sudo ss -ltnp 'sport = :9443'` names it); `ui_port` / `s3_port` do not move 9443. Then `docker rm -f xns-relayer` and retry |
185
+ | Docker socket permission denied | You were added to the `docker` group after this session started, or not at all | `sudo usermod -aG docker $USER` if needed, then log out and back in |
186
+ | Docker is not running | The Docker daemon is stopped | `sudo systemctl start docker` |
187
+ | Not enough disk space | Under 10 GB free on the Docker root or the install directory | Free space there, then re-run |
188
+ | Image pull refused | `releases.xns.tech` unreachable, or a stale registry login | Check the connection; `docker logout releases.xns.tech` |
143
189
  | Health checks fail but containers run on a remote Docker host | Ports 8888/9000 not reachable from the management node | Open them, or pass `host` / `endpoint` overrides |
144
190
  | `install_relayer` fails with "The Docker daemon is on <host>, not this machine" | `DOCKER_HOST` or an SSH/TCP Docker context points at another machine, and the install files would be written here instead | Run the MCP on that host and re-run, or unset `DOCKER_HOST` / use the default Docker context ([Remote Docker hosts](#remote-docker-hosts)) |
145
191
  | `install_relayer` fails with "Failed to create directory …" | The install path needs root on the machine running the MCP (common on macOS/Windows workstations for paths under `/opt`), or a regular file sits at or along it | Pass a writable `install_path`; the exact OS error is in the MCP server's stderr log |
192
+ | `install_relayer` stops with '… nothing was installed' | The release files could not be downloaded, were incomplete, do not support the requested `bind_address`, or could not be held in the temporary folder | The message names it; then run `install_relayer` again |
146
193
 
147
194
  ## Authentication
148
195
 
@@ -157,7 +204,7 @@ npm install
157
204
  npm test
158
205
  ```
159
206
 
160
- Requires Node.js 20+.
207
+ Requires Node.js 24+.
161
208
 
162
209
  ## Note on `relayer-native` client
163
210
 
@@ -173,7 +220,7 @@ The short version:
173
220
  - **No telemetry.** No analytics, crash reporting, or usage counters. It does not phone home.
174
221
  - **Tokens live in memory only.** OIDC access tokens are never written to disk; they are discarded when the process exits.
175
222
  - **The agent never sees your password.** Sign-in happens in your own browser against `auth.xns.tech`.
176
- - **Private network only.** No tool can be pointed at a public Relayer: the ones taking a host argument run it through an allowlist (`localhost`, loopback, RFC 1918, `*.local`), and the rest expose no URL parameter and are fixed to `localhost`. The three XNS services it contacts are `auth.xns.tech`, `console.xns.tech`, and `releases.scpri.me`.
223
+ - **Credentials stay on your network.** The tools that send a token to a Relayer (`verify_storage`, `setup_cli_credentials`) run its host through an allowlist (`localhost`, loopback, RFC 1918, `*.local`). `check_relayer_health` sends plain HTTP health probes, with no credentials, to the Docker host or the `host` you pass, which is not limited to private addresses, `install_relayer` downloads from any `compose_url` you pass, and the S3 test in `verify_storage` goes to the `endpoint` you pass (requests are signed, so the secret key is never sent). Otherwise the public hosts contacted are the three XNS services `auth.xns.tech`, `console.xns.tech` and `releases.xns.tech`, and Docker Hub for the `prom/node-exporter` image that an install pulls.
177
224
  - **Your stored objects never pass through it.** The Relayer you host handles your data directly.
178
225
 
179
226
  ## Desktop extension (MCPB)
package/manifest.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "manifest_version": "0.3",
3
3
  "name": "relayer-mcp",
4
- "display_name": "XNS Relayer",
5
- "version": "0.11.1",
6
- "description": "Set up and manage a self-hosted XNS Relayer — S3-compatible object storage — conversationally.",
7
- "long_description": "XNS Relayer is S3-compatible object storage you host yourself: $0 egress, uncapped, on hardware you control. This extension gives Claude 15 tools that walk the whole lifecycle — check prerequisites, register an XNS account, install the Relayer via Docker Compose, claim it to your account, choose which hosts store your data (VPD), verify an S3 round trip, provision CLI credentials, then handle day-2 work: settings, service restarts, and configuration backups.\n\nThe server runs locally on your machine and talks to your Relayer over loopback or your private network only — connections to public addresses are refused by design. Sign-in happens in your browser against XNS's identity service; the agent never sees your password.",
4
+ "display_name": "XNS Cloud Storage",
5
+ "version": "0.13.0",
6
+ "description": "S3-compatible cloud object storage from XNS, set up and managed by your AI assistant.",
7
+ "long_description": "XNS is S3-compatible cloud object storage. $6.00 per TB per month. $0 egress, uncapped. 30-day minimum retention, no early-delete fee. You reach it through the Relayer, a small gateway that runs on your own machine, so the S3 endpoint and keys stay on hardware you control. This extension gives Claude 15 tools that walk the whole lifecycle — check prerequisites, register an XNS account, install the Relayer via Docker Compose, claim it to your account, choose which hosts store your data (VPD), verify an S3 round trip, provision CLI credentials, then handle day-2 work: settings, service restarts, and configuration backups.\n\nThe server runs locally on your machine and talks to your Relayer over loopback or your private network only — connections to public addresses are refused by design. Sign-in happens in your browser against XNS's identity service; the agent never sees your password.",
8
8
  "author": {
9
9
  "name": "SCP Corp",
10
10
  "url": "https://xns.tech"
@@ -21,7 +21,6 @@
21
21
  "s3",
22
22
  "object-storage",
23
23
  "backup",
24
- "self-hosted",
25
24
  "docker",
26
25
  "devops"
27
26
  ],
@@ -109,7 +108,7 @@
109
108
  "linux"
110
109
  ],
111
110
  "runtimes": {
112
- "node": ">=20.0.0"
111
+ "node": ">=24.0.0"
113
112
  }
114
113
  }
115
114
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@xns-cloud/relayer-mcp",
3
3
  "mcpName": "tech.xns/relayer",
4
- "version": "0.11.1",
5
- "description": "MCP server for XNS Relayer onboarding and day-2 management — drives Relayer setup, settings, and backups conversationally over stdio, npx-ready",
4
+ "version": "0.13.0",
5
+ "description": "S3-compatible cloud object storage from XNS, set up and managed by your AI assistant.",
6
6
  "author": "SCP Corp",
7
7
  "license": "Apache-2.0",
8
8
  "homepage": "https://xns.tech",
@@ -35,7 +35,6 @@
35
35
  "ai-agent",
36
36
  "stdio",
37
37
  "docker",
38
- "self-hosted",
39
38
  "storage",
40
39
  "backup",
41
40
  "s3-compatible",
@@ -46,13 +45,12 @@
46
45
  "agentic"
47
46
  ],
48
47
  "engines": {
49
- "node": ">=20"
48
+ "node": ">=24"
50
49
  },
51
50
  "files": [
52
51
  "src/index.js",
53
52
  "src/lib/",
54
53
  "src/tools/",
55
- "src/templates/",
56
54
  "LICENSE",
57
55
  "NOTICE",
58
56
  "manifest.json",
package/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- // Node 20+ guard — runs BEFORE the SDK loads so users on older runtimes get a
4
+ // Node 24+ guard — runs BEFORE the SDK loads so users on older runtimes get a
5
5
  // remediation message instead of a SyntaxError from a dependency.
6
6
  const { checkNodeVersion } = require('./lib/nodeVersion');
7
7
  const nodeCheck = checkNodeVersion(process.versions.node);
@@ -17,10 +17,12 @@ const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio
17
17
  // package, and the registry card cannot drift apart (CONTRACT-1, E-A2 review).
18
18
  // package.json mcpName is the immutable registry identity, pinned by
19
19
  // registryIdentity.test.js.
20
+ // The instructions go back in the initialize reply, so a client learns what
21
+ // XNS is and which tool to run first before it lists the tools.
20
22
  const server = new McpServer({
21
23
  name: require('../package.json').mcpName,
22
24
  version: require('../package.json').version,
23
- });
25
+ }, { instructions: require('./lib/serverInstructions') });
24
26
 
25
27
  // Register all 15 tools
26
28
  require('./tools/checkPrerequisites')(server);
@@ -3,6 +3,9 @@
3
3
  const net = require('net');
4
4
  const { execFile: nodeExecFile } = require('child_process');
5
5
 
6
+ // Where the Relayer image keeps the Muse token it starts its storage services with.
7
+ const MUSE_TOKEN_PATH = '/relayer/conf/hostioauth';
8
+
6
9
  // Every loopback spelling a Docker endpoint can carry: localhost, the whole
7
10
  // 127/8 block, the 0.0.0.0 / [::] wildcards, [::1], and IPv4-mapped 127/8
8
11
  // ([::ffff:127.0.0.1], which URL normalizes to [::ffff:7f00:1]).
@@ -56,6 +59,44 @@ function parseDockerEndpoint(endpoint) {
56
59
  }
57
60
  }
58
61
 
62
+ // Docker failure causes, first match wins (permission denied before daemon
63
+ // stopped: a denied socket can also print "Is the docker daemon running?"; pull
64
+ // refused before port in use: a pull error may mention a port).
65
+ const FAILURE_PATTERNS = [
66
+ // Only a refused connection to the Docker API is a socket denial. Docker 28
67
+ // and older word it "...to the Docker daemon socket", Docker 29 "...to the
68
+ // docker API"; a bind-mount "permission denied" must not match.
69
+ { key: 'permission_denied', pattern: /permission denied while trying to connect to the docker/i },
70
+ { key: 'daemon_stopped', pattern: /cannot connect to the docker daemon|is the docker daemon running|failed to connect to the docker API/i },
71
+ { key: 'out_of_disk', pattern: /no space left on device/i },
72
+ { key: 'pull_refused', pattern: /pull access denied|requested access to the resource is denied|unauthorized|manifest unknown|failed to resolve reference/i },
73
+ { key: 'port_in_use', pattern: /port is already allocated|address already in use/i },
74
+ ];
75
+
76
+ // The host side of a bind in Docker's text: "0.0.0.0:8888", "[::]:8888",
77
+ // "0.0.0.0:9000:172.18.0.2:9000/tcp" (the first address is the host's).
78
+ const BIND_HOST_PORT = /(?:\d{1,3}(?:\.\d{1,3}){3}|\[[0-9a-f:.]*\]):(\d{1,5})\b/i;
79
+
80
+ /**
81
+ * Classify a rejected docker() call into a known failure cause.
82
+ *
83
+ * Reads ONLY error.stderr (set by docker() below). error.message embeds the
84
+ * command line, so a compose path containing "8888" or "port" would otherwise
85
+ * be mistaken for that cause. The returned key never carries Docker's text.
86
+ *
87
+ * @param {Error|null|undefined} err - Rejection from docker()/composeUp()
88
+ * @returns {{key: string, port?: number|null}|null} null when nothing matches
89
+ */
90
+ function classifyDockerFailure(err) {
91
+ const stderr = err?.stderr;
92
+ if (typeof stderr !== 'string' || stderr === '') return null;
93
+ const match = FAILURE_PATTERNS.find(({ pattern }) => pattern.test(stderr));
94
+ if (!match) return null;
95
+ if (match.key !== 'port_in_use') return { key: match.key };
96
+ const bind = BIND_HOST_PORT.exec(stderr);
97
+ return { key: match.key, port: bind ? Number(bind[1]) : null };
98
+ }
99
+
59
100
  /**
60
101
  * Docker utility — runs Docker CLI commands using execFile (no shell).
61
102
  * Security non-negotiable: NEVER use exec() or spawn({ shell: true }).
@@ -148,6 +189,84 @@ function createDockerUtil(options = {}) {
148
189
  }
149
190
  }
150
191
 
192
+ /**
193
+ * Host ports a container publishes (`docker port <name>`), e.g.
194
+ * "8888/tcp -> 0.0.0.0:8888" and "8888/tcp -> [::]:8888" give [8888].
195
+ *
196
+ * Best-effort like findContainer: an unreachable daemon or an unknown
197
+ * container gives [], so the caller's port check stands as it was.
198
+ *
199
+ * @param {string} name - Exact container name
200
+ * @returns {Promise<number[]>} unique host ports, in output order
201
+ */
202
+ async function containerHostPorts(name) {
203
+ try {
204
+ const { stdout } = await docker(['port', String(name)]);
205
+ const ports = stdout.split('\n')
206
+ .map((line) => /->\s*\S*:(\d{1,5})\s*$/.exec(line.trim()))
207
+ .filter(Boolean)
208
+ .map((m) => Number(m[1]));
209
+ return [...new Set(ports)];
210
+ } catch {
211
+ return [];
212
+ }
213
+ }
214
+
215
+ /**
216
+ * The Compose project a container belongs to, by exact name (the
217
+ * `com.docker.compose.project` label). Returns '' for a container with no
218
+ * label, and null when no such container exists or docker is unreachable.
219
+ *
220
+ * @param {string} name - Exact container name
221
+ * @returns {Promise<string|null>}
222
+ */
223
+ async function containerProject(name) {
224
+ try {
225
+ // The name leads the output so that a container always prints a
226
+ // non-empty line, whatever its label.
227
+ const { stdout } = await docker([
228
+ 'inspect', '--type', 'container',
229
+ '-f', '{{.Name}}\t{{index .Config.Labels "com.docker.compose.project"}}',
230
+ String(name),
231
+ ]);
232
+ const line = stdout.trim().split('\n').filter(Boolean)[0];
233
+ if (!line) return null;
234
+ return (line.split('\t')[1] || '').trim();
235
+ } catch {
236
+ return null;
237
+ }
238
+ }
239
+
240
+ /**
241
+ * Whether the Relayer in a container holds its Muse token. The image starts
242
+ * HostIO, the gateway and the S3 gateway only once the owner has claimed
243
+ * the Relayer and signed in to its web UI, which writes the token to
244
+ * /relayer/conf/hostioauth; until then those services are waiting, not
245
+ * failing.
246
+ *
247
+ * The answer comes from stdout, so a Docker CLI warning on stderr does
248
+ * not change it.
249
+ *
250
+ * @param {string} name - Exact container name
251
+ * @returns {Promise<boolean|null>} true token present, false not yet,
252
+ * null unknown (no such container, not running, docker unreachable,
253
+ * timed out)
254
+ */
255
+ async function hasMuseToken(name) {
256
+ try {
257
+ const { stdout } = await docker(
258
+ ['exec', String(name), 'sh', '-c', `if [ -s ${MUSE_TOKEN_PATH} ]; then echo present; else echo absent; fi`],
259
+ { timeout: 10000 },
260
+ );
261
+ const answer = stdout.trim();
262
+ if (answer === 'present') return true;
263
+ if (answer === 'absent') return false;
264
+ return null;
265
+ } catch {
266
+ return null;
267
+ }
268
+ }
269
+
151
270
  /**
152
271
  * Resolve which machine the Docker daemon actually runs on.
153
272
  *
@@ -173,7 +292,7 @@ function createDockerUtil(options = {}) {
173
292
  }
174
293
  }
175
294
 
176
- return { docker, composeUp, isContainerRunning, findContainer, getDockerHost };
295
+ return { docker, composeUp, isContainerRunning, findContainer, containerHostPorts, containerProject, hasMuseToken, getDockerHost };
177
296
  }
178
297
 
179
- module.exports = { createDockerUtil, parseDockerEndpoint, redactEndpoint };
298
+ module.exports = { createDockerUtil, parseDockerEndpoint, redactEndpoint, classifyDockerFailure };
@@ -4,7 +4,7 @@
4
4
  // (Ubuntu's default apt repo ships Node 18) so the friendly message below is
5
5
  // what the user sees, not a SyntaxError from a dependency.
6
6
 
7
- const MIN_MAJOR = 20;
7
+ const MIN_MAJOR = 24;
8
8
 
9
9
  /**
10
10
  * Check a Node.js version string against the package's engines floor.
@@ -20,10 +20,10 @@ function checkNodeVersion(version) {
20
20
  const message = [
21
21
  `relayer-mcp requires Node.js ${MIN_MAJOR} or newer — you are running v${version}.`,
22
22
  '',
23
- "Ubuntu's default apt repository only ships Node 18. Install Node 20 with nvm:",
23
+ "Ubuntu's default apt repository only ships Node 18. Install Node 24 with nvm:",
24
24
  '',
25
25
  ' curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash',
26
- ' \\. "$HOME/.nvm/nvm.sh" && nvm install 20',
26
+ ' \\. "$HOME/.nvm/nvm.sh" && nvm install 24',
27
27
  '',
28
28
  'Or via NodeSource: https://github.com/nodesource/distributions#installation-instructions',
29
29
  '',
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ // The text a client receives as `instructions` in the initialize reply: what
4
+ // XNS is, what the 15 tools do, the first tool to run, and where Claude users
5
+ // find the step-by-step skills. It must read correctly with no plugin installed.
6
+ module.exports = 'XNS is S3-compatible cloud object storage. $6.00 per TB per month. $0 egress, uncapped. 30-day minimum retention, no early-delete fee. You reach it through the Relayer, a small gateway that runs on your own machine, so the S3 endpoint and keys stay on hardware you control.'
7
+ + ' These 15 tools set the Relayer up and manage it: check the machine, create an XNS account in the browser, install and claim the Relayer, choose which hosts store the data, verify an S3 round trip, write CLI credentials, then change settings, restart services and back up the configuration.'
8
+ + ' Start with check_prerequisites.'
9
+ + " In Claude, the xns-storage plugin's skills (set-up-xns-storage and use-xns-storage) hold the step-by-step."
10
+ + ' In Claude Code, install it with /plugin marketplace add xns-cloud/xns-storage-plugin and then /plugin install xns-storage@xns-cloud.'
11
+ + ' The tools work the same without the plugin.';
@@ -27,7 +27,7 @@ module.exports = function registerCheckClaimStatus(server, options = {}) {
27
27
  server.registerTool(
28
28
  'check_claim_status',
29
29
  {
30
- title: 'check_claim_status',
30
+ title: 'Check claim status',
31
31
  description: 'Poll the status of a claim session. Checks every 10 seconds. States: STATE_1 (pending — user has not yet opened the claim URL), STATE_2 (in progress — user is completing the claim in browser), STATE_3 (completed — claim successful). Automatically proceeds when STATE_3 is reached.',
32
32
  inputSchema: {
33
33
  claim_id: z.string().describe('The claim_id returned by start_claim'),
@@ -30,7 +30,7 @@ module.exports = function registerCheckEmailVerified(server, options = {}) {
30
30
  server.registerTool(
31
31
  'check_email_verified',
32
32
  {
33
- title: 'check_email_verified',
33
+ title: 'Check email verification',
34
34
  description: 'Poll to check if the user has verified their email address. Automatically polls every 15 seconds for up to 30 minutes. Returns immediately if already verified. If the email has no account, indicates registration is needed.',
35
35
  inputSchema: {
36
36
  email: z.string().email().describe('Email address to check verification status'),