Skip to main content
Glama
TeacherLi07

htx-mcp

by TeacherLi07

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HTX_API_KEYNoHTX Access Key; required for private interfaces
HTX_LOG_LEVELNostderr log levelINFO
MCP_TRANSPORTNoTransport: stdio, sse or streamable-httpstdio
HTX_API_SECRETNoHTX Secret Key; only used for local signing
HTX_API_BASE_URLNoSpot API hosthttps://api.huobi.pro
HTX_ENABLE_TRADINGNoWhether to allow write interfaces to actually send to HTXfalse
HTX_SPOT_ACCOUNT_IDNoDefault spot account ID; can be obtained by calling spot_get_accounts
HTX_TIMEOUT_SECONDSNoHTTP request timeout in seconds20
HTX_FUTURES_API_BASE_URLNoUSDT-margined contracts API hosthttps://api.hbdm.com

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
htx_diagnose_private_accessA

Diagnose authenticated access to HTX spot and USDT-swap private APIs without trading.

The result reports credential presence, configured hosts, each check's success, and sanitized HTX error codes/messages. It never returns a secret, signature, or signed URL.

htx_get_market_snapshotA

Return one compact, concurrently collected market snapshot for analysis or execution.

Prefer this aggregate over several low-level market calls. For technical analysis, call htx_get_technical_indicators instead of requesting raw K-lines.

htx_get_technical_indicatorsA

Return only the requested, Decimal-calculated technical indicators.

The model chooses which named indicators to inspect; it never calculates them itself. Results are display-rounded only at response time: EMA uses candle price precision plus one decimal, MACD uses it plus three, and RSI/KDJ use two decimal places. Raw K-lines remain available solely through the opt-in advanced compatibility toolset for research and diagnostics.

htx_wait_for_market_eventA

Block until bounded declarative market conditions match or the timeout expires.

This safe MCP wait primitive performs read-only calls, executes no caller-supplied code, has a fixed deadline, and returns compact evidence. A future WebSocket market daemon can satisfy the identical contract.

Important: while this call is pending, the agent receives no intermediate market updates and cannot react to them. For an uninterrupted wait, set the outer host yield_time_ms longer than timeout_seconds * 1000 (with response margin) and set the host tool deadline longer still. The MCP result then becomes the sole wake-up source; then re-check market snapshots after every return.

htx_get_instrument_rulesA

Return HTX precision, minimum, status, and contract rules for one product.

Use these rules before constructing any quantity or price.

htx_get_account_snapshotB

Return a compact authenticated snapshot of balances, positions, and orders.

This is read-only and requires API credentials.

htx_get_portfolio_snapshotA

Return one compact cross-product portfolio snapshot for account review.

It concurrently reads spot and USDT-swap balances and positions. V5 swap accounts also return open orders across every contract, so this is the preferred pre-session portfolio check; no market data is fetched.

htx_get_market_contextA

Return bounded research context without exposing raw HTX envelopes.

Use this when indicators alone are insufficient and a trader needs inspectable OHLCV, a recent public trade tape, or swap funding history. It is a REST snapshot, not a low-latency stream.

htx_get_trade_historyA

Return compact executed-fill history for one instrument, not order history.

Traders normally review fills to reconcile an order, calculate realized entry/exit prices and fees, or inspect recent execution quality. Provide order_id for reconciliation; otherwise use a bounded time window and cursor to page a recent instrument history. The exchange retention window is 48 hours for spot and legacy swaps, and three days for v5 swaps.

htx_get_risk_snapshotA

Combine current market and account state into a pre-trade risk snapshot.

The tool supplies facts and warnings; it does not make a trading decision.

htx_get_spot_margin_snapshotA

Return compact spot-margin balances, debt/risk fields, and current loan quotas.

This read-only preflight is designed to precede borrowing, repayment, or any margin-funded trade.

htx_plan_spot_margin_actionA

Validate and normalize one spot-margin transfer, borrow, or targeted repayment.

Borrow plans check HTX's live currency quota where available; a ready plan is still a review artifact, not an execution request.

htx_validate_trade_intentA

Validate a product-neutral trade intent and return checks without a request preview.

htx_preview_tradeB

Build a normalized dry-run request after validating a product-neutral trade intent.

htx_reconcile_tradeA

Read final order and fill state after a submission or network timeout.

Query this before retrying a timed-out submission.

Prompts

Interactive templates invoked by user choice

NameDescription
trade_preflightCreate a compact HTX trade-preflight checklist before enabling a mutation tool. This prompt does not place an order; it asks the model to verify contract rules, balance, leverage, existing orders/positions, and protection direction first.

Resources

Contextual data attached and managed by the client

NameDescription
configurationExpose non-secret HTX MCP configuration and safety state as JSON. The resource reports API hosts, credential presence, trading enablement, account-ID configuration, supported products, and the dry-run safety gates; it never contains API secrets.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TeacherLi07/htx-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server