Skip to main content
Glama
qeinfinity

Binance MCP Server

by qeinfinity
README.md
# Binance MCP Server

A Model Context Protocol (MCP) server implementation for Binance market data with WebSocket support.

## Features

- Real-time market data streaming via WebSocket
- Support for both spot and futures markets
- Automatic reconnection with exponential backoff
- Type-safe message handling
- Comprehensive error handling

## Installation

```bash
npm install
```

## Usage

### Starting the Server

```bash
npm start
```

### WebSocket Stream Types

The following stream types are supported:

- `trade`: Real-time trade data
- `ticker`: 24-hour rolling window price change statistics
- `bookTicker`: Best bid/ask price and quantity
- `kline`: Candlestick data
- `markPrice`: Mark price and funding rate (futures only)
- `fundingRate`: Funding rate data (futures only)

### Example Usage in Claude Desktop

```typescript
// Subscribe to trade and ticker streams for BTC/USDT
await server.subscribe('BTCUSDT', 'spot', ['trade', 'ticker']);

// Handle incoming data
server.onStreamData('BTCUSDT', 'trade', (data) => {
  console.log('New trade:', data);
});
```

## Development

### Running Tests

```bash
npm test
```

### Building

```bash
npm run build
```

## License

Private

TDQS

C2.8/5.0

Scored across 6 tools

Disambiguation4/5

Most tools have distinct purposes, with clear separation between historical data (get_klines), current data (get_market_data, get_futures_funding_rate, get_futures_open_interest), real-time updates (subscribe_market_data), and testing (test_futures_endpoints). However, get_market_data might overlap with the more specific futures tools in scope, causing minor ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case, such as get_futures_funding_rate, subscribe_market_data, and test_futures_endpoints. This predictability makes it easy for agents to understand and use the tools without confusion.

Tool Count4/5

With 6 tools, the count is reasonable for a Binance market data server, covering key areas like historical and real-time data, futures metrics, and testing. It's slightly lean but functional, as it could benefit from more tools for broader market coverage (e.g., spot trading or account management).

Completeness3/5

The tools provide good coverage for market data retrieval and futures-specific metrics, but there are notable gaps. For a Binance server, missing operations like placing trades, managing orders, or accessing account information limit its completeness, as agents cannot perform full trading workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues