The first AI-native CLI for trading crypto, stocks, forex, and derivatives.
The first AI-native CLI for trading crypto, stocks, forex, and derivatives.
The first AI-native CLI for trading crypto, stocks, forex, and derivatives.
Full Kraken API access. Built-in MCP server. Live and paper trading. Single binary.
Works with Cursor, Claude, Codex, Copilot, Gemini, Goose, and OpenClaw.
Try these with your AI agent:
"Install kraken-cli (https://github.com/krakenfx/kraken-cli) and build me a morning market brief."
"Watch ETH, SOL, and BTC for 30 seconds. What are the pros and cons of buying each right now?"
"Look up AAPLx, TSLAx, and SPYx on xStocks. Summarize how each is performing today."
"You are a Wall Street veteran with 20 years of experience. You have 1 minute. Paper trade BTC and show me your P&L."
"Open a 10x leveraged long on BTC futures paper with $5,000 collateral. Set a trailing stop at 3%."
[!CAUTION] Experimental software. Interacts with the live Kraken exchange and can execute real financial transactions. Read DISCLAIMER.md before using with real funds or AI agents.
Single binary, no runtime dependencies.
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/krakenfx/kraken-cli/releases/latest/download/kraken-cli-installer.sh | shDetects your OS and architecture, downloads the right binary, and installs it. macOS (Apple Silicon and Intel) and Linux (x86_64 and ARM64) are supported. Windows: use WSL.
Verify it works:
kraken status && kraken ticker BTCUSDPre-built binaries are also available on the GitHub Releases page.
Build from source
Requires Rust.
cargo install --git https://github.com/krakenfx/kraken-cliOr clone and build:
git clone https://github.com/krakenfx/kraken-cli.git
cd kraken-cli
cargo install --path .One binary covers six asset classes. All trading commands work across asset classes using the same interface; pass --asset-class where needed.
| Asset class | Instruments | Margin | Flag | Example |
|---|---|---|---|---|
| Crypto spot | 1,400+ pairs (BTC, ETH, SOL, and hundreds more) | Up to 10x on major pairs | (default) | kraken order buy BTCUSD 0.001 --type limit --price 50000 |
| Tokenized U.S. stocks & ETFs (xStocks) | 79 assets: AAPL, NVDA, TSLA, GOOGL, AMZN, MSFT, SPY, QQQ, and more | Up to 3x on top 10 | --asset-class tokenized_asset |
kraken order buy AAPLx/USD 0.1 --type limit --price 200 --asset-class tokenized_asset |
| Forex | 11 fiat pairs: EUR/USD, GBP/USD, USD/JPY, AUD/USD, and more | — | --asset-class forex |
kraken ticker EURUSD --asset-class forex |
| Perpetual futures | 317 contracts: crypto, 5 forex perps, 11 equity/index perps (AAPL, NVDA, TSLA, SPY, QQQ, S&P 500) | Up to 50x | (futures engine) | kraken futures order buy PF_XBTUSD 1 --type limit --price 50000 |
| Inverse & fixed-date futures | 20 contracts: BTC, ETH, SOL, LTC, XRP, ADA, DOGE, LINK | Varies | (futures engine) | kraken futures order buy FI_XBTUSD_260327 1 --type limit --price 50000 |
| Earn / staking | Flexible and bonded strategies across multiple assets | — | — | kraken earn strategies --asset ETH |
xStocks are not available in the USA. Availability for all products varies by jurisdiction.
If you're an AI agent or building one, start here:
| Resource | Description |
|---|---|
| CONTEXT.md | Runtime context for tool-using agents |
| AGENTS.md | Full integration guide: auth, invocation, errors, rate limits |
| docs/feedback-ingest.md | How kraken feedback uploads to Kraken (limits, retention) |
| agents/tool-catalog.json | 174 commands with parameter schemas, types, and safety flags |
| agents/error-catalog.json | 10 error categories with retry guidance |
| skills/ | Goal-oriented SKILL.md workflow packages |
| CLAUDE.md | Claude-specific integration guidance |
Core invocation pattern:
kraken [args...] -o json 2>/dev/null-v or RUST_LOG). Never parse stderr for data.Why Agent-First?
Most CLIs are built for humans at a terminal. This one is built for LLM-based agents, MCP tool servers, and automated pipelines that need to call Kraken reliably without custom API clients.
-o json. No screen-scraping, no regex on table borders.error field (auth, rate_limit, validation, api, network). Agents route on error without parsing human sentences.kraken paper (spot) and kraken futures paper (perpetual futures) commands. No API keys, no real money, same interface as live trading.kraken record captures live streams into a local DuckDB/JSONL tape library with integrity counters; finalized tapes replay into paper sessions and feed the autoresearch lab.suggestion, retryable, and docs_url fields so agents can read the documentation and adapt their strategy.Humans benefit from the same design: --output table renders clean tables, kraken shell provides a REPL, and kraken setup walks through configuration.
Release binaries are signed with minisign. Every artifact on the Releases page has a corresponding .minisig signature file.
Public key:
RWQJue8SwPzZBZO8Up5ppAUqm0wM/gK5yjnam+Dbf7KbY0utkiO+7XCdVerify a downloaded binary:
minisign -Vm kraken-cli-aarch64-apple-darwin.tar.gz -P RWQJue8SwPzZBZO8Up5ppAUqm0wM/gK5yjnam+Dbf7KbY0utkiO+7XCdInstall minisign: brew install minisign (macOS) or apt install minisign (Linux).
Public market data requires no credentials:
kraken ticker BTCUSD -o json
kraken orderbook BTCUSD --count 10 -o json
kraken trades BTCUSD --count 20 -o json
kraken ohlc BTCUSD --interval 60 -o jsonWith authentication:
export KRAKEN_API_KEY="your-key"
export KRAKEN_API_SECRET="your-secret"
kraken balance -o json
kraken open-orders -o json
kraken order buy BTCUSD 0.001 --type limit --price 50000 -o jsonFor humans (table output, interactive setup):
kraken setup
kraken ticker BTCUSD
kraken balance
kraken shellAuthenticated commands (trading, balances, order management) require a Kraken API key pair. Public market data and paper trading work without credentials.
Spot (covers trading, balances, funding, earn, subaccounts): Settings > API on kraken.com. Full guide: How to create a spot API key.
Futures (only for kraken futures commands): Settings > Create Key on the Futures interface. Full guide: How to create a Futures API key.
Grant the minimum permissions your workflow needs. For read-only monitoring, "Query Funds" and "Query Open Orders & Trades" are sufficient.
export KRAKEN_API_KEY="your-key"
export KRAKEN_API_SECRET="your-secret"
export KRAKEN_FUTURES_API_KEY="your-futures-key" # optional
export KRAKEN_FUTURES_API_SECRET="your-futures-secret" # optionalStore credentials in ~/.config/kraken/config.toml:
[auth]
api_key = "your-api-key"
api_secret = "your-api-secret"
[settings]
default_pair = "BTCUSD"
output = "table"Or use the interactive wizard: kraken setup.
Highest precedence first:
--api-key, --api-secret)KRAKEN_API_KEY, KRAKEN_API_SECRET)~/.config/kraken/config.toml)0600 permissions (owner read/write only)--api-secret-stdin or --api-secret-file instead of --api-secret to avoid secrets in process listingsAdvanced: API endpoint overrides
| Variable | Default | Description |
|---|---|---|
KRAKEN_SPOT_URL |
https://api.kraken.com |
Spot REST API base URL |
KRAKEN_FUTURES_URL |
https://futures.kraken.com/derivatives/api/v3 |
Futures REST API base URL |
KRAKEN_WS_PUBLIC_URL |
wss://ws.kraken.com/v2 |
Public WebSocket endpoint |
KRAKEN_WS_AUTH_URL |
wss://ws-auth.kraken.com/v2 |
Authenticated Spot WebSocket endpoint |
KRAKEN_WS_L3_URL |
wss://ws-l3.kraken.com/v2 |
Level 3 order book WebSocket endpoint |
KRAKEN_FUTURES_WS_URL |
wss://futures.kraken.com/ws/v1 |
Futures WebSocket endpoint |
KRAKEN_FEEDBACK_ENDPOINT |
https://cli-feedback.kraken.com/v1/feedback |
Product feedback ingest URL (trusted hosts only; see docs/feedback-ingest.md) |
Resolution: CLI flag > environment variable > default. Only https:// and wss:// schemes are accepted.
kraken-cli includes a built-in Model Context Protocol server over stdio. No subprocess wrappers needed.
MCP tool calls run through the same command path as CLI commands and inherit the same error handling and rate-limit behavior.
[!WARNING] MCP is local-first and designed for your own machine. Any agent connected to this MCP server uses the same configured Kraken account and API key permissions. Do not expose, tunnel, or share this server outside systems you control. Always use
https://andwss://endpoints. Treat this integration as alpha and use least-privilege API keys.
kraken mcp # default: market, account, paper, workspace, feedback
kraken mcp -s all # all services, dangerous calls require acknowledged=true
kraken mcp -s all --allow-dangerous # all services, no per-call confirmation
kraken mcp -s market,trade,paper # specific servicesConfigure your MCP client (Claude Desktop, ChatGPT, Codex, Gemini CLI, Cursor, VS Code, Windsurf, etc.):
{
"mcpServers": {
"kraken": {
"coNo open issues yet, or sync has not completed.