hvip-mcp-server 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +404 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21168,7 +21168,24 @@ var publicApi = {
21168
21168
  getSupportCoin: () => request("GET", "/api/v5/rubik/stat/trading-data/support-coin"),
21169
21169
  getTopTraderLongShortRatio: (instId, begin, end) => request("GET", "/api/v5/rubik/stat/contracts/long-short-account-ratio-contract-top-trader", { params: { instId, begin, end } }),
21170
21170
  getOptionPutCallRatio: (ccy, begin, end) => request("GET", "/api/v5/rubik/stat/option/open-interest-volume-ratio", { params: { ccy, begin, end } }),
21171
- getLendingRateSummary: (ccy) => request("GET", "/api/v5/finance/savings/lending-rate-summary", { params: { ccy } })
21171
+ getLendingRateSummary: (ccy) => request("GET", "/api/v5/finance/savings/lending-rate-summary", { params: { ccy } }),
21172
+ // ── 跟单(公共,需带单员uniqueCode) ─────────────────────────────────────────
21173
+ getLeadTraderPositions: (uniqueCode, instType) => request("GET", "/api/v5/copytrading/public-current-subpositions", { params: { uniqueCode, instType } }),
21174
+ getLeadTraderHistory: (uniqueCode, instType, limit) => request("GET", "/api/v5/copytrading/public-subpositions-history", { params: { uniqueCode, instType, limit } }),
21175
+ getLeadTraderStats: (uniqueCode, instType, lastDays) => request("GET", "/api/v5/copytrading/public-stats", { params: { uniqueCode, instType, lastDays } }),
21176
+ // ── 网格交易机器人(公共) ────────────────────────────────────────────────────
21177
+ getGridAiParam: (instId, algoOrdType, direction) => request("GET", "/api/v5/tradingBot/grid/ai-param", { params: { instId, algoOrdType, direction } }),
21178
+ // ── 大宗交易行情(公共) ─────────────────────────────────────────────────────
21179
+ getBlockTickers: (instType) => request("GET", "/api/v5/market/block-tickers", { params: { instType } }),
21180
+ // ── 价差交易(公共) ──────────────────────────────────────────────────────────
21181
+ getSpreads: (sprdId, baseCcy, instId, state) => request("GET", "/api/v5/sprd/spreads", { params: { sprdId, baseCcy, instId, state } }),
21182
+ getSpreadTicker: (sprdId) => request("GET", "/api/v5/sprd/ticker", { params: { sprdId } }),
21183
+ getSpreadOrderbook: (sprdId, sz) => request("GET", "/api/v5/sprd/books", { params: { sprdId, sz } }),
21184
+ getSpreadTrades: (sprdId, limit) => request("GET", "/api/v5/sprd/trades", { params: { sprdId, limit } }),
21185
+ getSpreadCandles: (sprdId, bar, limit) => request("GET", "/api/v5/sprd/candles", { params: { sprdId, bar, limit } }),
21186
+ // ── 公告(公共) ──────────────────────────────────────────────────────────────
21187
+ getAnnouncements: (annType, lang) => request("GET", "/api/v5/support/announcements", { params: { annType, lang } }),
21188
+ getAnnouncementTypes: () => request("GET", "/api/v5/support/announcement-types")
21172
21189
  };
