This MCP Server provides comprehensive integration with Binance's spot and futures trading operations, allowing you to execute trades, monitor account balances, manage orders, and access various futures trading features through a simple API interface.
The easiest way to install the Binance Trading Server for Claude Desktop is via Smithery:
npx -y @smithery/cli install mcp-server-cex-bn --client claude
If you prefer to install manually:
pnpm install
.env
filepnpm build
pnpm start
Before using the server, you need to securely store your Binance API credentials:
await configureBinanceApiKeys({
apiKey: 'your-api-key',
apiSecret: 'your-api-secret'
});
You can create LIMIT or MARKET orders:
// LIMIT order
await createSpotOrder({
symbol: 'BTCUSDT',
side: 'BUY',
type: 'LIMIT',
quantity: '0.001',
price: '40000'
});
// MARKET order
await createSpotOrder({
symbol: 'BTCUSDT',
side: 'BUY',
type: 'MARKET',
quantity: '0.001'
});
To cancel an existing order:
await cancelOrder({
symbol: 'BTCUSDT',
orderId: '12345678'
});
View your account balances:
const balances = await getBalances();
// Returns: { BTC: '0.1', USDT: '1000', ... }
List all your open orders:
const orders = await getOpenOrders({
symbol: 'BTCUSDT' // Optional: specify symbol
});
Create various types of futures orders:
// LIMIT order
await createFuturesOrder({
symbol: 'BTCUSDT',
side: 'BUY',
type: 'LIMIT',
quantity: '0.001',
price: '40000',
timeInForce: 'GTC'
});
// STOP MARKET order
await createFuturesOrder({
symbol: 'BTCUSDT',
side: 'SELL',
type: 'STOP_MARKET',
quantity: '0.001',
stopPrice: '38000'
});
// TRAILING STOP order
await createFuturesOrder({
symbol: 'BTCUSDT',
side: 'SELL',
type: 'TRAILING_STOP_MARKET',
quantity: '0.001',
callbackRate: '1.0' // 1% callback rate
});
Adjust leverage for a trading pair:
await setFuturesLeverage({
symbol: 'BTCUSDT',
leverage: 10 // 1-125x
});
Get all open futures positions:
const positions = await getFuturesPositions();
Get detailed futures account information:
const account = await getFuturesAccount();
Check the funding rate for a futures symbol:
const fundingRate = await getFundingRate({
symbol: 'BTCUSDT'
});
Cancel an existing futures order:
await cancelFuturesOrder({
symbol: 'BTCUSDT',
orderId: '12345678'
});
The server supports two position modes:
You can choose between:
Perpetual futures contracts use funding rates to keep futures prices aligned with spot prices:
It's important to implement proper error handling:
try {
await createFuturesOrder({
symbol: 'BTCUSDT',
side: 'BUY',
type: 'LIMIT',
quantity: '0.001',
price: '40000',
timeInForce: 'GTC'
});
} catch (error) {
if (error instanceof InsufficientMarginError) {
console.error('Insufficient margin available');
} else if (error instanceof InvalidPositionModeError) {
console.error('Invalid position mode');
} else if (error instanceof OrderValidationError) {
console.error('Invalid order parameters');
}
}
Be aware of Binance's API rate limits:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.