What This Lets You Do
Kraken CLI is an open-source tool that exposes Kraken’s full trading API — spot, futures, xStocks, and forex — as a Model Context Protocol server. Connect it to Claude Code and you can ask the agent to pull quotes, check open positions, and place orders in plain language with no custom API wrapper, no HMAC signing, and no nonce management. It ships a local paper trading engine that runs against live market data, so you can test strategies before touching real funds.
This is the same pattern as Robinhood, Gemini, Coinbase, and Revolut X — but Kraken CLI is open-source, runs locally, and covers a wider asset class list than most retail broker integrations. If you are already on Kraken for futures or xStocks (tokenized equities), this is the fastest path to agent-assisted trading on that account.
How Kraken CLI MCP Works
Kraken launched CLI in March 2026 under an MIT license. It is built in Rust, has 151 commands, and exposes those commands as MCP tools via a single kraken mcp subprocess. When you start the MCP server and register it with Claude Code or Claude Desktop, the model can call any of those commands the same way it calls a function — structured input, structured output, no shell parsing.
| Layer | What it does |
|---|---|
| Kraken CLI binary | Handles auth, HMAC signing, nonce, and REST/WebSocket calls to Kraken |
kraken mcp server | Translates CLI commands into MCP tool definitions any AI client can call |
| Claude Code | Selects and calls the right tool based on your prompt |
| Paper trading engine | Local mock exchange that fills against live Kraken prices, no real funds |
The paper trading engine is the most useful part for bot builders. It is built in, not bolted on, so the same commands that send real orders in live mode write to the local paper book in paper mode. Switch between them with a flag at server start.
Prerequisites
- A Kraken account (spot trading; futures or xStocks require Kraken Pro)
- Claude Code or Claude Desktop installed
- Rust toolchain (
rustup) or a pre-built binary from Kraken’s GitHub releases page - Node.js 18+ (only needed if you build from source with the npm wrapper)
Step 1: Install Kraken CLI
The fastest path is the pre-built binary. Grab the latest release for your platform from Kraken’s GitHub (krakenfx/kraken-cli), move it onto your $PATH, and confirm it works:
kraken --version
If you prefer building from source:
cargo install kraken-cli
Either way, run kraken --help to see the full command list. You will see subcommands for spot, futures, account, paper, earn, and mcp among others.
Step 2: Generate API Keys
You need a Kraken API key with the minimum permissions for what you plan the agent to do. Go to Kraken.com → Settings → API → Create API Key and select:
| Permission | When you need it |
|---|---|
| Query Funds | Always — the agent needs to read your balance |
| Query Open Orders & Trades | Always |
| Create & Modify Orders | Only when you want live order placement |
| Cancel/Close Orders | Only with order placement |
| Export Data | Not needed for trading |
| Withdraw Funds | Do not grant this to an agent key |
Keep the withdrawal permission off. There is no scenario in which your trading bot needs to withdraw funds.
Store the key and secret somewhere your shell can read them:
export KRAKEN_API_KEY=your-api-key
export KRAKEN_API_SECRET=your-api-secret
Add those to your shell profile or a .env file that your terminal loads. Kraken CLI reads them automatically.
Step 3: Start the MCP Server in Paper Mode
Before you connect Claude, run the server in paper mode so nothing can touch your live account while you verify the setup:
kraken mcp -s market,account,paper
The -s flag specifies which command scopes to expose as MCP tools. market gives the agent read access to prices and order books. account gives it read access to your balances and open positions. paper exposes the local paper trading engine. Omit orders from this command — add it later only when you are ready to go live.
You should see output like:
Kraken MCP server listening on stdio
Scopes: market, account, paper
Paper trading engine: active (live prices)
Step 4: Register the Server in Claude Code
Add the server to your Claude Code MCP config (~/.claude/.mcp.json or the project-level .mcp.json):
{
"mcpServers": {
"kraken": {
"command": "kraken",
"args": ["mcp", "-s", "market,account,paper"]
}
}
}
Restart Claude Code. Run /mcp to confirm the Kraken server shows as connected and lists its available tools. You should see tools named things like spot_get_ticker, account_get_balances, paper_place_order.
For Claude Desktop, the config lives at ~/Library/Application Support/Claude/claude_desktop_config.json on Mac — add the same mcpServers block.
Step 5: Test the Connection With a Read-Only Prompt
Before asking the agent to trade, confirm the wiring with something that only reads data:
What is the current BTC/USD price on Kraken, and what is my account balance?
Claude should call spot_get_ticker and account_get_balances and return the values. If it does, the connection is working. If it hallucinates a price rather than calling the tool, check that the MCP server process is still running and that the tool names appear in /mcp.
Step 6: Place a Paper Trade
Ask the agent to execute a trade in the paper engine:
Buy $100 of ETH at market in paper mode and show me the fill.
Claude calls paper_place_order with the right parameters, the local paper engine fills it against the live Kraken order book price, and the result comes back as a structured object — symbol, side, size, fill price, timestamp. Check paper_get_open_positions to see the position sitting in your paper account.
This is worth spending 15 minutes on before you switch to live. Watch exactly what Claude sends to the tool: what size it calculates, whether it respects your stated dollar amount, whether it rounds lot sizes correctly. Any habit the agent has in paper carries over to live.
Step 7: Go Live (When You Are Ready)
Restart the MCP server with the orders scope added:
kraken mcp -s market,account,orders
Update your MCP config to match. Paper mode is off by default when orders is active — the agent now sends real orders. Start with a small test: a market buy for the minimum lot size on a liquid pair like BTC/USD, then confirm it appears in your Kraken order history.
Set a daily notional limit using Kraken’s API key settings (under the key’s restrictions) so the agent cannot spend more than a fixed amount per day even if something goes wrong in a long-running session.
Useful Starting Prompts
Once the server is running, Claude can work across the full scope you opened:
Show me the current bid/ask spread for ETH/USD and XRP/USD and tell me which is tighter.
I want to DCA $50 into BTC weekly. Draft the order logic and paper trade it for the next 3 signals before I go live.
Check my open futures positions and tell me if any are close to liquidation at the current price.
Set a limit order to buy 0.01 BTC if the price drops to $95,000.
The agent handles the HMAC signing, nonce, and lot-size rounding that would otherwise require 50 lines of boilerplate. You write a prompt; it writes the call.
Paper vs Live Mode Comparison
| Behavior | Paper mode | Live mode |
|---|---|---|
| Order fills | Against live Kraken prices, locally | Real Kraken order book |
| Funds at risk | None | Your Kraken balance |
| Scope flag | market,account,paper | market,account,orders |
| Order history | Local only | Appears in Kraken UI |
| API key needed | Yes (for market data) | Yes (with order permissions) |
Run paper mode until you have seen the agent correctly size at least a dozen orders across different market conditions. The muscle memory of reading agent outputs carefully pays off once real money is involved.
What Kraken CLI Does Not Cover
A few things worth knowing before you scale up:
- Withdrawals are exposed as a CLI command but intentionally not included in the default MCP scopes. Do not add them.
- xStocks and forex require a Kraken Pro account and are only available in the
futuresandforexCLI scopes, which you add to-sexplicitly. - WebSocket streaming works in the CLI but the MCP server wraps it as a polling tool — the agent does not receive real-time push events, it pulls on each call.
For a broader look at which exchange MCP servers exist and how they compare, see the MCP servers for AI trading guide. For a simpler no-code agent setup on a US retail broker, start with the Robinhood agentic trading guide or the Gemini agentic trading guide.