MCP Bitget Trading Server
Uses .ENV files for secure configuration management of API credentials and environment settings
Version control system used for source code management and development workflow
Hosted on GitHub for source code repository, issue tracking, and community collaboration
Built on Node.js runtime environment for server execution and JavaScript functionality
Uses npm package manager for dependency management and project scripts
Uses Shields.io badges to display project status, version information, and technology stack in documentation
Fully typed implementation using TypeScript for comprehensive type safety and development experience
Supports Yarn as an alternative package manager for dependency installation
Implements Zod schemas for comprehensive input validation and type checking of all API parameters
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Bitget Trading Server what's the current price of Bitcoin in USDT?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
š MCP Bitget Trading Server
MCP (Model Context Protocol) server for Bitget cryptocurrency exchange. Enables AI assistants to interact with Bitget API for spot & futures trading. Features real-time market data, order management, account balances, leverage control, and position tracking. Supports demo trading with paper trading mode.
⨠Features
š Market Data
Real-time Prices - Get current market prices for any trading pair
Full Tickers - Complete ticker information with 24h statistics
Order Book - Market depth data with configurable depth levels
Historical Candles - OHLCV data for technical analysis
š° Account Management
Balance Information - Real-time account balances for all assets
Position Tracking - Monitor current futures positions
Margin Information - Futures margin account details
Order Management - View and manage open orders
šÆ Trading Operations
Place Orders - Execute market and limit orders
Cancel Orders - Cancel existing orders by ID
Leverage Control - Set leverage for futures positions (1-125x)
Demo Trading - Full support for paper trading mode
ā” Technical Features
TypeScript - Fully typed implementation
v2 API Support - Latest Bitget API integration
Rate Limiting - Built-in protection against API limits
Error Handling - Comprehensive error management
Zod Validation - Input validation for all parameters
Related MCP server: bybit-mcp-server
š ļø Installation
Prerequisites
Node.js 18+
npm or yarn
Bitget API credentials (for live/demo trading)
Quick Start
Clone the repository
git clone https://github.com/gagarinyury/MCP-bitget-trading.git
cd MCP-bitget-tradingInstall dependencies
npm installConfigure environment
cp .env.example .env
# Edit .env with your Bitget API credentialsBuild the project
npm run buildStart the server
npm startš§ Configuration
Environment Variables
Create a .env file in the root directory:
# Bitget API Configuration
BITGET_API_KEY=your_api_key_here
BITGET_SECRET_KEY=your_secret_key_here
BITGET_PASSPHRASE=your_passphrase_here
# Environment settings
BITGET_SANDBOX=true # Set to true for demo trading
BITGET_BASE_URL=https://api.bitget.com
BITGET_WS_URL=wss://wspap.bitget.com/v2/ws/public
# Optional settings
LOG_LEVEL=info
RATE_LIMIT_REQUESTS_PER_SECOND=10Claude Desktop Integration
Add to your Claude Desktop MCP settings (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"bitget-trading": {
"command": "node",
"args": ["/path/to/MCP-bitget-trading/dist/server.js"],
"env": {
"BITGET_API_KEY": "your_key",
"BITGET_SECRET_KEY": "your_secret",
"BITGET_PASSPHRASE": "your_passphrase",
"BITGET_SANDBOX": "true"
}
}
}
}š Available Tools
Market Data Tools
Tool | Description | Parameters |
| Get current price |
|
| Get full ticker info |
|
| Get order book |
|
| Get OHLCV data |
|
Account Tools
Tool | Description | Parameters |
| Get account balance |
|
| Get futures positions |
|
| Get margin info |
|
| Get open orders |
|
Trading Tools
Tool | Description | Parameters |
| Place new order |
|
| Cancel order |
|
| Set leverage |
|
š® Usage Examples
Basic Price Check
// Get current Bitcoin price
await getPrice({ symbol: "BTCUSDT" })
// Get futures price
await getPrice({ symbol: "BTCUSDT_UMCBL" })Trading Operations
// Place a limit buy order
await placeOrder({
symbol: "BTCUSDT",
side: "buy",
type: "limit",
quantity: "0.001",
price: "50000"
})
// Set leverage for futures
await setLeverage({
symbol: "BTCUSDT_UMCBL",
leverage: 10
})Account Information
// Check balance
await getBalance({ asset: "USDT" })
// Get all positions
await getPositions({})šļø Development
Scripts
npm run dev # Development with hot reload
npm run build # Production build
npm run test # Run tests
npm run lint # Lint code
npm run format # Format codeProject Structure
src/
āāā api/
ā āāā rest-client.ts # Bitget REST API client
āāā types/
ā āāā bitget.ts # Bitget API types
ā āāā mcp.ts # MCP schema definitions
āāā server.ts # Main MCP serverš Symbol Formats
Spot Trading
Format:
BTCUSDT,ETHUSDT,ADAUSDTNo suffix required
Futures Trading
Format:
BTCUSDT_UMCBL,ETHUSDT_UMCBL_UMCBLsuffix for USDT-margined contracts
š Security
API Keys: Store in environment variables, never commit to code
Demo Mode: Use
BITGET_SANDBOX=truefor paper tradingRate Limiting: Built-in protection (10 requests/second default)
Validation: All inputs validated with Zod schemas
š Troubleshooting
Common Issues
Error 40009 - Sign signature error
Check API key configuration
Ensure timestamp is synchronized
Error 40099 - Exchange environment incorrect
Verify demo/live mode settings
Check
paptradingheader for demo mode
Error 400172 - Parameter verification failed
Check required parameters
Verify symbol format
š¤ Contributing
Fork the repository
Create feature branch (
git checkout -b feature/amazing-feature)Commit changes (
git commit -m 'Add amazing feature')Push to branch (
git push origin feature/amazing-feature)Open Pull Request
š License
MIT License - see LICENSE file for details
ā ļø Disclaimer
This software is for educational and development purposes. Use at your own risk. Always test in demo mode before live trading. The authors are not responsible for any financial losses.
š Resources
š Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Made with ā¤ļø for the crypto trading community
Available Tools
17 toolscancelOrderC
Cancel an existing order
Inputs: orderId (required), symbol (required).
connectWebSocketB
Connect to WebSocket for real-time data
Inputs: no named parameters.
disconnectWebSocketB
Disconnect from WebSocket
Inputs: no named parameters.
getBalanceC
Get account balance information
Inputs: asset.
getCandlesC
Get historical candlestick/OHLCV data
Inputs: symbol (required), interval (required), limit.
getMarginInfoC
Get margin account information
Inputs: symbol.
getOrderBookC
Get order book (market depth) for a trading pair
Inputs: symbol (required), depth.
getOrdersC
Get current open orders
Inputs: symbol, status.
getPositionsC
Get current futures positions
Inputs: symbol.
getPriceB
Get current price for a trading pair (spot or futures)
Inputs: symbol (required).
getTickerB
Get full ticker information for a trading pair
Inputs: symbol (required).
getWebSocketStatusB
Get WebSocket connection status
Inputs: no named parameters.
placeOrderC
Place a new buy or sell order (automatically detects spot vs futures)
Inputs: symbol (required), side (required), type (required), quantity (required), +6 more.
setLeverageC
Set leverage for futures trading
Inputs: symbol (required), leverage (required).
subscribeToOrderBookC
Subscribe to real-time order book updates
Inputs: symbol (required), instType.
subscribeToTickerC
Subscribe to real-time ticker updates
Inputs: symbol (required), instType.
unsubscribeFromChannelC
Unsubscribe from a WebSocket channel
Inputs: channel (required), symbol (required), instType.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 17 tools
Each tool has a distinct purpose with clear boundaries: order management (cancelOrder, placeOrder, getOrders), account data (getBalance, getMarginInfo, getPositions), market data (getCandles, getOrderBook, getPrice, getTicker), and WebSocket operations (connectWebSocket, disconnectWebSocket, subscribeToOrderBook, subscribeToTicker, unsubscribeFromChannel, getWebSocketStatus). There is no overlap or ambiguity between tools.
All tool names follow a consistent camelCase verbNoun pattern (e.g., cancelOrder, getBalance, subscribeToOrderBook). The naming is uniform across the entire set, making it predictable and easy to understand.
With 17 tools, the count is well-suited for a trading server covering order execution, account management, market data, and real-time WebSocket functionality. Each tool serves a specific and necessary role without redundancy, fitting within the typical 3-15 range for such a domain.
The tool set provides comprehensive coverage for cryptocurrency trading: full CRUD for orders (place, cancel, get), account data (balance, margin, positions), market data (historical and real-time via WebSocket), and futures-specific operations (leverage setting). There are no obvious gaps, enabling agents to handle complete trading workflows.
Maintenance
Related MCP Connectors
Live crypto + IDX stock market intelligence for AI agents ā 19 tools, no API key.
Free crypto-futures paper trading and live market data for AI agents. 29 tools; no key for data.
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
Trade Papertrade BTC and ETH perps from Claude, ChatGPT, Codex, Cursor and any MCP client.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables cryptocurrency trading on Bybit exchange through comprehensive market data access, account management, and automated trading operations. Features smart position validation, trailing stop losses, and risk management tools with demo mode support for safe testing.21MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with the Bybit cryptocurrency exchange via the V5 API, supporting market data, trading, and account management with both local and remote OAuth-authenticated connections.281MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLM agents to access BingX cryptocurrency exchange market data and execute trades through the official API, with support for account management, order creation, and technical indicators.-
- AlicenseCqualityDmaintenanceEnables LLMs to interact with Bybit V5 API for market data, trading, account management, and position tracking.931 npmMIT