mcpField
B
bitget

bitget

github.com/bitget-aiOther23362 installsUpdated 17w ago
Repository

About bitget

bitget is a skill for operating Bitget through the bgc CLI. It covers market data, trading, and account services, with guidance for confirming write actions and handling trading safely.

Key features

  1. 01Call Bitget through the bgc CLI
  2. 02Query spot and futures market data
  3. 03Manage accounts, margin, and transfers
  4. 04Trade, copy trade, and use earn products
  5. 05Follow demo-trading and safety procedures

Use cases

  1. 01Check market prices, orders, and positions
  2. 02Place orders or adjust leverage after confirmation
  3. 03Review balances and move funds
  4. 04Practice trading in demo mode

MCP support

The README mentions using MCP tools for operations. Demo trading through MCP requires starting the MCP server with --paper-trading.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bitget-ai/agent_hub --skill bitget

After installing, type/bitgetin Claude Code to confirm it loaded.

Details

From the project README

Bitget Skill

You have access to the full Bitget exchange via the bgc CLI tool — spot, futures, account, margin, copy-trading, convert, earn, P2P, and broker operations.

Step 1: Check prerequisites

bgc --version

If not found → tell the user: npm install -g bitget-client

For private endpoints (account info, trading, transfers): credentials must be set. See ~/.claude/skills/bitget-skill/references/auth-setup.md.

Step 2: Run the command

bgc <module> <tool_name> [--param value ...]

All output is JSON. The response always has:

  • data — the actual result
  • endpoint — which API was called
  • requestTime — request timestamp

For the full list of tools and parameters, read: ~/.claude/skills/bitget-skill/references/commands.md

It has a table of contents — go directly to the relevant module section.

For trading interfaces, detailed reference docs with full parameter descriptions, use cases, and examples are in: ~/.claude/skills/bitget-skill/references/trading/

FileCovers
trading/spot-place-order.mdSpot limit/market/batch orders, TP/SL presets
trading/spot-cancel-orders.mdCancel single, batch, or all spot orders
trading/spot-modify-order.mdModify (cancel-and-replace) a spot order
trading/spot-get-orders.mdQuery open/history spot orders
trading/spot-plan-orders.mdSpot trigger/plan orders (stop-loss, breakout)
trading/futures-place-order.mdFutures orders, one-way/hedge mode, TP/SL
trading/futures-modify-order.mdModify pending futures order: adjust TP/SL, price, size
trading/futures-cancel-orders.mdCancel futures orders
trading/futures-get-orders.mdQuery futures orders and fills
trading/futures-positions.mdCurrent/history positions, PnL, liquidation price
trading/futures-leverage-config.mdSet leverage, margin mode, position mode

Always read the relevant trading reference before constructing a trading command.

Futures: Close Position & TP/SL Quick Rules

Before placing ANY futures close or TP/SL order, check the position first:

bgc futures futures_get_positions --productType USDT-FUTURES --symbol BTCUSDT

Note: holdSide (long/short) and posMode (one_way_mode/hedge_mode).

Close direction rules (most common mistake)
Positionside to closeExtra param
Long (one-way mode)sellreduceOnly: "YES"
Short (one-way mode)buyreduceOnly: "YES"
Long (hedge mode)selltradeSide: "close"
Short (hedge mode)buytradeSide: "close"

Selling to close a short is WRONG — it opens more short.

TP/SL options
  1. Preset at entry: presetStopSurplusPrice / presetStopLossPrice on the opening order
  2. Add/modify after entry: futures_modify_order with newPresetStopSurplusPrice / newPresetStopLossPrice — does NOT cancel the order; pass "0" to delete a preset
  3. Manual limit + reduceOnly: place a separate limit close order at target price (use as fallback)

Read trading/futures-modify-order.md before using futures_modify_order.

Module quick-reference

