@dainprotocol/installer
v0.4.3
Published
Install DAIN Claude Code / Codex CLI plugin in one paste command.
Readme
@dainprotocol/installer
Install the DAIN MCP plugin for Claude Code or Codex in one paste-command.
Install
Generate an install code in your DAIN account settings, then paste:
npx -y @dainprotocol/installer claude install --code dxc_xxxxxxxxxxxxThat command does three things:
- Redeems the install code against your DAIN account (codes are valid for 5 minutes, single-use).
- Writes the device-scoped CLI JWT to
~/.config/dain/profile.json(mode0600, readable only by your local user). - Registers the DAIN MCP server with Claude Code (or Codex /
manual).
Restart Claude Code / Codex afterward to pick up the new MCP server.
Requirements
- Node
>=20(the installer fails fast with a friendly message on older Node). npm/npxonPATH(any recent Node distribution ships both).- macOS or Linux. Windows is
--host manualonly in v1; help text gives you the exact MCP server config to paste into your host.
Flags
claude-install claude install [options]
--code <code> install code from your DAIN account
--host <host> claude-code | codex | manual (default: claude-code)
--server <url> dain-client base URL (default: https://dev.dain.org)
--allow-untrusted-server accept a non-DAIN --server (dev only)
--installer-pin <version> pin the MCP launcher version (default: this installer's version)--server is allowlisted to dev.dain.org, dain.bot, dain.org, and
dotted subdomains of those hosts. Local-dev tunnel installs (e.g.,
https://cleon.ngrok.app) require --allow-untrusted-server — this
is the phishing defense for the public paste flow.
What the MCP server does
After installation, the second bin dain-mcp is the resolved target of
the host's MCP launcher. It runs over stdio and exposes the DAIN Finance
tool surface (multi-chain DeFi data + Privy-signed transactions across
Solana / EVM / BTC — defi.dain.bot only) to your AI host. The tools are
generic dispatchers (dain_explore → dain_describe_tool / dain_load_skill
→ dain_call_tool) over a runtime-discovered catalog, so new capabilities
surface automatically. Behind the scenes it speaks to dev.dain.org (or
whatever --server you selected) using the device-scoped JWT.
Configuration overrides
Operator knobs read from the environment, useful only if you're running the installer against a custom DAIN deployment:
| Var | Default | Effect |
|---|---|---|
| DAIN_DEFI_AGGREGATOR_URL | https://defi.dain.bot | Override the upstream DAIN Finance (defi-service) URL. |
| DAIN_MCP_MANIFEST_TTL_HOURS | 4 | Manifest-cache / tool-discovery TTL for the MCP server. |
| DAIN_MCP_NO_AUTO_OPEN | unset | Set to disable best-effort auto-open of the browser sign-session page. |
| DAIN_VERIFY_AGENT_ONCHAIN | 1 | 0 skips on-chain signature verification (LOCAL DEV ONLY). |
Troubleshooting
- "Install code expired" — codes are valid 5 minutes. Generate a new one.
- "Install code was already used" — codes are single-use. Generate a new one.
- "
npxnot found" — install Node 20+ and re-run. - "INVALID_PROFILE" — your existing profile was created by an older
installer that stored the JWT outside
profile.json. Generate a new install code in dain.bot and re-run the installer to pair this device. - "Windows host installation is not supported in v1" — use
--host manual; the printed snippet tells you exactly what to paste into your host's MCP config.
Security
- Reports security issues to
[email protected]. - The installer never silently accepts a non-DAIN
--server(see--allow-untrusted-server). The DAIN passkey CLI bridge minted your install code; the installer's allowlist is the second line of defense against phishing variants.
Source
This is the public thin shim of the @dainprotocol/cli family. Source
lives in dain-tooling/packages/installer.
License: ISC.