21173
21190
  var privateApi = {
21174
21191
  getBalance: (auth, ccy) => request("GET", "/api/v5/account/balance", { params: { ccy }, auth }),
@@ -21195,6 +21212,19 @@ var privateApi = {
21195
21212
  getEthStakingBalance: (auth) => request("GET", "/api/v5/finance/staking-defi/eth/balance", { auth }),
21196
21213
  getEthStakingHistory: (auth, limit) => request("GET", "/api/v5/finance/staking-defi/eth/purchase-redeem-history", { params: { limit }, auth }),
21197
21214
  getSolStakingBalance: (auth) => request("GET", "/api/v5/finance/staking-defi/sol/balance", { auth }),
21215
+ // ── 跟单(私有) ─────────────────────────────────────────────────────────────
21216
+ getMyLeadPositions: (auth, instType) => request("GET", "/api/v5/copytrading/current-subpositions", { params: { instType }, auth }),
21217
+ getMyLeadHistory: (auth, instType, limit) => request("GET", "/api/v5/copytrading/subpositions-history", { params: { instType, limit }, auth }),
21218
+ getCopyInstruments: (auth, instType) => request("GET", "/api/v5/copytrading/instruments", { params: { instType }, auth }),
21219
+ getProfitSharingTotal: (auth, instType) => request("GET", "/api/v5/copytrading/total-profit-sharing", { params: { instType }, auth }),
21220
+ getProfitSharingDetails: (auth, instType, limit) => request("GET", "/api/v5/copytrading/profit-sharing-details", { params: { instType, limit }, auth }),
21221
+ // ── 网格交易机器人(私有) ────────────────────────────────────────────────────
21222
+ getGridOrdersPending: (auth, algoOrdType, instId, instType) => request("GET", "/api/v5/tradingBot/grid/orders-algo-pending", { params: { algoOrdType, instId, instType }, auth }),
21223
+ getGridOrdersHistory: (auth, algoOrdType, instId, instType) => request("GET", "/api/v5/tradingBot/grid/orders-algo-history", { params: { algoOrdType, instId, instType }, auth }),
21224
+ getGridSubOrders: (auth, algoId, algoOrdType, type, groupId) => request("GET", "/api/v5/tradingBot/grid/sub-orders", { params: { algoId, algoOrdType, type, groupId }, auth }),
21225
+ // ── 定投机器人(私有) ────────────────────────────────────────────────────────
21226
+ getRecurringOrdersPending: (auth) => request("GET", "/api/v5/tradingBot/recurring/orders-algo-pending", { auth }),
21227
+ getRecurringOrdersHistory: (auth) => request("GET", "/api/v5/tradingBot/recurring/orders-algo-history", { auth }),
21198
21228
  getAlgoOrders: (auth, ordType, instType) => request("GET", "/api/v5/trade/orders-algo-pending", { params: { ordType, instType }, auth }),
21199
21229
  getAlgoOrdersHistory: (auth, ordType, state, instType) => request("GET", "/api/v5/trade/orders-algo-history", { params: { ordType, state, instType }, auth }),
21200
21230
  placeAlgoOrder: (auth, body) => request("POST", "/api/v5/trade/order-algo", { body, auth }),
@@ -21420,6 +21450,21 @@ function registerMarketTools(server) {
21420
21450
  }
21421
21451
  }
21422
21452
  );
21453
+ server.tool(
21454
+ "okx_get_block_tickers",
21455
+ "\u83B7\u53D6\u5927\u5B97\u4EA4\u6613\uFF08Block Trading\uFF09\u5B9E\u65F6\u884C\u60C5\uFF0C\u542B\u6210\u4EA4\u91CF\u7EDF\u8BA1\u3002\u5927\u5B97\u4EA4\u6613\u4E13\u4E3A\u673A\u6784\u5927\u989D\u4EA4\u6613\u8BBE\u8BA1\uFF0C\u6210\u4EA4\u6570\u636E\u53CD\u6620\u673A\u6784\u8D44\u91D1\u52A8\u5411\u3002",
21456
+ {
21457
+ instType: external_exports.enum(["SPOT", "SWAP", "FUTURES", "OPTION"]).describe("\u4EA7\u54C1\u7C7B\u578B")
21458
+ },
21459
+ async ({ instType }) => {
21460
+ try {
21461
+ const data = await publicApi.getBlockTickers(instType);
21462
+ return toResult(data);
21463
+ } catch (e) {
21464
+ return toError(e);
21465
+ }
21466
+ }
21467
+ );
21423
21468
  }
21424
21469
 
21425
21470
  // src/tools/public.ts
@@ -21561,6 +21606,35 @@ function registerPublicTools(server) {
21561
21606
  }
21562
21607
  }
21563
21608
  );