ModuleUse for
spotSpot prices, orderbook, candles, spot orders
futuresPerpetuals prices, positions, futures orders, leverage
accountBalances, deposits, withdrawals, transfers, subaccounts
marginMargin assets, borrow/repay, margin orders
copytradingFollow traders, copy positions. Note: Copy positions are separate from regular futures — use copy_get_positions and copy_close_position, NOT futures_place_order, to manage them
convertConvert one coin to another. Two-step flow required: call convert_get_quote first (returns a quote ID + rate, valid ~10s), then convert_execute. Always show the quoted rate to user before executing
earnSavings/staking products, subscribe/redeem
p2pP2P merchants and orders
brokerBroker subaccounts and API keys

Write operations: always confirm first

Before running any command marked Write operation: Yes, summarize what it will do and ask the user to confirm. This includes: placing orders, cancelling orders, transfers, withdrawals, setting leverage, borrowing, redeeming earn products.

Example confirmation:

"This will place a limit buy order for 0.01 BTC at $70,000 on BTCUSDT. Confirm?"

Never silently execute a write operation.

Withdrawal safety: Always show the chain name and destination address in the confirmation prompt. Wrong chain selection is irreversible — if the user hasn't specified a chain, list available chains and ask them to confirm before proceeding.

Market buy size: For spot market buys, size is in quote coin (USDT), not base coin. Confirm the user's intent before constructing market buy orders to avoid near-zero silent executes.

Handling errors

If bgc returns "ok": false, read error.suggestion for the recovery action. Common fixes: ~/.claude/skills/bitget-skill/references/error-codes.md

When credentials are missing (AUTH_MISSING), show the user exactly which env vars to set.

Output presentation

  • For prices/tickers: show symbol, last price, 24h change, volume in a readable summary
  • For order lists: table format with orderId, symbol, side, price, size, status
  • For balances: list coins with available and frozen amounts; skip dust balances (< 0.0001)
  • For futures positions: always show symbol, side (long/short), size, entry price, mark price, unrealized PnL, liquidation price, and leverage. Never omit liquidation price
  • For funding rates: show current rate, annualized rate, and next settlement time
  • For raw data the user didn't ask to see: summarize, don't dump the full JSON

Usage examples

# Public market data (no credentials needed)
bgc spot spot_get_ticker --symbol BTCUSDT
bgc futures futures_get_ticker --productType USDT-FUTURES --symbol BTCUSDT
bgc futures futures_get_funding_rate --productType USDT-FUTURES --symbol BTCUSDT

# Account queries (requires credentials)
bgc account get_account_assets
bgc spot spot_get_orders --status open
bgc futures futures_get_positions --productType USDT-FUTURES

# Write operations (confirm before running)
bgc spot spot_place_order --orders '[{"symbol":"BTCUSDT","side":"buy","orderType":"limit","price":"70000","size":"0.01"}]'
bgc futures futures_set_leverage --productType USDT-FUTURES --symbol BTCUSDT --marginCoin USDT --leverage 10
bgc account transfer --fromAccountType spot --toAccountType futures_usdt --coin USDT --amount 100

Demo Trading Mode

Use demo mode when the user wants to practice trading, test strategies, or explicitly asks for "demo", "paper trading", or "simulated trading".

Setup: The user needs a Bitget Demo API Key. See ~/.claude/skills/bitget-skill/references/demo-trading.md for full setup steps.

For bgc CLI: Add --paper-trading as the FIRST flag after bgc:

bgc --paper-trading spot spot_get_ticker --symbol BTCUSDT
bgc --paper-trading futures futures_get_positions --productType USDT-FUTURES
bgc --paper-trading account get_account_assets

For MCP tools: The MCP server must be started with --paper-trading. If the user is asking to use demo mode via MCP but the server wasn't started with that flag, inform them they need to restart with --paper-trading.

Key rule: In demo mode, add --paper-trading to EVERY bgc command in the session. Never mix demo and live commands in the same session.

Comments

Markdown supported