relayer-mcp

relayer-mcp

Install and manage a self-hosted XNS Relayer — S3-compatible distributed object storage — conversationally over stdio. 15 tools cover prerequisites, account registration, install, claim, health, VPD configuration, S3 verification, CLI credentials, settings, restart, and backups.

Category
访问服务器

README

@xns-cloud/relayer-mcp

npm version license node

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

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.

Install

Claude Code (one command):

claude mcp add relayer -- npx @xns-cloud/relayer-mcp@latest

Claude Desktop / any MCP client — add to your claude_desktop_config.json (or equivalent):

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

No separate install step required — npx fetches the package on demand.

Tools

# Tool Purpose
1 check_prerequisites Verify Docker (local or remote), ports (8888, 9000), an existing installation, disk, and network connectivity.
2 register_account Register an XNS account (email + password) via Console2.
3 check_email_verified Poll email verification status (15s interval, 30-min timeout).
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. The user authors nothing; compose_url is an optional override for custom installs.
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.
6 start_claim Initiate a claim session — returns a URL for browser confirmation.
7 check_claim_status Poll claim state (STATE_1 / STATE_2 / STATE_3).
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).
9 configure_vpd Set 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).
10 verify_storage Round-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).
11 setup_cli_credentials Provision S3 IAM credentials and write ~/.xns/credentials so the XNS CLI works without further configuration.
12 describe_settings List 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.
13 update_settings Apply 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.
14 restart_service Restart hostio, gateway, s3gateway, database, or all services. Disruptive; pairs with check_relayer_health to verify recovery.
15 manage_backups List / start / restore / delete configuration backups. Restore is destructive and supports selective components (db, conf, hostio, samba).

Onboarding Flow

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

Symptom Cause Fix
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 container A previous deployment (any channel) owns the container name Fresh installs vs. existing deployments
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)
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

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选