21609
+ server.tool(
21610
+ "okx_get_announcements",
21611
+ "\u83B7\u53D6OKX\u5B98\u65B9\u516C\u544A\u5217\u8868\uFF08\u7EF4\u62A4\u901A\u77E5\u3001\u65B0\u5E01\u4E0A\u7EBF\u3001\u6D3B\u52A8\u7B49\uFF09\u3002\u5B9A\u671F\u67E5\u8BE2\u53EF\u53CA\u65F6\u4E86\u89E3\u5E73\u53F0\u53D8\u5316\uFF0C\u63D0\u524D\u505A\u597D\u98CE\u9669\u51C6\u5907\u3002",
21612
+ {
21613
+ annType: external_exports.string().optional().describe("\u516C\u544A\u7C7B\u578BID\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8\u3002\u53EF\u5148\u8C03\u7528 okx_get_announcement_types \u67E5\u8BE2\u53EF\u7528\u7C7B\u578B"),
21614
+ lang: external_exports.enum(["zh-Hans", "en-US"]).optional().describe("\u8BED\u8A00\uFF0C\u9ED8\u8BA4\u4E2D\u6587")
21615
+ },
21616
+ async ({ annType, lang }) => {
21617
+ try {
21618
+ const data = await publicApi.getAnnouncements(annType, lang);
21619
+ return toResult(data);
21620
+ } catch (e) {
21621
+ return toError(e);
21622
+ }
21623
+ }
21624
+ );
21625
+ server.tool(
21626
+ "okx_get_announcement_types",
21627
+ "\u83B7\u53D6OKX\u516C\u544A\u5206\u7C7B\u5217\u8868\uFF08\u5982\u7EF4\u62A4\u901A\u77E5\u3001\u4E0A\u65B0\u516C\u544A\u3001\u6D3B\u52A8\u516C\u544A\u7B49\uFF09\u3002\u7528\u4E8E\u7B5B\u9009\u7279\u5B9A\u7C7B\u578B\u516C\u544A\u3002",
21628
+ {},
21629
+ async () => {
21630
+ try {
21631
+ const data = await publicApi.getAnnouncementTypes();
21632
+ return toResult(data);
21633
+ } catch (e) {
21634
+ return toError(e);
21635
+ }
21636
+ }
21637
+ );
21564
21638
  }
21565
21639
 
21566
21640
  // src/tools/account.ts
@@ -22365,17 +22439,345 @@ function registerOutcomesTools(server) {
22365
22439
  );
22366
22440
  }
22367
22441
 
