asterdex-mcp
Model Context Protocol (MCP) server for Aster DEX — a Binance-compatible perpetual futures DEX on-chain.
Features
- Account — balance, positions, open orders
- Trading — place/cancel/modify orders (market, limit, stop, TP/SL)
- Market Data — klines/OHLCV, 24h ticker, orderbook, exchange info
- Analysis — RSI, MACD, Stochastic, EMA, Bollinger Bands, signals
- Auth — EIP-712 typed data signing (delegation model)
Quick Start
# Using uvx (recommended — no install needed)
uvx asterdex-mcp
# Or install globally
pip install asterdex-mcp
Wallet Setup Guide
Aster DEX uses a delegation model with two wallets:
| Wallet | What it is | Purpose |
|---|---|---|
| Main Wallet | Your primary wallet (e.g. MetaMask) | Holds funds, manages API permissions |
| Agent Wallet | A separate wallet for automation | Signs trades on your behalf |
Step 1: Create an Agent Wallet
Generate a new Ethereum-compatible wallet for the agent. This wallet will sign transactions but never holds funds.
# Using ethers.js / viem / any wallet generator
# Or use this quick Python snippet:
python3 -c "
from eth_account import Account
acct = Account.create()
print(f'Address: {acct.address}')
print(f'Private Key: {acct.key.hex()}')
"
Save the output — you'll need both the address and private key.
Step 2: Set Up API Access on Aster
- Go to Aster DEX and connect your main wallet
- Navigate to Settings → API Management
- Click Create API Key
- Enter your agent wallet address when prompted
- Important: Enable the following permissions:
- ✅ Perps Trading (required for placing orders)
- ✅ Enable IP restriction (recommended for security)
- Whitelist your server/agent IP address
- Confirm and sign the transaction from your main wallet
Step 3: Get Your Credentials
You need three values:
ASTER_WALLET=0x... # Your main wallet address (the one on Aster)
ASTER_SIGNER=0x... # Your agent wallet address (from Step 1)
ASTER_PRIVATE_KEY=0x... # Your agent wallet private key (from Step 1)
⚠️ Never share your private key. The agent wallet should have NO funds — it only signs messages.
Step 4: Install & Configure
Claude Code
# Add the MCP server
claude mcp add asterdex -- uvx asterdex-mcp \
-e ASTER_PRIVATE_KEY=0xYOUR_AGENT_PRIVATE_KEY \
-e ASTER_WALLET=0xYOUR_MAIN_WALLET_ADDRESS \
-e ASTER_SIGNER=0xYOUR_AGENT_WALLET_ADDRESS
Verify with:
claude mcp list
OpenClaw
Add to your OpenClaw MCP config (~/.openclaw/mcp.json or project-level):
{
"mcpServers": {
"asterdex": {
"command": "uvx",
"args": ["asterdex-mcp"],
"env": {
"ASTER_PRIVATE_KEY": "0xYOUR_AGENT_PRIVATE_KEY",
"ASTER_WALLET": "0xYOUR_MAIN_WALLET_ADDRESS",
"ASTER_SIGNER": "0xYOUR_AGENT_WALLET_ADDRESS"
}
}
}
}
Hermes Agent
Add to ~/.hermes/config.yaml under mcp_servers:
mcp_servers:
asterdex:
command: uvx
args:
- asterdex-mcp
env:
ASTER_PRIVATE_KEY: '0xYOUR_AGENT_PRIVATE_KEY'
ASTER_WALLET: '0xYOUR_MAIN_WALLET_ADDRESS'
ASTER_SIGNER: '0xYOUR_AGENT_WALLET_ADDRESS'
enabled: true
timeout: 30
Then restart: hermes gateway restart
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"asterdex": {
"command": "uvx",
"args": ["asterdex-mcp"],
"env": {
"ASTER_PRIVATE_KEY": "0xYOUR_AGENT_PRIVATE_KEY",
"ASTER_WALLET": "0xYOUR_MAIN_WALLET_ADDRESS",
"ASTER_SIGNER": "0xYOUR_AGENT_WALLET_ADDRESS"
}
}
}
}
Cursor
Add to .cursor/mcp.json in your project root (or ~/.cursor/mcp.json globally):
{
"mcpServers": {
"asterdex": {
"command": "uvx",
"args": ["asterdex-mcp"],
"env": {
"ASTER_PRIVATE_KEY": "0xYOUR_AGENT_PRIVATE_KEY",
"ASTER_WALLET": "0xYOUR_MAIN_WALLET_ADDRESS",
"ASTER_SIGNER": "0xYOUR_AGENT_WALLET_ADDRESS"
}
}
}
}
Step 5: Verify
Ask your AI agent to run get_balance — if it returns your USDT balance, you're good to go.
Tools
| Tool | Description |
|---|---|
get_balance |
Account balance and margin summary |
get_positions |
Open positions with PnL |
get_open_orders |
Pending orders (optional symbol filter) |
place_order |
Place market/limit/stop/TP/SL orders |
cancel_order |
Cancel order by ID |
cancel_all_orders |
Bulk cancel all open orders |
set_leverage |
Set leverage per trading pair |
get_exchange_info |
Pairs, precision, leverage limits |
Examples
See examples.md for natural language prompting examples — account, analysis, trading, and combined workflows.
How Auth Works
Aster DEX uses EIP-712 typed data signing (same as Hyperliquid). Instead of API keys with HMAC:
- Your agent wallet signs each request with EIP-712
- Aster verifies the signature against the signer address you registered
- The main wallet is included in the signed data so Aster knows whose account to act on
This means:
- No API key/secret pairs to manage
- Agent wallet can't steal funds (it has none)
- You can revoke access anytime from Aster's API settings
Tech Stack
- Python 3.11+
mcp— MCP Python SDKkairos-aster-sdk— Aster DEX API client
License
MIT
Metadata
Release files for asterdex-mcp 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asterdex_mcp-0.3.0.tar.gz | 23.9 kB | Without provenance | Details for asterdex_mcp-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asterdex_mcp-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for asterdex_mcp-0.3.0-py3-none-any.whl |
Total release size: 53.7 kB
Release files / asterdex_mcp-0.3.0.tar.gz
| Download URL | asterdex_mcp-0.3.0.tar.gz |
|---|---|
| Size | 23.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d2d9631fc4a370cd6bbc170454905be3f86d1ef7bc7850932979d3929d34c88
|
|
BLAKE2b-256 checksum How to use checksums |
c3ef32c4582ebad2d27c5e3e20c2beef182fe52be64f2770b256c9a8fe427acc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / asterdex_mcp-0.3.0-py3-none-any.whl
| Download URL | asterdex_mcp-0.3.0-py3-none-any.whl |
|---|---|
| Size | 29.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56323d3a9b8569a67ac682da655f358638971380ad5cda12beb3379e020cc345
|
|
BLAKE2b-256 checksum How to use checksums |
108e2fac2794cf4b6f0fe64a6a5545e369afe5ae4e5a0a44959621047099d6a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for asterdex-mcp 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.