# Claude Code CLI Crypto Trading via Eterna MCP

> Run `claude mcp add --transport http eterna https://mcp.eterna.exchange/mcp` in your terminal to connect Anthropic Claude Code to Eterna AI. Claude Code can then run multi-step TypeScript market scans, indicator calculations, and live USDT perpetual or spot trades across 1,180+ markets inside one `execute_code` call with zero local API keys.

- Canonical URL: https://ai.eterna.exchange/integrations/claude-code
- Last updated: November 23, 2026
- Author: Eterna Engineering (MCP & Agent Infrastructure Team)
- MCP endpoint: https://mcp.eterna.exchange/mcp

Claude Code is uniquely suited for systematic traders who keep strategy specs, risk policies, and backtest notes in a local Git repository. Pairing Claude Code with Eterna MCP turns your terminal into an interactive trading workstation with OAuth 2.1 security and isolated sub-accounts.

## Key Facts

| Metric | Value | Notes |
|--------|-------|-------|
| Install Command | 1 line | claude mcp add --transport http eterna ... |
| Auth Method | OAuth 2.1 | No local .env secrets or API keys |
| Execution Model | execute_code | Full TypeScript runs inside Deno sandbox |
| Trading Fees | 0.014% / 0.035% | Perp maker / taker, $0 MCP fee |

## 1. Add Eterna MCP to Claude Code

Register the remote HTTP transport directly in Claude Code user or project scope. No npm wrapper or local proxy is needed.

1. **Register the remote MCP server**: Add Eterna as an HTTP MCP server at user scope so every workspace can access it, or omit `--scope user` to keep it inside one trading repository.
   `claude mcp add --scope user --transport http eterna https://mcp.eterna.exchange/mcp`
2. **Verify connection and trigger OAuth**: Launch `claude`, run `/mcp`, select `eterna`, and sign in through the browser OAuth flow. Eterna provisions an isolated no-KYC sub-account automatically.
   `/mcp`
3. **Pin trading guardrails in CLAUDE.md**: Add your max risk per trade, allowed leverage cap, and confirmation rule to a local `CLAUDE.md` file so Claude Code applies them on every session.

### CLAUDE.md (recommended repo guardrails)

```markdown
# Trading Guardrails (Eterna MCP)
- Always call eterna.getBalance() and eterna.getPositions() before opening any trade.
- Never exceed 5x leverage or risk more than 1.5% of equity per trade.
- Always attach stopLoss and takeProfit when calling eterna.placeOrder().
- Require explicit user confirmation before executing any market order or withdrawal.
```

*Claude Code loads CLAUDE.md automatically at session start and enforces these constraints before calling execute_code.*

## 2. Why Claude Code + execute_code Beats Script Hacking

Instead of writing disposable Python scripts that leak API keys into `.env` files, Claude Code executes typed SDK code inside Eterna's managed sandbox.

- Version-control strategy prompts and audit logs in Git without ever committing exchange credentials.
- Inspect live orderbooks, RSI, MACD, EMA, VWAP, and Bollinger Bands across 20 pairs in one sandbox execution.
- Combine local files (journal CSVs, watchlists, news notes) with live Eterna positions in the same reasoning turn.
- Install the official Eterna Trading Skill zip into `.claude/skills/` for pre-tuned trade workflows.

## Frequently Asked Questions

### Does Claude Code need local Bybit or Eterna API keys?

No. Claude Code connects via OAuth 2.1 directly to `https://mcp.eterna.exchange/mcp`. Credentials never sit in `.env` files or shell history.

### Can Claude Code run scheduled or headless trading loops?

For unattended cron loops or VPS deployments, pair Eterna MCP with `@eterna-hybrid-exchange/cli` and OAuth device flow rather than an interactive terminal session.

## References & Primary Sources

- [Claude Crypto Trading Hub](https://ai.eterna.exchange/claude-crypto-trading): Full guide covering Claude Web, Desktop, Skills, and Claude Code.
- [Eterna MCP GitHub Repository](https://github.com/EternaHybridExchange/eterna-mcp): Official quickstart and Claude skill bundle.

## Related Guides

- [How to Trade Crypto with Claude (MCP Connector & Trading Skill)](https://ai.eterna.exchange/claude-crypto-trading)
- [Eterna CLI Guide: Terminal TypeScript Strategies with `@eterna-hybrid-exchange/cli`](https://ai.eterna.exchange/guides/eterna-cli-trading-automation)
- [RSI Mean-Reversion AI Crypto Trading Bot (Runnable MCP Script)](https://ai.eterna.exchange/strategies/rsi-mean-reversion-agent)
- [AI Crypto Trading Risk Management: Position Sizing, TP/SL & Kill Switches](https://ai.eterna.exchange/guides/ai-trading-risk-management-guardrails)
