loading…
Search for a command to run...
loading…
MCP server for WhiteBit cryptocurrency exchange API, enabling market data retrieval, order book access, and real-time WebSocket streams.
MCP server for WhiteBit cryptocurrency exchange API, enabling market data retrieval, order book access, and real-time WebSocket streams.
Message Control Protocol (MCP) server and client implementation for WhiteBit cryptocurrency exchange API. Built on top of aiowhitebit library and fastmcp.
# Install the package
pip install aiowhitebit-mcp
# Run the server (stdio transport for Claude Desktop)
aiowhitebit-mcp --transport stdio
# Or run with SSE transport
aiowhitebit-mcp --transport sse --host 127.0.0.1 --port 8000
import asyncio
import os
from aiowhitebit_mcp.client import WhiteBitMCPClient
async def main():
# Set the server URL (or use environment variable)
server_url = "http://localhost:8000/sse"
os.environ["WHITEBIT_MCP_URL"] = server_url
async with WhiteBitMCPClient() as client:
# Get market info
btc_usdt = await client.get_market_resource("BTC_USDT")
print("BTC/USDT Market Info:", btc_usdt)
# Get real-time price via WebSocket
price = await client.get_last_price("BTC_USDT")
print("Current BTC/USDT price:", price)
# Get order book
orderbook = await client.get_orderbook("BTC_USDT")
print("Order book:", orderbook)
# Get funding history for futures market
funding_history = await client.get_funding_history("BTC_USDT")
print("Funding history:", funding_history)
# Subscribe to BookTicker for real-time best bid/ask
subscription = await client.bookticker_subscribe("BTC_USDT")
print("BookTicker subscription:", subscription)
if __name__ == "__main__":
asyncio.run(main())
from aiowhitebit_mcp.server import create_server
import asyncio
# Create the server with custom configuration
server = create_server(
name="WhiteBit API"
)
# Run the server with desired transport
if __name__ == "__main__":
asyncio.run(
server.run(
transport="stdio", # or "sse"
host="127.0.0.1", # for network transports
port=8000 # for network transports
)
)
get_server_time(): Get current server timeget_market_info(): Get all markets informationget_orderbook(market: str): Get order bookget_recent_trades(market: str, limit: int = 100): Get recent tradesget_ticker(market: str): Get ticker informationget_fee(market: str): Get trading feesget_server_status(): Get server statusget_asset_status_list(): Get status of all assetsget_funding_history(market: str): Get funding rate history for futures marketsget_last_price(market: str): Get real-time priceget_market_depth(market: str): Get real-time order bookbookticker_subscribe(market: str): Subscribe to BookTicker stream for best bid/ask pricesbookticker_unsubscribe(market: str): Unsubscribe from BookTicker streamconnect_websocket(): Connect to WebSocket APIdisconnect_websocket(): Disconnect from WebSocket APIwhitebit://markets: Get all markets informationwhitebit://markets/{market}: Get specific market informationwhitebit://assets: Get all assets informationwhitebit://assets/{asset}: Get specific asset information# Show help
aiowhitebit-mcp --help
# Run with stdio transport (for Claude Desktop)
aiowhitebit-mcp --transport stdio
# Run with SSE transport
aiowhitebit-mcp --transport sse --host localhost --port 8000
# Clone the repository
git clone https://github.com/yourusername/aiowhitebit-mcp.git
cd aiowhitebit-mcp
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest
# Run type checking
pyright src/aiowhitebit_mcp
# Run linting
ruff check .
Check the examples/ directory for more usage examples:
claude_desktop_server.py: Run the server with stdio transport for Claude Desktopclaude_desktop_client.py: Client for connecting to a stdio serversse_server.py: Run the server with SSE transportsse_client.py: Client for connecting to an SSE serverApache License 2.0
Run in your terminal:
claude mcp add aiowhitebit-mcp -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.