Purpose
relayer-mcp is the MCP (Model Context Protocol) server for XNS Relayer. XNS Relayer is an S3-compatible object storage that runs on a decentralized provider network. This server lets AI agents complete the full installation and subsequent management of Relayer conversationally over stdio transport, with the operator only needing to perform a few browser-side actions.
Main capabilities
It provides 15 tools covering the following stages:
- Prerequisite checks (check_prerequisites).
- Obtain the browser registration link, with the user creating an account in the browser.
- After the user clicks the email verification link, the agent polls the verification status.
- Install and start the Relayer container (install_relayer)—it writes the published compose and .env itself and does not ask the user for a compose URL.
- Poll the health status until both the UI and S3 are ready (check_relayer_health).
- Initiate a claim, and the user opens the claim URL in the browser.
- Log in via OIDC to configure host preferences.
- Verify that S3 storage is available (verify_storage).
- Optional: issue CLI credentials.
- Day-to-day management (tools 12-15): describe_settings → update_settings → restart_service, used to adjust workers, concurrency, backup schedules, cost centers, etc.; manage_backups manages the backup lifecycle. The above tools and tools 8-9 use the same OIDC session. Destructive operations (restore, restart, changing the cost center) are confirmed by the agent with the operator before execution, and warnings are included in the tool descriptions and responses.
How to use
On Ubuntu 24.04 or Debian 12, a single command completes the entire setup: the script installs Docker Engine and the compose plugin, adds the current user to the docker group, starts Relayer in /opt/xns-relayer, and waits for the dashboard to be ready at http://localhost:8888 . If Claude Code is present, it also installs Node.js 20 and registers this MCP when Node is missing or the version is too old. Afterward, you need to log out and log back in for the docker group to take effect. On macOS or Windows, the script installs nothing and only guides you to use Docker Desktop. If you do not use the script, the MCP requires: Node.js 20+ (if the distribution ships an older version, install it with nvm or NodeSource); Docker Engine, which must be on the same machine as the MCP—when the Docker daemon is on another machine, install_relayer will refuse to execute. Manual registration examples:
- Claude Code (a single command when no MCP has been registered yet).
- Claude Desktop or any MCP client: write to claude_desktop_config.json (or the equivalent configuration).
- Cursor: write to .cursor/mcp.json. No separate installation step is needed; npx pulls the package on demand.
Applicable scenarios and limitations
- Fresh installations and existing deployments: install_relayer only performs a fresh installation and does not upgrade an existing deployment in place. The Docker container name is unique on each daemon, so any pre-existing xns-relayer container (whether running or stopped, any channel, including alpha-channel installations from releases.scpri.me) will block installation; both check_prerequisites and install_relayer detect this and inform you in advance. To replace an existing deployment, first remove the old container and then run install_relayer again; to keep an existing deployment, skip install_relayer and continue from check_relayer_health.
- Ephemeral environments: Relayer runs as a Docker container and persists data in a Docker volume. If the MCP runs in an ephemeral environment (a sandbox container, CI runner, or one-off VM), the installation there will be lost when the environment exits. check_prerequisites automatically detects this and reports it as a warning, giving specific next steps, but it does not block the process. In this case, you should use a persistent Docker hostRun MCP on it, or have a human perform the installation steps on the target machine, then continue from check_relayer_health.
- Remote Docker host: install_relayer writes docker-compose.yml and .env on the machine running MCP, then executes docker compose up against the daemon pointed to by the Docker CLI. When that daemon is on another machine (DOCKER_HOST=ssh://… or tcp://…, or using an SSH Docker context), it refuses before writing or starting, and indicates the Docker host in the error. Health checks can still work against a remote daemon: MCP follows DOCKER_HOST and the current Docker context, check_relayer_health and verify_storage probe ports 8888/9000 on the remote host rather than localhost, and check_prerequisites skips local port probing. check_relayer_health accepts a host override, and verify_storage accepts an endpoint override, for scenarios that automatic detection cannot cover (port forwarding, NAT).
- OIDC and security: tools 8-9 and 12-15 require an OIDC token to access the Relayer API and HostIO proxy. MCP uses the Authorization Code + PKCE (S256) flow to automatically obtain a token for the relayer-native public client of the scprime Keycloak realm; the user completes login in the browser, and MCP captures the authorization code on a local 127.0.0.1 loopback listener and exchanges it for a token. The prerequisite is that the relayer-native public client is already registered in the Keycloak scprime realm (PKCE S256, redirect http://127.0.0.1:*)。要求 Node.js 20+. Privacy highlights: no telemetry, no analytics, no crash reports, no usage counts; no proactive outbound connections. OIDC access tokens are kept only in memory, never written to disk, and discarded when the process exits. The agent never sees the user's password; login is completed in the user's own browser against auth.xns.tech. Private networks only: no tool can point to a public Relayer—tools that accept a host parameter enforce an allowlist (localhost, loopback, RFC 1918, *.local), and the remaining tools do not expose URL parameters and are pinned to localhost. The three XNS services it contacts are auth.xns.tech, console.xns.tech, and releases.scpri.me. Objects stored by the user do not pass through this MCP; they are handled directly by the user's self-hosted Relayer.
Other Information
- Desktop extension (MCPB): the same server is provided as an MCP Bundle and can be installed in Claude Desktop with one click. It can be built from a clean checkout: the script reinstalls production-only dependencies, validates the manifest, and writes out the .mcpb; the MCPB CLI version is pinned in the script, and it should not be invoked in a way that leaves the version unspecified; afterward run npm ci to restore development dependencies for testing. Validating the manifest only without repackaging is also possible. The manifest.json at the repository root is the package manifest, and mcpbManifest.test.js pins its version and tool list to package.json, server.json, and the running server; any drift causes the test suite to fail rather than go live.
- relayer-native client note: this package uses the relayer-native Keycloak client ID for OIDC authentication. The same client ID is planned to be reused by a future standalone Relayer CLI (@xns-cloud/relayer-cli), and the OIDC module (src/lib/oidcAuth.js) will be extracted into a shared package @xns-cloud/relayer-auth.
- Pricing: $6.00 per TB per month, flat rate, protection included, egress traffic $0 with no cap, minimum retention of 30 days with no separate early deletion fee.
- License: Apache-2.0 © SCP Corp., see LICENSE and NOTICE.
- Repository mirrored from GitLab.