22442
+ // src/tools/bot.ts
22443
+ function registerBotTools(server, auth) {
22444
+ server.tool(
22445
+ "okx_get_grid_ai_param",
22446
+ "\u83B7\u53D6OKX\u667A\u80FD\u7F51\u683C\u63A8\u8350\u53C2\u6570\uFF08\u65E0\u9700API Key\uFF09\u3002\u5305\u542B\u5EFA\u8BAE\u7684\u7F51\u683C\u4E0A\u4E0B\u754C\u3001\u683C\u6570\u3001\u9884\u671F\u5E74\u5316\u6536\u76CA\u3002\u5F00\u7F51\u683C\u524D\u5FEB\u901F\u8BC4\u4F30\u53C2\u6570\u5408\u7406\u6027\u3002",
22447
+ {
22448
+ instId: external_exports.string().describe("\u4EA7\u54C1ID\uFF0C\u5982 BTC-USDT\u3001BTC-USDT-SWAP"),
22449
+ algoOrdType: external_exports.enum(["grid", "contract_grid", "moon_grid"]).describe("\u7F51\u683C\u7C7B\u578B\uFF1Agrid=\u73B0\u8D27\u7F51\u683C\uFF0Ccontract_grid=\u5408\u7EA6\u7F51\u683C\uFF0Cmoon_grid=\u5929\u5730\u7F51\u683C"),
22450
+ direction: external_exports.enum(["long", "short", "neutral"]).optional().describe("\u5408\u7EA6\u7F51\u683C\u65B9\u5411\uFF08\u4EC5contract_grid\u9700\u8981\uFF09")
22451
+ },
22452
+ async ({ instId, algoOrdType, direction }) => {
22453
+ try {
22454
+ const data = await publicApi.getGridAiParam(instId, algoOrdType, direction);
22455
+ return toResult(data);
22456
+ } catch (e) {
22457
+ return toError(e);
22458
+ }
22459
+ }
22460
+ );
22461
+ server.tool(
22462
+ "okx_get_grid_orders_pending",
22463
+ "\u67E5\u8BE2\u5F53\u524D\u8FD0\u884C\u4E2D\u7684\u7F51\u683C\u7B56\u7565\u5217\u8868\uFF0C\u542B\u6BCF\u4E2A\u7F51\u683C\u7684\u76C8\u4E8F\u3001\u6210\u4EA4\u6B21\u6570\u548C\u8D44\u91D1\u5360\u7528\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22464
+ {
22465
+ algoOrdType: external_exports.enum(["grid", "contract_grid", "moon_grid"]).describe("\u7F51\u683C\u7C7B\u578B"),
22466
+ instId: external_exports.string().optional().describe("\u4EA7\u54C1ID\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8"),
22467
+ instType: external_exports.enum(["SPOT", "MARGIN", "FUTURES", "SWAP"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\u7B5B\u9009")
22468
+ },
22469
+ async ({ algoOrdType, instId, instType }) => {
22470
+ if (!auth) return toError(AUTH_REQUIRED);
22471
+ try {
22472
+ const data = await privateApi.getGridOrdersPending(auth, algoOrdType, instId, instType);
22473
+ return toResult(data);
22474
+ } catch (e) {
22475
+ return toError(e);
22476
+ }
22477
+ }
22478
+ );
22479
+ server.tool(
22480
+ "okx_get_grid_orders_history",
22481
+ "\u67E5\u8BE2\u5DF2\u505C\u6B62\u7684\u5386\u53F2\u7F51\u683C\u7B56\u7565\uFF0C\u542B\u6700\u7EC8\u76C8\u4E8F\u548C\u8FD0\u884C\u65F6\u957F\u3002\u7528\u4E8E\u8BC4\u4F30\u5386\u53F2\u7B56\u7565\u6548\u679C\uFF0C\u4F18\u5316\u4E0B\u6B21\u53C2\u6570\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22482
+ {
22483
+ algoOrdType: external_exports.enum(["grid", "contract_grid", "moon_grid"]).describe("\u7F51\u683C\u7C7B\u578B"),
22484
+ instId: external_exports.string().optional().describe("\u4EA7\u54C1ID\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8"),
22485
+ instType: external_exports.enum(["SPOT", "MARGIN", "FUTURES", "SWAP"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\u7B5B\u9009")
22486
+ },
22487
+ async ({ algoOrdType, instId, instType }) => {
22488
+ if (!auth) return toError(AUTH_REQUIRED);
22489
+ try {
22490
+ const data = await privateApi.getGridOrdersHistory(auth, algoOrdType, instId, instType);
22491
+ return toResult(data);
22492
+ } catch (e) {
22493
+ return toError(e);
22494
+ }
22495
+ }
22496
+ );
22497
+ server.tool(
22498
+ "okx_get_grid_sub_orders",
22499
+ "\u67E5\u8BE2\u67D0\u4E2A\u7F51\u683C\u7B56\u7565\u7684\u5B50\u8BA2\u5355\u5217\u8868\uFF08\u6BCF\u4E00\u683C\u7684\u4E70\u5356\u8BB0\u5F55\uFF09\u3002\u7528\u4E8E\u5206\u6790\u7F51\u683C\u6210\u4EA4\u60C5\u51B5\uFF0C\u9A8C\u8BC1\u7B56\u7565\u662F\u5426\u6309\u9884\u671F\u8FD0\u884C\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22500
+ {
22501
+ algoId: external_exports.string().describe("\u7F51\u683C\u7B56\u7565ID"),
22502
+ algoOrdType: external_exports.enum(["grid", "contract_grid", "moon_grid"]).describe("\u7F51\u683C\u7C7B\u578B"),
22503
+ type: external_exports.enum(["filled", "unfilled"]).describe("filled=\u5DF2\u6210\u4EA4\uFF0Cunfilled=\u672A\u6210\u4EA4")
22504
+ },
22505
+ async ({ algoId, algoOrdType, type }) => {
22506
+ if (!auth) return toError(AUTH_REQUIRED);
22507
+ try {
22508
+ const data = await privateApi.getGridSubOrders(auth, algoId, algoOrdType, type);
22509
+ return toResult(data);
22510
+ } catch (e) {
22511
+ return toError(e);
22512
+ }
22513
+ }
22514
+ );
22515
+ server.tool(
22516
+ "okx_get_recurring_orders_pending",
22517
+ "\u67E5\u8BE2\u5F53\u524D\u8FD0\u884C\u4E2D\u7684\u5B9A\u6295\u8BA1\u5212\u5217\u8868\uFF0C\u542B\u6295\u8D44\u5E01\u79CD\u3001\u5468\u671F\u3001\u5DF2\u6295\u603B\u989D\u548C\u5F53\u524D\u76C8\u4E8F\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22518
+ {},
22519
+ async () => {
22520
+ if (!auth) return toError(AUTH_REQUIRED);
22521
+ try {
22522
+ const data = await privateApi.getRecurringOrdersPending(auth);
22523
+ return toResult(data);
22524
+ } catch (e) {
22525
+ return toError(e);
22526
+ }
22527
+ }
22528
+ );
22529
+ server.tool(
22530
+ "okx_get_recurring_orders_history",
22531
+ "\u67E5\u8BE2\u5DF2\u7ED3\u675F\u7684\u5386\u53F2\u5B9A\u6295\u8BA1\u5212\uFF0C\u542B\u603B\u6295\u5165\u3001\u603B\u6536\u76CA\u548C\u5E74\u5316\u6536\u76CA\u7387\u3002\u7528\u4E8E\u8BC4\u4F30\u5B9A\u6295\u7B56\u7565\u957F\u671F\u6548\u679C\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22532
+ {},
22533
+ async () => {
22534
+ if (!auth) return toError(AUTH_REQUIRED);
22535
+ try {
22536
+ const data = await privateApi.getRecurringOrdersHistory(auth);
22537
+ return toResult(data);
22538
+ } catch (e) {
22539
+ return toError(e);
22540
+ }
22541
+ }
22542
+ );
22543
+ }
22544
+
22545
+ // src/tools/spread.ts
22546
+ function registerSpreadTools(server) {
22547
+ server.tool(
22548
+ "okx_get_spreads",
22549
+ "\u83B7\u53D6\u4EF7\u5DEE\u5408\u7EA6\u4EA7\u54C1\u5217\u8868\u3002\u4EF7\u5DEE\u4EA4\u6613\u662F\u540C\u65F6\u4E70\u5165\u4E00\u4E2A\u5408\u7EA6\u3001\u5356\u51FA\u53E6\u4E00\u4E2A\u5408\u7EA6\uFF0C\u6355\u83B7\u4E24\u8005\u4EF7\u683C\u4E4B\u5DEE\uFF0C\u5E38\u7528\u4E8E\u8DE8\u671F\u5957\u5229\u3002",
22550
+ {
22551
+ sprdId: external_exports.string().optional().describe("\u4EF7\u5DEE\u5408\u7EA6ID\uFF0C\u5982 BTC-USDT_BTC-USDT-SWAP"),
22552
+ baseCcy: external_exports.string().optional().describe("\u6807\u7684\u5E01\u79CD\uFF0C\u5982 BTC"),
22553
+ instId: external_exports.string().optional().describe("\u817F\u5408\u7EA6\u4EA7\u54C1ID\uFF0C\u7CBE\u786E\u7B5B\u9009"),
22554
+ state: external_exports.enum(["live", "expired", "suspend"]).optional().describe("\u5408\u7EA6\u72B6\u6001")
22555
+ },
22556
+ async ({ sprdId, baseCcy, instId, state }) => {
22557
+ try {
22558
+ const data = await publicApi.getSpreads(sprdId, baseCcy, instId, state);
22559
+ return toResult(data);
22560
+ } catch (e) {
22561
+ return toError(e);
22562
+ }
22563
+ }
22564
+ );
22565
+ server.tool(
22566
+ "okx_get_spread_ticker",
22567
+ "\u83B7\u53D6\u5355\u4E2A\u4EF7\u5DEE\u5408\u7EA6\u5B9E\u65F6\u884C\u60C5\uFF0C\u542B\u6700\u65B0\u4EF7\u3001\u4E70\u5356\u4EF7\u5DEE\u3002\u5148\u7528 okx_get_spreads \u67E5\u8BE2\u53EF\u7528\u7684\u4EF7\u5DEE\u5408\u7EA6ID\u3002",
22568
+ {
22569
+ sprdId: external_exports.string().describe("\u4EF7\u5DEE\u5408\u7EA6ID\uFF0C\u5982 BTC-USD-SWAP_BTC-USD-260925")
22570
+ },
22571
+ async ({ sprdId }) => {
22572
+ try {
22573
+ const data = await publicApi.getSpreadTicker(sprdId);
22574
+ return toResult(data);
22575
+ } catch (e) {
22576
+ return toError(e);
22577
+ }
22578
+ }
22579
+ );
22580
+ server.tool(
22581
+ "okx_get_spread_orderbook",
22582
+ "\u83B7\u53D6\u4EF7\u5DEE\u5408\u7EA6\u8BA2\u5355\u7C3F\u6DF1\u5EA6\u3002\u5206\u6790\u4E70\u5356\u53CC\u65B9\u6302\u5355\u5206\u5E03\uFF0C\u5224\u65AD\u4EF7\u5DEE\u5E02\u573A\u7684\u6D41\u52A8\u6027\u8D28\u91CF\u3002",
22583
+ {
22584
+ sprdId: external_exports.string().describe("\u4EF7\u5DEE\u5408\u7EA6ID"),
22585
+ sz: external_exports.number().int().min(1).max(400).optional().describe("\u6DF1\u5EA6\u6863\u4F4D\uFF0C\u9ED8\u8BA420")
22586
+ },
22587
+ async ({ sprdId, sz }) => {
22588
+ try {
22589
+ const data = await publicApi.getSpreadOrderbook(sprdId, sz);
22590
+ return toResult(data);
22591
+ } catch (e) {
22592
+ return toError(e);
22593
+ }
22594
+ }
22595
+ );
22596
+ server.tool(
22597
+ "okx_get_spread_trades",
22598
+ "\u83B7\u53D6\u4EF7\u5DEE\u5408\u7EA6\u6700\u65B0\u6210\u4EA4\u8BB0\u5F55\u3002\u7528\u4E8E\u5206\u6790\u5E02\u573A\u53C2\u4E0E\u8005\u5BF9\u5F53\u524D\u4EF7\u5DEE\u6C34\u5E73\u7684\u8BA4\u53EF\u5EA6\u3002",
22599
+ {
22600
+ sprdId: external_exports.string().describe("\u4EF7\u5DEE\u5408\u7EA6ID"),
22601
+ limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420")
22602
+ },
22603
+ async ({ sprdId, limit }) => {
22604
+ try {
22605
+ const data = await publicApi.getSpreadTrades(sprdId, limit);
22606
+ return toResult(data);
22607
+ } catch (e) {
22608
+ return toError(e);
22609
+ }
22610
+ }
22611
+ );
22612
+ server.tool(
22613
+ "okx_get_spread_candles",
22614
+ "\u83B7\u53D6\u4EF7\u5DEE\u5408\u7EA6K\u7EBF\u6570\u636E\u3002\u7528\u4E8E\u7814\u7A76\u4EF7\u5DEE\u5386\u53F2\u8D70\u52BF\uFF0C\u8BC6\u522B\u5747\u503C\u56DE\u5F52\u673A\u4F1A\u3002",
22615
+ {
22616
+ sprdId: external_exports.string().describe("\u4EF7\u5DEE\u5408\u7EA6ID"),
22617
+ bar: external_exports.enum(["1m", "5m", "15m", "30m", "1H", "4H", "1D"]).optional().describe("K\u7EBF\u5468\u671F\uFF0C\u9ED8\u8BA41H"),
22618
+ limit: external_exports.number().int().min(1).max(300).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4100")
22619
+ },
22620
+ async ({ sprdId, bar, limit }) => {
22621
+ try {
22622
+ const data = await publicApi.getSpreadCandles(sprdId, bar, limit);
22623
+ return toResult(data);
22624
+ } catch (e) {
22625
+ return toError(e);
22626
+ }
22627
+ }
22628
+ );
22629
+ }
22630
+
22631
+ // src/tools/copy.ts
22632
+ function registerCopyTools(server, auth) {
22633
+ server.tool(
22634
+ "okx_get_lead_trader_positions",
22635
+ "\u67E5\u8BE2\u6307\u5B9A\u5E26\u5355\u5458\u5F53\u524D\u6301\u4ED3\u5217\u8868\uFF0C\u542B\u54C1\u79CD\u3001\u65B9\u5411\u3001\u6301\u4ED3\u91CF\u548C\u5F00\u4ED3\u5747\u4EF7\u3002\u65E0\u9700API Key\u3002uniqueCode \u53EF\u4ECEOKX\u8DDF\u5355\u5E7F\u573A\u83B7\u53D6\u3002",
22636
+ {
22637
+ uniqueCode: external_exports.string().describe("\u5E26\u5355\u5458\u552F\u4E00\u6807\u8BC6\u7801\uFF0C\u4ECEOKX App\u300C\u8DDF\u5355\u300D\u9875\u9762\u83B7\u53D6"),
22638
+ instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8")
22639
+ },
22640
+ async ({ uniqueCode, instType }) => {
22641
+ try {
22642
+ const data = await publicApi.getLeadTraderPositions(uniqueCode, instType);
22643
+ return toResult(data);
22644
+ } catch (e) {
22645
+ return toError(e);
22646
+ }
22647
+ }
22648
+ );
22649
+ server.tool(
22650
+ "okx_get_lead_trader_history",
22651
+ "\u67E5\u8BE2\u6307\u5B9A\u5E26\u5355\u5458\u5386\u53F2\u6301\u4ED3\u8BB0\u5F55\uFF0C\u542B\u6BCF\u7B14\u4EA4\u6613\u7684\u76C8\u4E8F\u548C\u6301\u4ED3\u65F6\u957F\u3002\u65E0\u9700API Key\u3002\u9002\u5408\u8BC4\u4F30\u5E26\u5355\u5458\u5386\u53F2\u8868\u73B0\u540E\u518D\u51B3\u5B9A\u662F\u5426\u8DDF\u5355\u3002",
22652
+ {
22653
+ uniqueCode: external_exports.string().describe("\u5E26\u5355\u5458\u552F\u4E00\u6807\u8BC6\u7801"),
22654
+ instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8"),
22655
+ limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420")
22656
+ },
22657
+ async ({ uniqueCode, instType, limit }) => {
22658
+ try {
22659
+ const data = await publicApi.getLeadTraderHistory(uniqueCode, instType, limit);
22660
+ return toResult(data);
22661
+ } catch (e) {
22662
+ return toError(e);
22663
+ }
22664
+ }
22665
+ );
22666
+ server.tool(
22667
+ "okx_get_lead_trader_stats",
22668
+ "\u67E5\u8BE2\u6307\u5B9A\u5E26\u5355\u5458\u7684\u7EE9\u6548\u7EDF\u8BA1\uFF0C\u542B\u603B\u6536\u76CA\u7387\u3001\u6700\u5927\u56DE\u64A4\u3001\u8DDF\u5355\u4EBA\u6570\u548C\u80DC\u7387\u3002\u65E0\u9700API Key\u3002\u662F\u8BC4\u4F30\u5E26\u5355\u5458\u6700\u6838\u5FC3\u7684\u6307\u6807\u3002",
22669
+ {
22670
+ uniqueCode: external_exports.string().describe("\u5E26\u5355\u5458\u552F\u4E00\u6807\u8BC6\u7801"),
22671
+ instType: external_exports.enum(["SWAP", "FUTURES"]).describe("\u4EA7\u54C1\u7C7B\u578B"),
22672
+ lastDays: external_exports.enum(["7", "30", "90", "180"]).describe("\u7EDF\u8BA1\u5468\u671F\uFF08\u5929\uFF09\uFF1A7/30/90/180")
22673
+ },
22674
+ async ({ uniqueCode, instType, lastDays }) => {
22675
+ try {
22676
+ const data = await publicApi.getLeadTraderStats(uniqueCode, instType, lastDays);
22677
+ return toResult(data);
22678
+ } catch (e) {
22679
+ return toError(e);
22680
+ }
22681
+ }
22682
+ );
22683
+ server.tool(
22684
+ "okx_get_my_lead_positions",
22685
+ "\u67E5\u8BE2\u6211\u5F53\u524D\u4F5C\u4E3A\u5E26\u5355\u5458\u7684\u6301\u4ED3\u5217\u8868\uFF08\u4EC5\u5E26\u5355\u5458\u8D26\u6237\u6709\u6570\u636E\uFF09\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22686
+ {
22687
+ instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8")
22688
+ },
22689
+ async ({ instType }) => {
22690
+ if (!auth) return toError(AUTH_REQUIRED);
22691
+ try {
22692
+ const data = await privateApi.getMyLeadPositions(auth, instType);
22693
+ return toResult(data);
22694
+ } catch (e) {
22695
+ return toError(e);
22696
+ }
22697
+ }
22698
+ );
22699
+ server.tool(
22700
+ "okx_get_my_lead_history",
22701
+ "\u67E5\u8BE2\u6211\u7684\u5386\u53F2\u5E26\u5355\u8BB0\u5F55\uFF0C\u542B\u6BCF\u7B14\u7684\u76C8\u4E8F\u548C\u8DDF\u5355\u91CF\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22702
+ {
22703
+ instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B"),
22704
+ limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420")
22705
+ },
22706
+ async ({ instType, limit }) => {
22707
+ if (!auth) return toError(AUTH_REQUIRED);
22708
+ try {
22709
+ const data = await privateApi.getMyLeadHistory(auth, instType, limit);
22710
+ return toResult(data);
22711
+ } catch (e) {
22712
+ return toError(e);
22713
+ }
22714
+ }
22715
+ );
22716
+ server.tool(
22717
+ "okx_get_copy_instruments",
22718
+ "\u67E5\u8BE2\u6211\u5F53\u524D\u4F5C\u4E3A\u5E26\u5355\u5458\u5141\u8BB8\u8DDF\u5355\u7684\u54C1\u79CD\u5217\u8868\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22719
+ {
22720
+ instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B")
22721
+ },
22722
+ async ({ instType }) => {
22723
+ if (!auth) return toError(AUTH_REQUIRED);
22724
+ try {
22725
+ const data = await privateApi.getCopyInstruments(auth, instType);
22726
+ return toResult(data);
22727
+ } catch (e) {
22728
+ return toError(e);
22729
+ }
22730
+ }
22731
+ );
22732
+ server.tool(
22733
+ "okx_get_profit_sharing_total",
22734
+ "\u67E5\u8BE2\u6211\u7684\u5E26\u5355\u7D2F\u8BA1\u6536\u53D6\u7684\u5206\u6210\u91D1\u989D\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22735
+ {
22736
+ instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B")
22737
+ },
22738
+ async ({ instType }) => {
22739
+ if (!auth) return toError(AUTH_REQUIRED);
22740
+ try {
22741
+ const data = await privateApi.getProfitSharingTotal(auth, instType);
22742
+ return toResult(data);
22743
+ } catch (e) {
22744
+ return toError(e);
22745
+ }
22746
+ }
22747
+ );
22748
+ server.tool(
22749
+ "okx_get_profit_sharing_details",
22750
+ "\u67E5\u8BE2\u5E26\u5355\u76C8\u5229\u5206\u6210\u7684\u9010\u7B14\u660E\u7EC6\uFF0C\u542B\u6BCF\u6B21\u5206\u6210\u7684\u91D1\u989D\u3001\u6765\u6E90\u8DDF\u5355\u8005\u548C\u65F6\u95F4\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
22751
+ {
22752
+ instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B"),
22753
+ limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420")
22754
+ },
22755
+ async ({ instType, limit }) => {
22756
+ if (!auth) return toError(AUTH_REQUIRED);
22757
+ try {
22758
+ const data = await privateApi.getProfitSharingDetails(auth, instType, limit);
22759
+ return toResult(data);
22760
+ } catch (e) {
22761
+ return toError(e);
22762
+ }
22763
+ }
22764
+ );
22765
+ }
22766
+
22368
22767
  // src/index.ts
22369
22768
  async function main() {
22370
- const server = new McpServer({ name: "hvip", version: "0.1.0" });
22769
+ const server = new McpServer({ name: "hvip", version: "0.1.7" });
22371
22770
  const auth = getAuth();
22372
22771
  registerMarketTools(server);
22373
22772
  registerPublicTools(server);
22374
22773
  registerStatsTools(server);
22774
+ registerSpreadTools(server);
22375
22775
  registerOutcomesTools(server);
22376
22776
  registerAccountTools(server, auth);
22377
22777
  registerTradingTools(server, auth);
22378
22778
  registerAlgoTools(server, auth);
22779
+ registerBotTools(server, auth);
22780
+ registerCopyTools(server, auth);
22379
22781
  registerFundingTools(server, auth);
22380
22782
  registerSubAccountTools(server, auth);
22381
22783
  registerFinanceTools(server, auth);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvip-mcp-server",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "OKX ecosystem MCP server — full API coverage for AI agents",
5
5
  "homepage": "https://hvip.one",
6
6
  "license": "MIT",