TB

tienan92it/binance-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

21 stars 4 forks 品質 52 トレンド 0MIT

バイナリの暗号化交換データを大きな言語モデル(LLM)エージェントに公開するモデルコンテキストプロトコル(MCP)サーバー.

概要

バイナリの暗号化交換データを大きな言語モデル(LLM)エージェントに公開するモデルコンテキストプロトコル(MCP)サーバー。 このサーバーでは、LLM は、Binance から標準インターフェイスを介してリアルタイムおよび歴史的な市場データにアクセスすることができます。 - : Binance上の任意の取引ペアの現在の価格を取得する - : 異なる価格レベルで買い/売りの利益を示す注文書のスナップショットを取得する - : フェッチOHLCV(オープン、ハイ、ロー、クローズ、ボリューム)任意の時間枠のための燭台データ - : リアルタイムの取引、入札を購読し、WebSocketを介して書籍の更新を注文 - : アクセス取引、24時間統計、集計取引、転がり窓データ、およびその他 - : アクセス取引ルール、シンボル情報、および取引手数料は、すべてのクライアントに必要とされます - LMは - LMは、すべてのクライアントのキー - LMは - LMは、すべてのクライアントが必要です。 - Python 3.

概要(AI 翻訳)

バイナリの暗号化交換データを大きな言語モデル(LLM)エージェントに公開するモデルコンテキストプロトコル(MCP)サーバー。 このサーバーでは、LLM は、Binance から標準インターフェイスを介してリアルタイムおよび歴史的な市場データにアクセスすることができます。

##特徴

-ライブ価格データ:バイナンス上の任意の取引ペアの現在の価格を取得する

  • オーダーブックアクセス:異なる価格レベルの買い/売り利息を示すオーダーブックスナップショットを取得する
  • 歴史的価格データ: 任意の時間枠のためのHidetch OHLCV (Open, High, Close, Volume)燭台データ
  • リアルタイムWebSocket Streams:WebSocketを介してリアルタイム取引、ティッカー、注文ブックの更新を購読
  • 包括的な市場データ:アクセス取引、24時間統計、集計取引、ロールウィンドウデータなど
  • 交換情報: 取引ルール、シンボル情報、料金体系へのアクセス
  • 読み取り専用操作: すべてのデータは、Binance の公開 REST API 経由で取得されます(API キーは必要ありません)。 -MCP標準準拠: あらゆるMCP対応LMクライアントに対応

要件

  • Python 3.8+
  • [mcp] CLIツールでパッケージ ([mcp[cli])
  • [requests REST API ライブラリ
  • [websockets WebSocketストリームのライブラリ

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Binance MCP Server

A Model Context Protocol (MCP) server that exposes Binance cryptocurrency exchange data to Large Language Model (LLM) agents. This server allows LLMs to access real-time and historical market data from Binance through a standardized interface.

Features

  • Live Price Data: Get current prices for any trading pair on Binance
  • Order Book Access: Retrieve order book snapshots showing buy/sell interest at different price levels
  • Historical Price Data: Fetch OHLCV (Open, High, Low, Close, Volume) candlestick data for any timeframe
  • Real-time WebSocket Streams: Subscribe to real-time trade, ticker, and order book updates via WebSockets
  • Comprehensive Market Data: Access trades, 24hr statistics, aggregate trades, rolling window data, and more
  • Exchange Information: Access trading rules, symbol information, and fee structures
  • Read-only Operation: All data is fetched via Binance’s public REST API (no API keys required)
  • MCP Standard Compliant: Works with any MCP-compatible LLM client

Requirements

  • Python 3.8+
  • mcp package with CLI tools (mcp[cli])
  • requests library for REST API
  • websockets library for WebSocket streams
  • uvicorn for serving (optional)

Installation

  1. Clone this repository:
git clone https://github.com/yourusername/binance_mcp_server.git
cd binance_mcp_server
  1. Install dependencies:
pip install -r requirements.txt

Usage

Running the Server Directly

To run the server in standalone mode:

python run_server.py

This will start the MCP server, which will listen for connections via STDIO.

Development Mode with MCP Inspector

For development and testing, use the MCP Inspector:

mcp dev run_server.py

This opens the MCP Inspector interface where you can test the server’s tools interactively.

Installing in Claude Desktop

To use this server with Claude Desktop:

  1. Install the MCP CLI tools if you haven’t already:
pip install "mcp[cli]"
  1. Install the server in Claude Desktop:
mcp install run_server.py
  1. You can now access Binance data directly within your Claude Desktop conversations.

Example Client

An example client script is provided to demonstrate programmatic usage:

python example_client.py

This script connects to the server and retrieves various types of market data.

Available Tools

Connectivity and Basic Info

  • ping_binance(): Test connectivity to the Binance API server

    • Example: ping_binance()
  • get_server_time(): Get the current server time from Binance

    • Example: get_server_time()

Market Data

  • get_price(symbol): Get the current price for a trading pair

    • Example: get_price(symbol="BTCUSDT")
  • get_order_book(symbol, depth=10): Get the current order book

    • Example: get_order_book(symbol="ETHUSDT", depth=5)
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →