sarrafa-mcp
v0.1.0
Published
MCP server for AI agents to interact with Binance — trading, transfers, and market data
Maintainers
Readme
sarrafa-mcp
MCP server for AI agents to interact with Binance -- trading, transfers, and market data.
Sarrafa (Arabic: صرّافة) means "exchange" or "money changer."
Quick Start
claude mcp add sarrafa-mcp -e BINANCE_API_KEY=your_key -e BINANCE_API_SECRET=your_secret -- npx -y sarrafa-mcpOr add manually to your MCP client configuration:
{
"mcpServers": {
"sarrafa-mcp": {
"command": "npx",
"args": ["-y", "sarrafa-mcp"],
"env": {
"BINANCE_API_KEY": "your_key",
"BINANCE_API_SECRET": "your_secret"
}
}
}
}Configuration
| Variable | Required | Description |
|----------|----------|-------------|
| BINANCE_API_KEY | Yes | Your Binance API key |
| BINANCE_API_SECRET | Yes | Your Binance API secret |
Available Tools
Account (Read)
| Tool | Description |
|------|-------------|
| get_account_info | Account balances, permissions, and commission rates |
| get_account_status | Account status (normal/locked) |
| get_api_permissions | Current API key permissions |
| get_trade_fee | Trading fee rates for symbol(s) |
Market Data (Read)
| Tool | Description |
|------|-------------|
| get_ticker_price | Latest price for one or all symbols |
| get_ticker_24hr | 24hr price change statistics |
| get_order_book | Order book depth (bids/asks) |
| get_klines | Candlestick/kline data |
| get_recent_trades | Recent trades for a symbol |
| get_exchange_info | Trading rules, symbol info, filters |
| get_avg_price | Current average price |
| get_book_ticker | Best bid/ask price and quantity |
Order Queries (Read)
| Tool | Description |
|------|-------------|
| get_order | Query a specific order |
| get_open_orders | All open orders |
| get_all_orders | All orders for a symbol |
| get_my_trades | Trade history for a symbol |
Asset Info (Read)
| Tool | Description |
|------|-------------|
| get_deposit_history | Deposit history |
| get_withdraw_history | Withdrawal history |
| get_asset_detail | Asset details (fees, limits) |
| get_all_coins_info | All coin network info |
Margin Account (Read)
| Tool | Description |
|------|-------------|
| get_margin_account | Cross margin account details |
| get_margin_all_assets | All margin assets |
| get_margin_all_pairs | All margin trading pairs |
| get_margin_price_index | Margin price index |
| get_isolated_margin_account | Isolated margin account info |
| get_margin_open_orders | Open margin orders |
| get_margin_all_orders | All margin orders for a symbol |
| get_margin_my_trades | Margin trade history |
Transfer Queries (Read)
| Tool | Description |
|------|-------------|
| get_transfer_history | Universal transfer history |
Spot Trading (Destructive)
| Tool | Description |
|------|-------------|
| place_order | Place a spot order (market, limit, stop-loss, etc.) |
| cancel_order | Cancel an active order |
| cancel_all_orders | Cancel all open orders for a symbol |
| cancel_replace_order | Atomically cancel and replace an order |
| place_oco_order | Place an OCO order |
| place_oto_order | Place an OTO order |
| place_otoco_order | Place an OTOCO order |
Margin Trading (Destructive)
| Tool | Description |
|------|-------------|
| margin_borrow | Borrow assets on margin |
| margin_repay | Repay margin loan |
| place_margin_order | Place a margin trade order |
| cancel_margin_order | Cancel a margin order |
| cancel_all_margin_orders | Cancel all open margin orders |
| isolated_margin_transfer | Transfer between spot and isolated margin |
Universal Transfer (Destructive)
| Tool | Description |
|------|-------------|
| universal_transfer | Transfer assets between any wallets |
Usage Examples
Check your portfolio:
"What's my current USDT balance?"
The agent calls get_account_info and returns your balances.
Place a market order:
"Buy 0.001 BTC at market price"
The agent calls place_order with { symbol: "BTCUSDT", side: "BUY", type: "MARKET", quantity: 0.001 }. You'll see a confirmation prompt before execution.
Transfer between wallets:
"Move 500 USDT from my spot wallet to margin"
The agent calls universal_transfer with { type: "MAIN_MARGIN", asset: "USDT", amount: 500 }.
Security
- API keys are passed via environment variables and never logged or stored
- All trading and transfer operations are marked as destructive in MCP annotations, which triggers a confirmation prompt in Claude before execution
- No withdrawal support is included -- only trading and transfers between your own wallets
- This server connects to production Binance API only
Development
# Install dependencies
bun install
# Run in development
bun run dev
# Run tests
bun test
# Build for publishing
bun run buildLicense
MIT
