Getting Started¶
Install the Python module
python3 -m pip install python-kraken-sdk
Register at Kraken and generate API Keys
Spot Trading: https://pro.kraken.com/app/settings/api
Futures Trading: https://futures.kraken.com/trade/settings/api
Futures Sandbox: https://demo-futures.kraken.com/settings/api
Start using the provided example scripts
Examples can be found within the repository of the python-kraken-sdk and obviously in this documentation. See the Usage Examples section for basic usage examples and Trading Bot Templates to get impressed by orderbook clients, as well as boilerplates for trading bots using the SDK.
MCP Server
The python-kraken-sdk also ships an MCP server exposing the Spot (incl.
xStocks – pass "asset_class": "tokenized_asset" inside params where
the Kraken API docs require it) and Futures request methods as two tools,
spot_request and futures_request.
1uv tool install "python-kraken-sdk[mcp]"
2
3# e.g. Claude setup:
4claude mcp add kraken --scope user -- kraken-mcp
Credentials are never tool arguments. Configure them as environment
variables instead: KRAKEN_SPOT_API_KEY / KRAKEN_SPOT_SECRET_KEY,
KRAKEN_FUTURES_API_KEY / KRAKEN_FUTURES_SECRET_KEY, and optionally
KRAKEN_FUTURES_SANDBOX=1 to target the Futures demo environment. Example
client for Claude Code configuration:
1{
2 "mcpServers": {
3 "kraken": {
4 "command": "kraken-mcp",
5 "env": {
6 // Only public endpoints are available without credentials
7 "KRAKEN_SPOT_API_KEY": "<your-api-key>",
8 "KRAKEN_SPOT_SECRET_KEY": "<your-secret-key>"
9 }
10 }
11 }
12}
Error handling
If any unexpected behavior occurs, please check your API permissions, rate limits, update the python-kraken-sdk, see the 💡 Troubleshooting section, and if the error persists please open an issue at python-kraken-sdk/issues.