@agents402/setup
v0.2.0
Published
Pair a self-custodial Lightning wallet from the agents402 web app to your local MCP server. Used by `npx @agents402/setup`.
Readme
@agents402/setup
Pair a self-custodial Lightning wallet from the agents402 web app to your local MCP server in one shot — no manual file copy, no browser tab pinning.
Usage
npx @agents402/setupThis:
- Opens a localhost listener on a random port.
- Opens your browser to
https://agents402.org/setup/newwith a callback URL and a single-use state token. - After you create a wallet and confirm your seed phrase, the web page POSTs the wallet config to the localhost listener.
- The CLI writes
~/.faregate/wallet.json(mode0600) and exits. (For back-compat, an existing~/.tollgate/is preserved if found.)
Restart your MCP client to pick up the new wallet.
Environment
| Var | Default | Purpose |
| --- | --- | --- |
| AGENTS402_WEB_URL | https://agents402.org | Web origin to open. |
| AGENTS402_SETUP_PORT | random | Pin the localhost listener port. |
| AGENTS402_SETUP_TIMEOUT_MS | 300000 | How long to wait for the browser POST. |
| FAREGATE_DATA_DIR | ~/.faregate | Where to write wallet.json. (TOLLGATE_DATA_DIR is read as a fallback.) |
Security
- The state token is generated locally; the web page must echo it back in
X-Agents402-Statefor the CLI to accept the config. - The listener binds to
127.0.0.1only. - Wallet config is written with file mode
0600. - Same OAuth-callback pattern used by
gh auth loginandgcloud auth login.
Source
github.com/gereonelvers/tollgate —
packages/cli.
