@bitget-ai/bitget-agent-skill 3.3.0 → 3.4.1
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.
- package/CHANGELOG.md +18 -0
- package/VERSION +1 -1
- package/package.json +1 -1
- package/scripts/install.js +7 -0
- package/skills/agentic/SKILL.md +268 -114
- package/skills/agentic-connect/SKILL.md +146 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ All notable changes to `bitget-agent-skill` are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.4.1] - 2026-10-30
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **`bitget-agentic` / `bitget-agentic-connect`** — clarify `mcp_auth` is client-side OAuth (not a server tool); login check uses `getAccountAssets` / `getDeductInfo`; add `guide` → `do_query` / `do_request_open_api` workflow; Claude Code add uses `-s user`; drop hard-coded third-party datahub URL and refresh-token TTL; connect skill is first-time only and defers to local agentic after setup.
|
|
12
|
+
|
|
13
|
+
## [3.4.0] - 2026-10-30
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- **`bitget-agentic-connect` skill** — first-time guide to install the local Agentic skill, connect remote MCP `https://agent.bitget.com/mcp`, run legacy MCP/API-key checks, and complete browser OAuth. Install with `--skill agentic-connect`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **`bitget-agentic` skill → 2.2.3** — rewritten for the cloud HTTP MCP (`guide` / `do_query` / `do_request_open_api`), legacy stdio MCP upgrade path, Cursor `CLIENT_ID`, and re-auth / trading / disconnect rules. No longer documents the old local `@bitget-ai/bitget-agent-mcp` OAuth flow.
|
|
20
|
+
|
|
21
|
+
## [3.3.1] - 2026-09-20
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- **`bitget-agentic` skill §6 optional MCP setup** — replaced the `upgrade-all` Skill Hub installer guidance (which pulls in `bitget-signal`/datahub) with the correct two-package split: A) `bitget-agent-cli` (`bgc`) + `bitget-agent-skill` (UTA skill) upgraded individually, no signal; B) cloud Market MCP (HTTP), unchanged. Aligned with the official onboarding guide's Step 1b.
|
|
25
|
+
|
|
8
26
|
## [3.3.0] - 2026-09-17
|
|
9
27
|
|
|
10
28
|
### Added
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitget-ai/bitget-agent-skill",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"packageManager": "pnpm@8.14.1",
|
|
5
5
|
"description": "Official Bitget AI skill — teaches Claude Code, Codex, and OpenClaw when and how to drive the Bitget Unified Trading Account (UTA / v3) API through the `bgc` CLI from natural language. Run `npx @bitget-ai/bitget-agent-skill` to deploy into your AI tool's skill directory.",
|
|
6
6
|
"type": "module",
|
package/scripts/install.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* npx bitget-agent-skill --target openclaw # OpenClaw only
|
|
12
12
|
* npx bitget-agent-skill --target claude,codex # multiple targets
|
|
13
13
|
* npx bitget-agent-skill --skill agentic # install the Agentic (OAuth) skill instead
|
|
14
|
+
* npx bitget-agent-skill --skill agentic-connect # first-time cloud MCP connect guide
|
|
14
15
|
* npx bitget-agent-skill --skill uta,agentic # install both skills
|
|
15
16
|
* npx bitget-agent-skill --skill all # install all skills
|
|
16
17
|
*/
|
|
@@ -47,6 +48,12 @@ const SKILLS = {
|
|
|
47
48
|
skillDirName: "bitget-agentic",
|
|
48
49
|
refFiles: [],
|
|
49
50
|
},
|
|
51
|
+
"agentic-connect": {
|
|
52
|
+
label: "Agentic first-time MCP connect guide",
|
|
53
|
+
skillSrcDir: join(PKG_ROOT, "skills", "agentic-connect"),
|
|
54
|
+
skillDirName: "bitget-agentic-connect",
|
|
55
|
+
refFiles: [],
|
|
56
|
+
},
|
|
50
57
|
};
|
|
51
58
|
|
|
52
59
|
// Skill destinations per AI tool
|
package/skills/agentic/SKILL.md
CHANGED
|
@@ -1,191 +1,345 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bitget-agentic
|
|
3
3
|
description: >
|
|
4
|
-
Use for Bitget Agentic account
|
|
5
|
-
Invoke when the user connects an Agentic
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"Bitget". Chinese triggers: 连接 Agent
|
|
9
|
-
子账户、Agent 账户、AI 账户、智能交易账户、Key 失效、连不上、
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
Use for Bitget Agentic account on the remote MCP https://agent.bitget.com/mcp
|
|
5
|
+
(OAuth token, not local API keys). Invoke when the user connects an Agentic
|
|
6
|
+
account, re-authorizes, says Connect Agent, reports auth expired, cannot trade,
|
|
7
|
+
or trades or queries an account via that remote MCP — even without saying
|
|
8
|
+
"Bitget". Chinese triggers: 连接 Agent、重新授权、同意升级到新版MCP、Agentic 账户、
|
|
9
|
+
Agent 子账户、Agent 账户、AI 账户、智能交易账户、Key 失效、连不上、
|
|
10
|
+
Connect Agent、帮我下单、查 Agentic 余额/持仓. Do NOT use for UTA env API keys,
|
|
11
|
+
@bitget-ai/bitget-signal (including its market-data MCP), bgc, a local MCP filled
|
|
12
|
+
with BITGET_API_KEY / BITGET_SECRET_KEY / BITGET_PASSPHRASE, or the old
|
|
13
|
+
local stdio package @bitget-ai/bitget-agent-mcp. npm and npx are
|
|
14
|
+
install channels, not the old edition.
|
|
15
|
+
After install, this file covers later chats (prefer this over
|
|
16
|
+
bitget-agentic-connect once MCP is already connected). The online connect
|
|
17
|
+
guide is only for first-time setup. Server tools are guide, do_query, and
|
|
18
|
+
do_request_open_api only — mcp_auth is a client-side OAuth entry (Cursor),
|
|
19
|
+
not a server tool. If those three tools are missing, reconnect the remote
|
|
20
|
+
MCP before OAuth. Do not invent an auth link.
|
|
13
21
|
metadata:
|
|
14
|
-
version:
|
|
22
|
+
version: 2.2.6
|
|
15
23
|
author: Bitget
|
|
16
|
-
updated: 2026-
|
|
24
|
+
updated: 2026-11-10
|
|
17
25
|
requires:
|
|
18
26
|
bins: ["node", "npx"]
|
|
19
27
|
node: ">=20"
|
|
20
28
|
packages:
|
|
21
|
-
mcp: "
|
|
29
|
+
mcp: "https://agent.bitget.com/mcp"
|
|
22
30
|
license: MIT
|
|
23
31
|
---
|
|
24
32
|
|
|
25
|
-
# Bitget Agentic ·
|
|
33
|
+
# Bitget Agentic · Local Skill
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
Cloud MCP: `https://agent.bitget.com/mcp` (formerly called Agent sub-account). The login state is an OAuth token kept on this cloud MCP connection. Do not copy the token into this file or save a separate copy.
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
**The server has only three tools:** `guide`, `do_query`, `do_request_open_api`.
|
|
38
|
+
**`mcp_auth` is not a server tool** — it is the client-side entry (Connect / Authenticate) that Cursor and similar clients use to start OAuth against this MCP. Do not `tools/call` a tool named `mcp_auth` on the remote. On Claude Code and other clients without that entry, use an unauthorized / HTTP 401 response from a private `do_request_open_api` call to trigger client OAuth, or follow that client's MCP login flow.
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
The online connect guide (`bitget-agentic-connect`) only covers first-time install, connecting the cloud MCP, and the first authorization. This file stays in effect after install; for re-authorization, trading, and disconnect after MCP is already connected, follow this file — do not hand off to the connect guide again.
|
|
41
|
+
|
|
42
|
+
If this chat was just told to read this file after install: read the whole file first, not only the opening. Do not send the user to another chat before you finish reading.
|
|
43
|
+
|
|
44
|
+
Only skip OAuth when the user explicitly says not to authorize. Saying “just check the market first” is not a refusal. Market data can be queried without login.
|
|
32
45
|
|
|
33
46
|
---
|
|
34
47
|
|
|
35
|
-
##
|
|
48
|
+
## Rules
|
|
36
49
|
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
50
|
+
- Market data can be queried without login. Trading, account, Reality / rToken require login. Check with `guide` before calling; if an interface is not available, say so.
|
|
51
|
+
- Do not: withdraw, transfer from main account to sub-account, change main-account email / phone / 2FA. US stock direct, CFD, tax, staking/lending, and institutional lending are not connected.
|
|
52
|
+
- Do not issue or paste API Keys, and do not configure `BITGET_API_*`. One Agentic account can authorize only one Agent, and one Agent can connect only one Agentic account — rebinding (the same Agent to a new account, or another Agent to an already-authorized account) replaces the previous authorization (existing monitored orders may stop working — you must warn the user).
|
|
53
|
+
- Agentic accounts created by the old SDK / npm cannot use the new OAuth: selecting an existing sub-account on the auth page will fail. The first time the user uses the new OAuth, guide them to create a new account — do not pick an old one. If the account was already created or connected via the new OAuth, it can be reused on re-authorization.
|
|
54
|
+
- Multiple Agents can run at once, each bound to its own sub-account, to manage multiple Agent sub-accounts; if the user wants one Agent to manage multiple sub-accounts, tell them to [join the group and feedback to the product team](https://telegram.me/+o1tYqQ_lXxllYjgy).
|
|
55
|
+
- Disconnect on the web at “Sub-account management” → “Disconnect Agent”, not the API Key list.
|
|
56
|
+
- Authorization is opened by the **client** against this MCP (Cursor uses `mcp_auth` / Connect). Do not invent an authorization link. When opening OAuth, match the current client against the “Supported client_id” list below; do not assemble an authorization link yourself, and do not change `redirect_uri`.
|
|
57
|
+
- Do not proactively use legacy capabilities, and do not remind about them in every chat. Only when the user is about to use them, tell them to avoid them and clear the related config themselves. Do not edit config for the user, and do not assume a fixed config path. Do not use npm / npx to mean “legacy”. The following are **not** legacy under Section 2 — do not treat them as legacy or block OAuth because of them:
|
|
45
58
|
|
|
46
|
-
|
|
59
|
+
- Terminal CLI `bgc` (`@bitget-ai/bitget-agent-cli`)
|
|
60
|
+
- UTA skill without `--skill agentic`. The package name is still `@bitget-ai/bitget-agent-skill`; it is a skill that uses manual API keys, not MCP
|
|
61
|
+
- `@bitget-ai/bitget-signal` and its bundled market-data MCP (not this Agentic cloud MCP)
|
|
62
|
+
- `npx @bitget-ai/bitget-agent-installer upgrade-all` (also installs signal and its market-data MCP)
|
|
63
|
+
- `--target all` only installs the skill on multiple clients; it is not a legacy capability
|
|
64
|
+
- Whether the token is valid is judged by unauthorized errors from the MCP (private call failure / HTTP 401). Do not memorize a TTL, and do not call it an API Key expiry.
|
|
65
|
+
- Logged-in check: a successful `do_request_open_api` call with a read-only account `operation_id` is enough — prefer `getAccountAssets`, or use `getDeductInfo`. A wrong Cursor `auth.CLIENT_ID` (not `cursor`) causes auth anomalies: the flow finishes but still shows not logged in or 403.
|
|
66
|
+
- If the user shows clear product-level confusion or questions (not operational details this doc can cover), you may suggest they [join the group to feedback to the product team](https://telegram.me/+o1tYqQ_lXxllYjgy).
|
|
67
|
+
|
|
68
|
+
Safety first, then state clarity, then response speed.
|
|
47
69
|
|
|
48
|
-
|
|
70
|
+
---
|
|
49
71
|
|
|
50
|
-
|
|
72
|
+
## Call surface (guide first, then execute)
|
|
51
73
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
```
|
|
75
|
+
Market: guide(surface="market_data") → … → entry_id → do_query(entry_id, params)
|
|
76
|
+
Trade/account: guide(surface="open_api") → … → operation_id
|
|
77
|
+
→ do_request_open_api(operation_id, params)
|
|
78
|
+
Writes: dry_run=true first for a confirmation card → user clearly says “yes/confirm” → then confirm=true
|
|
79
|
+
```
|
|
57
80
|
|
|
58
|
-
|
|
81
|
+
If the id is uncertain, you must `guide` first — do not guess `entry_id` / `operation_id`.
|
|
59
82
|
|
|
60
83
|
---
|
|
61
84
|
|
|
62
|
-
##
|
|
85
|
+
## 1. Authorization
|
|
86
|
+
|
|
87
|
+
First check whether this chat can use the three cloud MCP tools (at least `guide`). If none are visible, follow “Tools not in this chat” below and stop here — this is a connection problem, not an authorization failure. Do not invent an auth link, do not install `@bitget-ai/bitget-agent-mcp`, and do not reinstall this skill.
|
|
63
88
|
|
|
64
|
-
|
|
89
|
+
If the tools are already in this chat: use one read-only account call to check login, for example:
|
|
65
90
|
|
|
66
91
|
```
|
|
67
|
-
|
|
68
|
-
→ 立即调 MCP authorize_start → 用 Bash 打开 authorizeUrl(勿只贴文本让用户复制)
|
|
69
|
-
→ 调 MCP authorize_wait → App 设备鉴权 → 确认已授权
|
|
92
|
+
do_request_open_api(operation_id="getAccountAssets", params={})
|
|
70
93
|
```
|
|
71
94
|
|
|
72
|
-
|
|
73
|
-
- macOS: `open "<authorizeUrl>"`
|
|
74
|
-
- Linux: `xdg-open "<authorizeUrl>"`
|
|
75
|
-
- Windows: `start "" "<authorizeUrl>"`
|
|
95
|
+
(You may also use `getDeductInfo`.) If it succeeds, the user is logged in — no re-authorization. If not logged in, or a private call returns unauthorized / 401, follow this order:
|
|
76
96
|
|
|
77
|
-
|
|
97
|
+
1. Run the Section 2 check. If legacy is found, give the cleanup/upgrade reminder first — you do not need to wait for the user to reply “agree to upgrade” before continuing, unless they explicitly say they do not want to upgrade or deal with legacy, in which case stop.
|
|
98
|
+
2. Tell the user: re-authorizing will replace the old token on this cloud MCP connection; please handle positions and open orders first.
|
|
99
|
+
3. Open client authorization per Section 3. Tell the user a browser will open to finish auth — no need to copy an API Key. Do not fill in passwords for them.
|
|
100
|
+
4. Confirm login again with `getAccountAssets` (or `getDeductInfo`). Finishing the page is not enough. After confirmation, tell the user:
|
|
78
101
|
|
|
79
|
-
|
|
102
|
+
> Authorization complete. An API Key will not be sent to you. Login state stays on the cloud MCP connection — you do not need to hand me any secret.
|
|
80
103
|
|
|
81
|
-
|
|
104
|
+
When the user wants to disconnect or remove an old API Key, use the exact wording in Section 6 — do not write a separate version here.
|
|
82
105
|
|
|
83
|
-
|
|
106
|
+
### Tools not in this chat
|
|
84
107
|
|
|
85
|
-
|
|
108
|
+
This chat cannot see `guide` / `do_query` / `do_request_open_api`. The address may not be registered in the current client's MCP config yet, or it is registered but this chat has not picked it up. Register/confirm as below, and try `guide()` in this chat — do not assume a new chat is always required.
|
|
109
|
+
**Do not** use “whether `mcp_auth` exists” as the only criterion — if there is no client auth entry but the three server tools are present, MCP is connected and only OAuth is needed.
|
|
86
110
|
|
|
87
|
-
|
|
111
|
+
There is only one address: `https://agent.bitget.com/mcp`. Do not change this domain, and do not configure `BITGET_API_*`.
|
|
88
112
|
|
|
89
|
-
|
|
113
|
+
If not registered yet, the Agent registers it directly. Clients that can configure MCP themselves (Claude Code / Cursor / Codex) write the address into MCP config; clients with a native connector (e.g. ChatGPT / Dot, Grok Bot) can start authorization directly without manually adding the address:
|
|
90
114
|
|
|
91
|
-
|
|
115
|
+
- Claude Code: `claude mcp add -s user bitget-mcp-server --transport http https://agent.bitget.com/mcp`, then quit and reopen `claude` (Claude has no Cursor-style `CLIENT_ID` setting)
|
|
116
|
+
- Cursor: the Agent writes the HTTP server config into `~/.cursor/mcp.json` (merge with existing servers — do not overwrite the whole file), URL as above, `auth.CLIENT_ID` set to `cursor` (uppercase CLIENT_ID). After writing, the tool usually appears in the current chat right away
|
|
117
|
+
- Codex (CLI / Desktop): in the terminal run `codex mcp add bitget-mcp-server --url https://agent.bitget.com/mcp --oauth-client-id codex` to add the server, then `codex mcp login bitget-mcp-server` to finish OAuth; Codex CLI and the desktop app share the same `~/.codex/config.toml` and login state — after auth, open the Codex/ChatGPT desktop app and it shows connected; no extra “Connect” click in the UI. **Codex has specific pitfalls — read “Codex connection notes” below before proceeding.**
|
|
118
|
+
- Other clients: if the client has a custom MCP entry, register the same address its way and try once in this chat; if it has no custom MCP entry but has a native connector or auth entry (e.g. ChatGPT / Dot, Grok Bot), start client-side authorization directly — do not treat “cannot add the URL” as unsupported, and do not ask the user to switch clients
|
|
92
119
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"mcpServers": {
|
|
123
|
+
"bitget-mcp-server": {
|
|
124
|
+
"url": "https://agent.bitget.com/mcp",
|
|
125
|
+
"auth": { "CLIENT_ID": "cursor" }
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
98
130
|
|
|
99
|
-
|
|
131
|
+
After registration, try `guide()` in this chat first, plus (if the client provides one) the auth entry for this MCP. In most cases the connection becomes available in this chat immediately — no new chat needed. If tools are still missing, the most common cause is that the config still has the old local stdio MCP package `@bitget-ai/bitget-agent-mcp`, or a local MCP with hand-filled API Keys — technically old and new can sit in the same config without error (soft conflict), but product-wise only one set is recognized, and the old one blocks the new connection (hard conflict). Explain clearly and guide cleanup — do not just say “check again”. Only after confirming there is no such legacy residue and tools are still missing should you ask the user to open a new chat and request authorization or trading again. The new chat will read this file and start from Section 1. Do not copy install steps from the online guide.
|
|
100
132
|
|
|
101
|
-
|
|
133
|
+
---
|
|
102
134
|
|
|
103
|
-
|
|
104
|
-
|--------|------|------|
|
|
105
|
-
| `NOT_AUTHORIZED`(A 未授权要交易) | 调 OAuth | 「需要先完成 Agentic 授权,我来打开浏览器。」 |
|
|
106
|
-
| `AUTH_CANCELLED`(B 用户取消) | 再调 OAuth | 「这次没保存凭证,要我再试一次吗?」 |
|
|
107
|
-
| `CREDENTIALS_INVALID`(D Web 删 Key / Key 失效) | 调 OAuth | 「Key 已在服务端失效,需重新授权。」 |
|
|
108
|
-
| `RATE_LIMITED`(N 限流) | 退避 | 「请求过快,稍后再试。」**勿** OAuth |
|
|
109
|
-
| `INSUFFICIENT_BALANCE`(O 余额不足) | 引导 Web 划转 | 「请在 Web 从主账户划转到 Agentic 账户。」 |
|
|
110
|
-
| `MCP_CONNECTION_ERROR`(M MCP 未启动) | 排查 MCP | 「MCP 未运行,请检查 Node 20+ 与 MCP 配置。」 |
|
|
111
|
-
| 配额错误码(K 配额满) | Use existing | 「Agentic 账户已满,请选已有账户。」 |
|
|
112
|
-
| KYC 错误码(L KYC 未完成) | 完成后再 OAuth | 「请先完成 KYC。」 |
|
|
113
|
-
| 工具不存在 / 方法不存在(M2 MCP 未安装/未注册) | 引导安装并注册 | 「MCP 工具不存在:请运行 npm i -g @bitget-ai/bitget-agent-mcp 安装,再在客户端注册(如 Claude Code 执行 claude mcp add bitget-agentic -- npx -y @bitget-ai/bitget-agent-mcp),然后重启会话或用 /mcp 重连。」 |
|
|
135
|
+
## 2. Legacy quick check
|
|
114
136
|
|
|
115
|
-
|
|
116
|
-
> 「授权未完成。请确认浏览器授权步骤已完成,要我再发起一次吗?」
|
|
137
|
+
Before opening the auth window, glance once — no state file, no need to remember across chats; just look at where the current client stores MCP config. Hitting either of the following counts as legacy:
|
|
117
138
|
|
|
118
|
-
|
|
139
|
+
- Config starts `@bitget-ai/bitget-agent-mcp` via local stdio
|
|
140
|
+
- This MCP config has hand-filled `BITGET_API_KEY` / `BITGET_SECRET_KEY` / `BITGET_PASSPHRASE`
|
|
119
141
|
|
|
120
|
-
|
|
142
|
+
Legacy and the new cloud MCP can technically coexist in the same config without erroring (soft conflict), but product-wise only one set is recognized — keeping both causes call confusion (hard conflict). If legacy is still present, only use the three tools of the new cloud MCP (and the client's auth entry for this MCP); do not touch tools from the old stdio MCP, and do not use API Keys left by the old setup.
|
|
121
143
|
|
|
122
|
-
|
|
144
|
+
Not legacy: only the cloud address `https://agent.bitget.com/mcp` is configured; `@bitget-ai/bitget-agent-skill` is a skill. bgc, bitget-signal, its market-data MCP, upgrade-all, and UTA skill without `--skill agentic` from the Rules are also not legacy — do not treat them as legacy or block OAuth because of them.
|
|
123
145
|
|
|
124
|
-
|
|
125
|
-
|------|------|------|
|
|
126
|
-
| C 浏览器成功但 MCP 未收到 | 再调 OAuth | Agent 只能看到"回调未收到",不能确认浏览器是否真成功;无明确错误码时走兜底 |
|
|
127
|
-
| E Web 有 Key 本机无 | 调 OAuth | 「Web 已连上不等于本机 Agent;请重新授权,不要复制 Key。」 |
|
|
128
|
-
| G Key 归零 | 调 OAuth | 「Agentic 账户已断链,需完整重新授权。」 |
|
|
129
|
-
| P 云端 Agent | 告知用户后结束,不触发 OAuth | 「云端流程暂未开放,`[待填:resource endpoint]` 定义中;请先使用本地客户端。」 |
|
|
130
|
-
| Q 历史户 / V Playbook / W 手填 Key / T 多 Agent / X 0 余额 | `[待填:各场景处理规则]` | 规则待补充,运行时不要自行假设处理方式 |
|
|
131
|
-
| R bitget.com 网络不可达 | 排查代理后 OAuth | 「当前网络可能无法访问 bitget.com。我先检查本机 VPN/代理…」→ §5 |
|
|
146
|
+
Which npm package was installed on this machine, or whether `npm list` / `npm view` was run, cannot be used as evidence — do not look them up online or run those commands; only look at the two config checks above. Do not assume a fixed config path, and do not edit config for the user.
|
|
132
147
|
|
|
133
|
-
|
|
148
|
+
If you cannot find the config location, do not assume there is no legacy. Tell the user you could not find it, and ask them to confirm whether this machine still has the old local stdio MCP package `@bitget-ai/bitget-agent-mcp` or a local MCP with hand-filled API Keys. If they confirm there is none, continue with the new flow; if they are unsure or say there is still legacy, give the reminder below.
|
|
134
149
|
|
|
135
|
-
|
|
150
|
+
If legacy is still present, send the user the following and continue to Section 3 — you do not need an explicit “agree to upgrade” reply before opening the auth window; only stop and do not start OAuth if the user explicitly says they do not want to upgrade or deal with legacy.
|
|
136
151
|
|
|
137
|
-
|
|
138
|
-
|
|
152
|
+
> This computer's MCP config still has the old local stdio MCP package (@bitget-ai/bitget-agent-mcp), or a local MCP with hand-filled API Keys. Old and new cannot be used together — please clear the old config soon and upgrade to this cloud version, which uses OAuth login and no longer issues or requires hand-filled API Keys. Clearing old config is on you; I will not edit config files for you.
|
|
153
|
+
>
|
|
154
|
+
> Agentic accounts created by the old SDK / npm are not compatible with the new OAuth — selecting an existing sub-account on the auth page will fail. After the auth window opens, create a new account the first time you use the new OAuth — do not pick an old account. If you already connected an account with the new OAuth before and this is only a re-authorization, reuse that account. If the account list is full, delete a few unused old accounts first, then create a new one.
|
|
155
|
+
>
|
|
156
|
+
> Before continuing authorization, please finish handling positions and open orders in the old account, so monitoring and pending orders do not silently fail after the upgrade.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 3. Open authorization (client)
|
|
161
|
+
|
|
162
|
+
Start client OAuth against this MCP — do not only send a link, and do not assemble an authorize URL yourself.
|
|
163
|
+
|
|
164
|
+
1. **Cursor:** call client `mcp_auth` on this MCP (or click Connect / Authenticate). Run only one round for the whole flow; do not keep clicking Authenticate / reconnect. Log in on the browser tab that opened this time. If you see “Authorization session ended” and the callback URL already has `code`, the old session was invalidated — start one fresh round only.
|
|
165
|
+
2. **Codex (CLI / Desktop):** use `codex mcp login bitget-mcp-server` to trigger and finish auth (same role as Connect). The CLI opens the browser OAuth window and handles the local callback; log in on the tab that opened this time. CLI and desktop share the login state — after login the desktop app shows connected. (Pitfalls: see “Codex connection notes” below.)
|
|
166
|
+
3. No window popped but a link was returned: open it with whatever the current environment uses to open a browser.
|
|
167
|
+
4. The command also failed: send the link as returned, and explain that this environment has no permission to open a window.
|
|
168
|
+
5. **Clients without `mcp_auth`:** first make one private read-only call (e.g. `getAccountAssets`); if it returns unauthorized / 401, complete MCP login per that client's docs; if there is still no entry, ask the user to log in to that server in the client's MCP settings. Clients with a native connector or auth entry (e.g. ChatGPT / Dot, Grok Bot) can start authorization directly without manually adding the MCP address — do not treat “cannot add the URL” as unsupported, and do not ask the user to switch clients.
|
|
169
|
+
|
|
170
|
+
Use the link exactly as returned by the tool/client — do not rewrite it, and do not change Bitget domains in the user prompt.
|
|
171
|
+
|
|
172
|
+
**Supported client_id values:** when opening OAuth, match the current client from the list below. The authorization window is still opened by the cloud MCP / client-side auth. Do not fabricate an authorization link, and do not change `redirect_uri`.
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
[
|
|
176
|
+
{
|
|
177
|
+
"client_id": "https://claude.ai/oauth/claude-code-client-metadata",
|
|
178
|
+
"client_name": "Claude Code",
|
|
179
|
+
"redirect_uris": [
|
|
180
|
+
"http://localhost/callback"
|
|
181
|
+
],
|
|
182
|
+
"loopback_port_agnostic": true,
|
|
183
|
+
"fetch_cimd": false
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"client_id": "https://claude.ai/oauth/mcp-oauth-client-metadata",
|
|
187
|
+
"client_name": "Claude / Duet",
|
|
188
|
+
"redirect_uris": [
|
|
189
|
+
"https://claude.ai/api/mcp/auth_callback"
|
|
190
|
+
],
|
|
191
|
+
"loopback_port_agnostic": false,
|
|
192
|
+
"fetch_cimd": true
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"client_id": "https://chatgpt.com/oauth/client.json",
|
|
196
|
+
"client_name": "ChatGPT / Dot",
|
|
197
|
+
"redirect_uris": [
|
|
198
|
+
"https://chatgpt.com/connector_platform_oauth_redirect"
|
|
199
|
+
],
|
|
200
|
+
"redirect_uri_prefixes": [
|
|
201
|
+
"https://chatgpt.com/connector/oauth/"
|
|
202
|
+
],
|
|
203
|
+
"loopback_port_agnostic": false,
|
|
204
|
+
"fetch_cimd": false
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"client_id": "cursor",
|
|
208
|
+
"client_name": "Cursor",
|
|
209
|
+
"redirect_uris": [
|
|
210
|
+
"https://www.cursor.com/agents/mcp/oauth/callback",
|
|
211
|
+
"https://www.cursor.com/bot/mcp/oauth/callback",
|
|
212
|
+
"https://grok.com/connectors-oauth-exchange-code/"
|
|
213
|
+
],
|
|
214
|
+
"loopback_port_agnostic": false,
|
|
215
|
+
"fetch_cimd": false
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"client_id": "https://cursor.com/oauth/mcp-client.json",
|
|
219
|
+
"client_name": "Cursor CIMD / Grok Bot",
|
|
220
|
+
"redirect_uris": [
|
|
221
|
+
"https://www.cursor.com/agents/mcp/oauth/callback",
|
|
222
|
+
"https://www.cursor.com/bot/mcp/oauth/callback",
|
|
223
|
+
"https://grok.com/connectors-oauth-exchange-code/"
|
|
224
|
+
],
|
|
225
|
+
"loopback_port_agnostic": false,
|
|
226
|
+
"fetch_cimd": true
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"client_id": "codex",
|
|
230
|
+
"client_name": "OpenAI Codex",
|
|
231
|
+
"redirect_uris": [
|
|
232
|
+
"http://localhost/callback"
|
|
233
|
+
],
|
|
234
|
+
"loopback_port_agnostic": true,
|
|
235
|
+
"fetch_cimd": false
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"client_id": "muse",
|
|
239
|
+
"client_name": "Meta Muse",
|
|
240
|
+
"redirect_uris": [
|
|
241
|
+
"https://agent.meta.ai/api/hatch/oauth/callback"
|
|
242
|
+
],
|
|
243
|
+
"loopback_port_agnostic": false,
|
|
244
|
+
"fetch_cimd": false
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"client_id": "minimax",
|
|
248
|
+
"client_name": "MiniMax Code",
|
|
249
|
+
"redirect_uris": [
|
|
250
|
+
"http://localhost/callback",
|
|
251
|
+
"http://localhost/auth/callback"
|
|
252
|
+
],
|
|
253
|
+
"loopback_port_agnostic": true,
|
|
254
|
+
"fetch_cimd": false
|
|
255
|
+
}
|
|
256
|
+
]
|
|
139
257
|
```
|
|
140
258
|
|
|
141
|
-
|
|
142
|
-
「直接帮我做」≠ 预授权。用户必须明确回复确认后才执行。
|
|
259
|
+
### Codex connection notes (Codex only; other clients skip this subsection and go to Section 4)
|
|
143
260
|
|
|
144
|
-
|
|
261
|
+
This subsection applies only to Codex / Codex App. Other clients (Cursor, Claude Code, etc.) skip it and continue at Section 4 below.
|
|
145
262
|
|
|
146
|
-
|
|
263
|
+
Version requirement: Codex ≥ 0.147 (`codex --version`; upgrade first if lower).
|
|
147
264
|
|
|
148
|
-
|
|
265
|
+
Codex callbacks are loopback and must use `localhost` + a fixed port (both places must match): `127.0.0.1` returns 403; `localhost` without a port shows `localhost refused to connect`. `codex mcp add` defaults to `127.0.0.1` — change it to:
|
|
149
266
|
|
|
150
|
-
|
|
267
|
+
```toml
|
|
268
|
+
[mcp_servers.bitget-mcp-server]
|
|
269
|
+
url = "https://agent.bitget.com/mcp"
|
|
151
270
|
|
|
152
|
-
|
|
271
|
+
[mcp_servers.bitget-mcp-server.oauth]
|
|
272
|
+
client_id = "codex"
|
|
273
|
+
callback_url = "http://localhost:59999/callback"
|
|
274
|
+
callback_port = 59999
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
(59999 can be any free port; `callback_url` and `callback_port` must match.)
|
|
278
|
+
|
|
279
|
+
Login with a proxy (use the proxy actually found in Section 4):
|
|
153
280
|
|
|
154
|
-
|
|
281
|
+
`HTTPS_PROXY=<proxy> HTTP_PROXY=<proxy> codex mcp login bitget-mcp-server`
|
|
155
282
|
|
|
156
|
-
|
|
283
|
+
On the auth page, guide the user to: choose “Create a new Agentic account” → check the agreement boxes → click Authorize. **Do not choose “Use an existing account”** — accounts from the old SDK / npm will fail, and the CLI reports `invalid_request`.
|
|
157
284
|
|
|
158
|
-
|
|
285
|
+
Afterward verify with `getAccountAssets`; success means connected. If you first get `Authentication required`, wait a few seconds and retry.
|
|
159
286
|
|
|
160
|
-
|
|
161
|
-
2. **主动探测本机代理:** 查 `HTTP_PROXY` / `HTTPS_PROXY` / `ALL_PROXY`、系统代理、常见 VPN 本地端口(如 `127.0.0.1:7890`)。**有代理** → 配置 MCP/shell 走代理后**重新走 §2 授权流程**。
|
|
162
|
-
3. **无可用代理** → 提示用户开 VPN/代理访问 bitget.com;**等用户确认已开好**后再重新授权。
|
|
163
|
-
4. **禁止:** 未排查网络就反复 OAuth · 拼 URL 绕过 MCP · 让用户手填 Key。
|
|
287
|
+
CLI and App share `~/.codex/config.toml` and login state. The App ships with the codex CLI; after one login the App shows connected — no extra click needed.
|
|
164
288
|
|
|
165
|
-
|
|
289
|
+
> The above is the standard Codex path — follow it first. If the real situation differs (version, proxy port, errors, config path, etc.), the Agent may diagnose and adapt; do not get stuck on this subsection — the goal is to get the user connected, not to replay every step here.
|
|
166
290
|
|
|
167
291
|
---
|
|
168
292
|
|
|
169
|
-
##
|
|
293
|
+
## 4. Network
|
|
170
294
|
|
|
171
|
-
|
|
295
|
+
The auth page and callback need access to bitget.com. On timeout, ECONNREFUSED, ENOTFOUND, network, fetch failed, or if the user says Bitget will not open: check the proxy first — do not immediately treat it as an auth failure and retry.
|
|
172
296
|
|
|
173
|
-
|
|
297
|
+
Look at the proxy already active in the current environment — do not assume a specific port or config file. If there is a proxy, route the environment through it and reopen Section 3. If not, ask the user to enable one, wait for confirmation, then authorize. Do not have the user keep clicking Allow without checking the network, do not invent bitget.com links, and do not ask the user to hand-fill an API Key.
|
|
174
298
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## 5. Trading and market data
|
|
302
|
+
|
|
303
|
+
After login:
|
|
178
304
|
|
|
179
|
-
**
|
|
305
|
+
- **Market data:** `guide(surface="market_data", …)` → `do_query(entry_id, params)`
|
|
306
|
+
- **Trading / account / Reality:** `guide(surface="open_api", …)` → `do_request_open_api(operation_id, params)`
|
|
180
307
|
|
|
181
|
-
|
|
182
|
-
- **Cursor:** MCP 设置新增 HTTP server,URL `https://agent.bitget.com/mcp`
|
|
183
|
-
- **其他客户端:** 按 HTTP MCP 方式注册,endpoint `https://agent.bitget.com/mcp`
|
|
308
|
+
Writes: first `dry_run: true` for a confirmation card. After the user clearly replies “yes” or “confirm”, execute with `confirm: true`. High-risk writes (e.g. cancel all, close all, set leverage, repay) require `confirm: true`. “Just do it for me” is not confirmation.
|
|
184
309
|
|
|
185
|
-
|
|
310
|
+
Confirmation card: symbol, side, size, price type, account, mainnet, “Confirm execution?”. Check positions before closing. Include liquidation price when available. Do not add size on risk-type errors. If balance is insufficient, the user deposits on the web from the main account.
|
|
311
|
+
|
|
312
|
+
Batch place / cancel / modify (`batchOrder` / `batchCancel` / `batchModifyOrders`): `params` as a JSON array of order objects, or `{"orderList"|"orders": [...]}`.
|
|
186
313
|
|
|
187
314
|
---
|
|
188
315
|
|
|
189
|
-
##
|
|
316
|
+
## 6. Disconnect and delete old accounts
|
|
317
|
+
|
|
318
|
+
For disconnect, use this wording — do not click for the user:
|
|
319
|
+
|
|
320
|
+
> Please go to “Sub-account management” on the web and use “Disconnect Agent”. You must clear open orders before disconnecting. Funds can be transferred back in sub-account management; that step is not a prerequisite for disconnect.
|
|
321
|
+
|
|
322
|
+
Deleting an old API Key: the new version has no API Key, and you cannot delete a Key alone on the web. First get the name with `getAccountAssets` (or an equivalent read-only account call). If you cannot find it, say so — do not invent. If not logged in, authorize first — do not have the user delete blindly. After you have the name, use:
|
|
323
|
+
|
|
324
|
+
> To remove the old API Key for account “{name}”, you must first clear unfinished orders and transfer assets out, then manually delete this Agentic sub-account on the web. I cannot delete it for you.
|
|
325
|
+
|
|
326
|
+
---
|
|
190
327
|
|
|
191
|
-
|
|
328
|
+
## 7. Failures
|
|
329
|
+
|
|
330
|
+
| Situation | Action |
|
|
331
|
+
|-|-|
|
|
332
|
+
| Not logged in but wants to trade or query account | Section 1 |
|
|
333
|
+
| User cancelled, callback incomplete, reason unclear | “Authorization was not completed. Should I start again?” |
|
|
334
|
+
| Token invalid or disconnected on the web | Section 1 |
|
|
335
|
+
| Rate limited | Retry later; do not re-authorize |
|
|
336
|
+
| Insufficient balance | Have the user deposit on the web |
|
|
337
|
+
| All three server tools missing | Back to Section 1 “Tools not in this chat”. Do not invent a link, do not install `@bitget-ai/bitget-agent-mcp`, do not reinstall this skill |
|
|
338
|
+
| Account list full | Delete a few unused old accounts, then create a new one. Do not fall back to accounts created by the old SDK / npm (selecting them will fail) |
|
|
339
|
+
| Selecting an existing old account on the auth page fails | Guide the user to create a new account; old SDK / npm accounts cannot use the new OAuth |
|
|
340
|
+
| KYC incomplete | Wait for the user to finish |
|
|
341
|
+
| Cannot reach bitget.com | Section 4 |
|
|
342
|
+
| Device verification failed | Ask the user to confirm it is the same App account, then authorize again. This is not token expiry |
|
|
343
|
+
| Auth page returns JSON 422 missing OAuth params such as `response_type` / `client_id` / `redirect_uri` / `state` / `code_challenge` | Frontend login redirect dropped params — not an MCP failure; return to Section 3 for one fresh auth round; do not install the old stdio package or hand-fill an API Key |
|
|
344
|
+
|
|
345
|
+
Do not: silently switch login state, delete a sub-account for the user, edit config for the user, keep trading after expiry, start OAuth after the user explicitly said they do not want to upgrade or deal with legacy, only send a link without opening the auth window (except when there is no permission to open a window), invent an auth link when tools are missing, treat “no mcp_auth” and “tools missing” as the same failure, or `tools/call` a fabricated `mcp_auth` on the server.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bitget-agentic-connect
|
|
3
|
+
description: >
|
|
4
|
+
FIRST-TIME ONLY Bitget Agentic setup: install local bitget-agentic, connect
|
|
5
|
+
remote HTTP MCP https://agent.bitget.com/mcp, legacy MCP/API-key check, then
|
|
6
|
+
client OAuth. Invoke only when the user has not yet connected / is following
|
|
7
|
+
the online connection guide. Chinese triggers: 首次接入、第一次授权、安装并连接
|
|
8
|
+
云端 MCP、Agentic 账户开通. After MCP is connected and first login succeeds,
|
|
9
|
+
STOP using this skill — hand off to installed bitget-agentic for re-auth and
|
|
10
|
+
trading (do not compete on 「连接 Agent」 once setup is done). Server tools are
|
|
11
|
+
guide / do_query / do_request_open_api; mcp_auth is client-side OAuth (Cursor),
|
|
12
|
+
not a server tool.
|
|
13
|
+
metadata:
|
|
14
|
+
version: 1.0.1
|
|
15
|
+
author: Bitget
|
|
16
|
+
updated: 2026-10-30
|
|
17
|
+
requires:
|
|
18
|
+
bins: ["node", "npx"]
|
|
19
|
+
node: ">=20"
|
|
20
|
+
packages:
|
|
21
|
+
mcp: "https://agent.bitget.com/mcp"
|
|
22
|
+
skill: "@bitget-ai/bitget-agent-skill"
|
|
23
|
+
license: MIT
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# Bitget Agentic 账户 · 连接指南(仅首次)
|
|
27
|
+
|
|
28
|
+
**本文是什么:**首次接入指南。读完后按 Step 0–5 完成:装本地 `bitget-agentic` → 登记云端 MCP `https://agent.bitget.com/mcp` → 旧版快检 → 客户端 OAuth → 用账户只读调用确认已登录。不要手填 API Key,不要自己拼授权链接。
|
|
29
|
+
|
|
30
|
+
**服务端 tool 只有三个:** `guide`、`do_query`、`do_request_open_api`。
|
|
31
|
+
**`mcp_auth` 是客户端鉴权入口(Cursor),不是服务端 tool。**
|
|
32
|
+
|
|
33
|
+
**之后:**首次授权成功后本文使命结束;重新授权、交易、断连一律交给已热加载的本地 `bitget-agentic`(`npx @bitget-ai/bitget-agent-skill --skill agentic`)。旧版快检文案、交易规则、失败表以该文件为准,本文不重复维护。
|
|
34
|
+
|
|
35
|
+
只有用户明确说不要授权时,才不发起 OAuth。只说「先看行情」不算拒绝。
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 先看这几条
|
|
40
|
+
|
|
41
|
+
- 行情可不登录;交易 / 账户 / Reality 要 OAuth。先 `guide` 再调用。
|
|
42
|
+
- 不做:提现、主→子划转、改主账户安全设置;美股直连、CFD、税务、质押/机构借贷不接入。
|
|
43
|
+
- 登录态是 OAuth token(不是 API Key)。Agentic 账户与 Agent **1:1**;换绑会替换原授权(提醒用户处理挂单/监控)。
|
|
44
|
+
- 多 Agent 可各绑一个子账户;一个 Agent 管多子账户 → [进群反馈](https://telegram.me/+o1tYqQ_lXxllYjgy)。
|
|
45
|
+
- 产品困惑(非操作细节)也可提示同一进群链接。
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Step 0 · 装本地 skill 并热加载
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx @bitget-ai/bitget-agent-skill --target all --skill agentic
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
必须带 `--skill agentic`。装完后 **Agent 在本对话读取安装输出里的 `SKILL.md` 全文**(热加载),不要让用户去打开文件。与 Step 1 顺序不固定,但都要在本对话做完。
|
|
56
|
+
|
|
57
|
+
若读到的 skill 仍要求装 `@bitget-ai/bitget-agent-mcp` 或手填 Key,忽略那些步骤,按本文连云端 MCP。
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 1 · 连接云端 MCP
|
|
62
|
+
|
|
63
|
+
只登记:`https://agent.bitget.com/mcp`。不要配 `BITGET_API_*`。
|
|
64
|
+
|
|
65
|
+
- Claude Code:`claude mcp add -s user bitget-mcp-server --transport http https://agent.bitget.com/mcp`(无 Cursor 的 `CLIENT_ID`)
|
|
66
|
+
- Cursor:合并写入 `~/.cursor/mcp.json`(勿整份覆盖):
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"mcpServers": {
|
|
71
|
+
"bitget-mcp-server": {
|
|
72
|
+
"url": "https://agent.bitget.com/mcp",
|
|
73
|
+
"auth": { "CLIENT_ID": "cursor" }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- 其他客户端:按各自 HTTP MCP 方式填同一 URL。
|
|
80
|
+
|
|
81
|
+
写完后在本对话先试 `guide()`。多数情况立刻可用,不要默认要求新开对话。
|
|
82
|
+
仍看不到三个 tool 时:先查是否残留旧版 stdio `@bitget-ai/bitget-agent-mcp` 或手填 Key 的本地 MCP(软冲突可共存、产品上硬冲突)→ 引导用户自清理 → 仍不行再新开对话。新对话可发:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
我已经把 https://agent.bitget.com/mcp 写进本地 MCP 配置,但这个对话里还是调不到 guide / do_query / do_request_open_api。请检查是否还留着旧版 @bitget-ai/bitget-agent-mcp 或手填 API Key 的本地 MCP;有的话告诉我怎么清理,再确认新连接。
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Step 2 · 旧版快检
|
|
91
|
+
|
|
92
|
+
即将授权前看当前客户端 MCP 配置。命中即旧版:
|
|
93
|
+
|
|
94
|
+
- stdio 启动 `@bitget-ai/bitget-agent-mcp`
|
|
95
|
+
- 或配置了 `BITGET_API_KEY` / `BITGET_SECRET_KEY` / `BITGET_PASSPHRASE`
|
|
96
|
+
|
|
97
|
+
命中后:只用云端三个 tool + 客户端对本 MCP 的鉴权;把本地 `bitget-agentic` §2 里的升级提醒原文发给用户后即可进 Step 3(不必等「同意升级」)。用户明确拒绝升级则停止。
|
|
98
|
+
只配了云端 URL、或仅有 skill/bgc/signal 等,不算旧版、不拦 OAuth。不要用 `npm list` 判断。找不到配置路径时让用户自确认,不要默认「没有旧版」。
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Step 3 · 客户端授权
|
|
103
|
+
|
|
104
|
+
1. Cursor:对本 MCP 一轮 `mcp_auth` / Connect(勿连点)。有链接先本机打开浏览器,打不开再发原文。
|
|
105
|
+
2. 无 `mcp_auth`:先 `do_request_open_api(operation_id="getAccountAssets", params={})`;未授权 / 401 则按该客户端完成 MCP 登录。
|
|
106
|
+
3. 不改 Bitget 域名,不拼 authorize URL。出现「Authorization session ended」且回调已有 `code` → 旧会话作废,再走一轮即可。
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Step 4 · 网络(bitget.com)
|
|
111
|
+
|
|
112
|
+
超时 / ECONNREFUSED / ENOTFOUND / network / fetch failed / 打不开 Bitget → 先查已生效代理,再重试 Step 3;无代理则请用户开好后再授权。不要未查网络就反复点允许,不要手填 Key。
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Step 5 · 成功
|
|
117
|
+
|
|
118
|
+
已登录标志:客户端显示已登录,且例如:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
do_request_open_api(operation_id="getAccountAssets", params={})
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
成功(也可用 `getDeductInfo`)。页面走完不算。
|
|
125
|
+
|
|
126
|
+
> 授权完成。不会把 API Key 发给你。登录状态在云端 MCP 的连接里,不用把密钥交给我。
|
|
127
|
+
>
|
|
128
|
+
> 若要断开,到网页「子账户管理」使用「断开 Agent 连接」。断开前必须先处理未成交挂单。资金可以在子账户管理转回,这一步不是断开的前置条件。从主账户转入由你在网页完成。
|
|
129
|
+
|
|
130
|
+
然后 **只按已读过的本地 `bitget-agentic` 继续**(行情 `guide`→`do_query`,交易 `guide`→`do_request_open_api`)。不要把 token 写入 skill。删旧账户话术见本地 skill §6。
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 没成功
|
|
135
|
+
|
|
136
|
+
| 情况 | 动作 |
|
|
137
|
+
|-|-|
|
|
138
|
+
| 账户已满 | 授权页改选已有账户 |
|
|
139
|
+
| KYC 未完成 | 完成后再授权 |
|
|
140
|
+
| 三个 tool 都不在 | 回 Step 1;不要装旧 stdio 包 / 手填 Key;不必重装 skill |
|
|
141
|
+
| bitget.com 连不上 | Step 4 |
|
|
142
|
+
| 用户拒绝升级 | 停止 |
|
|
143
|
+
| 授权页 JSON 422,缺 OAuth 参数只剩 challenge/nonce | 前端丢参;清站点登录态后再一轮,或反馈前端 |
|
|
144
|
+
| token 换票 403 且返回 HTML | 多为 WAF;非应用层错误 |
|
|
145
|
+
|
|
146
|
+
无明确原因不要猜,问要不要再发起一次。
|