🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@xns-cloud/relayer-mcp

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xns-cloud/relayer-mcp

MCP server for XNS Relayer onboarding and day-2 management — drives Relayer setup, settings, and backups conversationally over stdio, npx-ready

latest
Source
npmnpm
Version
0.6.1
Version published
Maintainers
1
Created
Source

@xns-cloud/relayer-mcp

MCP server for XNS Relayer onboarding and day-2 management. Provides 15 tools that let an AI agent drive the complete Relayer setup — and afterward adjust settings, manage backups, and tune the VPD — conversationally over stdio transport.

Requirements

  • Node.js 20+ — see Installing Node.js 20 if your distro ships an older version.
  • Docker Engine — on the same machine, or on a remote host via a Docker context (see Remote Docker hosts).

Installing Node.js 20

Ubuntu's default apt repository only ships Node 18, which is too old. Two ways to get Node 20:

nvm (recommended — no root required):

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
\. "$HOME/.nvm/nvm.sh" && nvm install 20

NodeSource (system-wide): follow https://github.com/nodesource/distributions#installation-instructions.

If you start the MCP on an older Node, it exits immediately with this same guidance instead of a dependency stack trace.

Claude Desktop / Claude Code Configuration

Add to your claude_desktop_config.json (or claude mcp add relayer -- npx @xns-cloud/relayer-mcp@latest for Claude Code):

{
  "mcpServers": {
    "relayer": {
      "command": "npx",
      "args": ["@xns-cloud/relayer-mcp@latest"]
    }
  }
}

No separate install step required.

Tools

#ToolPurpose
1check_prerequisitesVerify Docker (local or remote), ports (8888, 9000), an existing installation, disk, and network connectivity.
2register_accountRegister an XNS account (email + password) via Console2.
3check_email_verifiedPoll email verification status (15s interval, 30-min timeout).
4install_relayerFetch 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. The user authors nothing; compose_url is an optional override for custom installs.
5check_relayer_healthPoll 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.
6start_claimInitiate a claim session — returns a URL for browser confirmation.
7check_claim_statusPoll claim state (STATE_1 / STATE_2 / STATE_3).
8get_host_tagsRetrieve available host tags for VPD configuration, plus the currently applied data/parity selection (read-back with an is_default flag).
9configure_vpdSet data/parity host selection via CEL expressions. dry_run: true previews the matched host counts without applying (requires a Relayer build with the HostIO evaluate endpoint; older builds report preview_supported: false).
10verify_storageRound-trip S3 test (create bucket, put object, get object) against the S3 gateway on port 9000. Requires fullaccess credentials (admin key pair from the Relayer UI IAM page — not a read-only or bucket-scoped key). Test bucket is cleaned up automatically. If auto-detection cannot reach the host, pass endpoint with an explicit IP (e.g. http://192.168.1.100:9000).
11setup_cli_credentialsProvision S3 IAM credentials and write ~/.xns/credentials so the XNS CLI works without further configuration.
12describe_settingsList the adjustable settings — worker/concurrency tuning, backup schedule, cost center (CCID) — with current values, defaults, and guidance. The MCP deliberately exposes only this curated set, never the full advanced catalog.
13update_settingsApply a map of setting changes (whitelist-enforced). Returns require_restart. Requires relayer-ui >= 3.43.3 — older servers can clobber the database password on config round-trips.
14restart_serviceRestart hostio, gateway, s3gateway, database, or all services. Disruptive; pairs with check_relayer_health to verify recovery.
15manage_backupsList / start / restore / delete configuration backups. Restore is destructive and supports selective components (db, conf, hostio, samba).

Onboarding Flow

  • Agent checks prerequisites (Tool 1).
  • Agent registers account or skips if existing (Tool 2).
  • User clicks email verification link; agent polls (Tool 3).
  • Agent installs and starts Relayer containers (Tool 4) — it writes the released compose + .env itself; the user is never asked for a compose URL.
  • Agent polls health until UI + S3 are up (Tool 5).
  • Agent initiates claim; user opens claim URL in browser (Tools 6 + 7).
  • Agent signs in via OIDC to configure host preferences (Tools 8 + 9).
  • Agent verifies S3 storage is working (Tool 10).
  • Optionally, agent provisions CLI credentials (Tool 11).

The operator's only required actions are: clicking one email link, completing one browser sign-in, and confirming one claim.

Day-2 Management

After onboarding, tools 12-15 cover routine adjustments: describe_settingsupdate_settingsrestart_service for tuning (workers, concurrency, backup schedule, cost center), and manage_backups for the backup lifecycle. All four use the same OIDC session as tools 8-9. Destructive operations (restore, restart, changing the cost center) are agent-confirmed with the operator before execution — the tool descriptions and responses carry the warnings.

Fresh installs vs. existing deployments

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.

To replace an existing deployment:

docker stop xns-relayer && docker rm xns-relayer   # does NOT delete the data directory

then run install_relayer again. To keep the existing deployment, skip install_relayer and continue onboarding against it (check_relayer_health onwards).

Remote Docker hosts

Claude Code doesn't have to run on the Docker machine. If you run it on a management node or jump host, point the Docker CLI at the remote server with an SSH context:

docker context create relayer --docker "host=ssh://user@docker-box"
docker context use relayer

(Requires the docker CLI on the management node — the static binary is enough — and SSH key access to the Docker host.)

The MCP detects this automatically (it honors DOCKER_HOST and the active Docker context):

  • install_relayer runs docker compose against the remote daemon.
  • check_relayer_health and verify_storage probe the remote host's ports 8888/9000 instead of localhost — make sure those are reachable from the management node.
  • check_prerequisites skips the local port-availability probes (the containers bind ports on the remote host) and reports them as skipped with instructions.

check_relayer_health accepts a host override, and verify_storage an endpoint override, for setups the auto-detection can't see (port forwards, NAT).

Troubleshooting

SymptomCauseFix
MCP exits with "requires Node.js 20 or newer"Distro Node is too old (Ubuntu apt ships Node 18)Installing Node.js 20
install_relayer reports an existing xns-relayer containerA previous deployment (any channel) owns the container nameFresh installs vs. existing deployments
Port 8888/9000 already in useAnother 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)
Health checks fail but containers run on a remote Docker hostPorts 8888/9000 not reachable from the management nodeOpen them, or pass host / endpoint overrides

Authentication

Tools 8-9 and 12-15 require an OIDC token to access the Relayer API and HostIO proxy. The MCP acquires one automatically using Authorization Code + PKCE (S256) flow against the scprime Keycloak realm with the relayer-native public client. The user completes a browser sign-in; the MCP captures the code on a local 127.0.0.1 loopback listener and exchanges it for a token.

Prerequisite: The relayer-native public client must be registered on the Keycloak scprime realm (PKCE S256, redirect http://127.0.0.1:*).

Development

npm install
npm test

Requires Node.js 20+.

Note on relayer-native client

This package uses the relayer-native Keycloak client ID for OIDC authentication. The same client ID is intended for reuse by a future standalone Relayer CLI (@xns-cloud/relayer-cli), with the OIDC module (src/lib/oidcAuth.js) extracted to a shared @xns-cloud/relayer-auth package.

License

Apache-2.0 © SCP Corp. See LICENSE and NOTICE.

Keywords

mcp

FAQs

Package last updated on 17 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts