@bitget-ai/bitget-agent-skill 4.0.1 → 4.0.3

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 CHANGED
@@ -5,6 +5,40 @@ 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
+ ## [4.0.3] - 2026-11-19
9
+
10
+ Publish after agent-oauth-server and quant-data-platform with the roster of
11
+ connected agents are both live.
12
+
13
+ ### Added
14
+
15
+ - **Other agents on the account.** When a result carries `connectedAgents`, the agent tells the user who else is connected and points out any marked `new`. It leaves orders that carry another agent's `agentTag` alone. `getConnectedAgents` lists every connection with its last activity.
16
+ - **Removing an agent the user no longer uses:** `disconnectAgent` with that agent's `agentTag`.
17
+ - **Saying why a call is unauthorized.** The server now says whether the agent was disconnected by the user, by another agent, for being unused, and so on; the agent passes that on before offering to authorize again.
18
+ - **Evaluation scenarios** for the three cases above.
19
+
20
+ ### Fixed (from running real Codex sessions through the onboarding prompt)
21
+
22
+ - **`codex mcp add` already starts the login** in recent Codex versions and opens the browser. The skill told the agent to run `codex mcp login` after it, which made the first link useless. It now says to let that login finish.
23
+ - **Codex waits about five minutes** for the callback. The Codex notes say so, and to start a new login and use only the new link after a timeout.
24
+ - **Headless Codex:** `codex mcp login --no-browser` prints the link and takes the address the browser ends on. This replaces the instructions to run the login in the background and request the callback by hand.
25
+ - **One link at a time:** after a retry, the user is asked to close older authorization tabs, which look the same but no longer work.
26
+ - **A target the installer could not write to** (for example `~/.agents/skills` inside the Codex sandbox) is now treated as not installed: the agent runs the installer again with permission, or tells the user.
27
+
28
+ ## [4.0.2] - 2026-11-19
29
+
30
+ Publish after quant-data-platform with `disconnectAgent` and agent-oauth-server
31
+ without the one-client-per-account rule are both live.
32
+
33
+ ### Changed
34
+
35
+ - **Several agents can be connected to one Agentic account.** The server no longer refuses a second client. The account rules, the authorization notes and the FAQ say so, and the row for "already connected to another agent" is gone from the failure table.
36
+ - **Disconnecting is done by the agent.** When the user asks, the agent explains what it does and calls `do_request_open_api(operation_id="disconnectAgent", confirm=true)`. It ends that agent's authorization only; orders, positions and other agents are not affected. The skill no longer sends the user to the Bitget website to disconnect.
37
+
38
+ ### Added
39
+
40
+ - **Evaluation scenarios** for disconnecting through the agent, for an account shared with another agent, and for not disconnecting in response to an error.
41
+
8
42
  ## [4.0.1] - 2026-11-18
9
43
 
10
44
  Corrections from the first days of 4.0.0 in real clients and from the server's
package/README.md CHANGED
@@ -32,13 +32,29 @@
32
32
 
33
33
  ## Quick Start
34
34
 
35
- Paste this into your AI agent (requires Node.js 20+):
35
+ Copy this to your AI agent:
36
36
 
37
37
  ```prompt
38
- Please set up Bitget for me: 1. Run npx @bitget-ai/bitget-agent-skill@latest --target all and read the installed SKILL.md; 2. Follow it to connect the MCP https://agent.bitget.com/mcp and open the authorization page. Tell me when it is done.
38
+ Connect me to Bitget through its MCP server: https://agent.bitget.com/mcp
39
+
40
+ If you can run shell commands, first install the official skill with
41
+ `npx @bitget-ai/bitget-agent-skill@latest --target all`, read the SKILL.md
42
+ it prints, and follow it. If you can't, tell me how to add that URL as an
43
+ MCP server or connector in this app.
44
+
45
+ Then start authorization. I will log in and approve in my browser. This
46
+ flow has no API keys, so don't ask me for one.
47
+
48
+ You are done when a read-only account call succeeds. Show me my balance.
39
49
  ```
40
50
 
41
- A browser window opens for you to log in to Bitget and approve. You never copy an API key.
51
+ What to expect:
52
+
53
+ - A Bitget page opens in your browser. You log in, pick or create an Agentic account, and approve.
54
+ - You are never asked for an API key. If an agent or a page asks for one, stop.
55
+ - To disconnect later, tell your agent "disconnect from Bitget".
56
+
57
+ Installing the skill needs Node.js 20 or later. An AI app that cannot run commands only needs the MCP address added as a connector; the server itself tells the agent how to sign in, trade safely and disconnect.
42
58
 
43
59
  **Verify it worked.** Ask your AI: *"Show my Bitget Agentic account assets."* If it returns your balances, you are connected.
44
60
 
@@ -146,7 +162,7 @@ Any client that supports MCP with OAuth can connect. `references/authorization.m
146
162
  - **No API keys on your machine.** You approve access in the browser; the skill never asks you to create, paste, or store a key.
147
163
  - **The skill files are inert.** Plain Markdown with no runtime process and no network access.
148
164
  - **Scoped to an Agentic sub-account.** Withdrawals and main ↔ sub-account transfers are not exposed to the agent.
149
- - **You can revoke at any time.** On the Bitget website go to "Sub-account management" → "Disconnect Agent". Clear open orders first. This ends every login on that account.
165
+ - **You can disconnect at any time.** Tell your AI "disconnect from Bitget". It ends that agent's authorization at once; open orders and positions stay on the account, and other agents connected to it keep working.
150
166
 
151
167
  ---
152
168
 
@@ -195,13 +211,13 @@ npx @bitget-ai/bitget-agent-skill@latest --target all
195
211
  The skill instructs the AI to preview every write, show you a confirmation card, and wait for your clear "yes" before executing.
196
212
 
197
213
  **Do I need an API key?**
198
- No. Access is granted through browser authorization and can be revoked on the Bitget website.
214
+ No. Access is granted through browser authorization and can be ended at any time by asking your AI to disconnect.
199
215
 
200
216
  **Does the skill file need network access?**
201
217
  No. It is Markdown. All requests are made by your AI client to the cloud MCP.
202
218
 
203
219
  **Can I connect two AI clients to the same Agentic account?**
204
- Not two different clients. An account is connected to one client at a time, and a second client is refused until you disconnect the first on the Bitget website. Give each client its own Agentic account.
220
+ Yes. Each client authorizes separately and neither disconnects the other. Each agent checks positions and open orders on the exchange before it writes.
205
221
 
206
222
  **Can I still use `bgc` and the local API-key skill?**
207
223
  No. That edition is no longer supported. See [Upgrading from 3.x](#upgrading-from-3x).
package/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.1
1
+ 4.0.3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitget-ai/bitget-agent-skill",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "packageManager": "pnpm@8.14.1",
5
5
  "description": "Official Bitget AI skill — teaches Claude Code, Codex, Cursor, OpenClaw and other AI agents to connect the Bitget cloud MCP (https://agent.bitget.com/mcp), authorize a Bitget Agentic account with browser OAuth, and trade or query from natural language. No local API keys. Run `npx @bitget-ai/bitget-agent-skill` to deploy into your AI tool's skill directory.",
6
6
  "type": "module",
@@ -19,8 +19,8 @@ license: MIT
19
19
  compatibility: Requires an AI client that can connect remote HTTP MCP servers with OAuth, and network access to agent.bitget.com and bitget.com.
20
20
  metadata:
21
21
  author: "Bitget"
22
- version: "4.0.1"
23
- updated: "2026-11-18"
22
+ version: "4.0.3"
23
+ updated: "2026-11-19"
24
24
  mcp-server: "https://agent.bitget.com/mcp"
25
25
  ---
26
26
 
@@ -96,13 +96,19 @@ The server refuses high-risk writes (cancel all, close all, countdown cancel-all
96
96
 
97
97
  ## Account rules
98
98
 
99
- - **One Agentic account is connected to one client at a time.** While an account is connected to one client (for example Codex), authorizing a different client (for example Cursor) for that account is refused with "already connected to another agent". Nothing is replaced, and the first client keeps working. The user picks or creates another Agentic account for this client, or disconnects the first client on the website.
100
- - **Authorizing the same client again keeps the earlier login valid.** Two installs of the same client can therefore act on one account without seeing each other's chat. Check positions and open orders on the exchange before a write; do not rely on what you remember.
99
+ - **Several agents can be connected to one Agentic account.** Each one authorizes separately, and connecting another does not disconnect the ones already there. The user may also be trading by hand. So check positions and open orders on the exchange before a write; do not rely on what you remember, and do not assume an order you did not place is a mistake.
101
100
  - **This client holds one login.** Authorizing it for a different account switches this client to that account. Anything it was watching on the old account stops, so warn the user before you switch and never switch the login silently.
102
- - **Several agents can run at once,** each with its own Agentic account. If the user wants one agent to manage several accounts, or several clients on one account, point them to the [product feedback group](https://telegram.me/+o1tYqQ_lXxllYjgy). Use the same link for product-level questions this skill cannot answer.
103
- - **Disconnecting** happens on the Bitget website, not through the MCP, and you cannot do it for the user. It ends every login on that account. Tell them:
101
+ - If the user wants one agent to manage several accounts, point them to the [product feedback group](https://telegram.me/+o1tYqQ_lXxllYjgy). Use the same link for product-level questions this skill cannot answer.
102
+ - **Disconnecting is done here, by you.** When the user clearly asks to disconnect or log out of Bitget, say what will happen (this agent's authorization ends; open orders and positions stay on the account; other agents connected to it keep working), then call:
104
103
 
105
- > 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.
104
+ ```
105
+ do_request_open_api(operation_id="disconnectAgent", confirm=true)
106
+ ```
107
+
108
+ Do not send the user to the Bitget website to disconnect. Do not call it for any other reason, such as an error or an expired token.
109
+
110
+ - **Other agents on the account.** A result may carry `connectedAgents`: the other agents connected to this account, sent when one joins or leaves. Tell the user in one sentence. If one is marked `new`, say so plainly: the user may not have connected it. An order whose `clientOid` starts with another agent's `agentTag` is that agent's order: do not cancel or change it unless the user asks. `do_request_open_api(operation_id="getConnectedAgents")` lists every connection with when it was last active. To disconnect one of them at the user's request, pass its tag: `do_request_open_api(operation_id="disconnectAgent", params={"agentTag": "<tag>"}, confirm=true)`.
111
+ - **When a private call says why it is unauthorized,** tell the user that reason (for example "disconnected at the user's request", "disconnected by another agent", "not used for a long time") before you offer to authorize again.
106
112
 
107
113
  - **Token validity** is judged only by an unauthorized or HTTP 401 result from a private call. Do not assume a lifetime, and do not describe it as an API key expiring. Once the token is invalid, stop trading and re-authorize first.
108
114
 
@@ -37,7 +37,7 @@ If no window opens but a link is returned, open it with whatever this environmen
37
37
  ## On the authorization page
38
38
 
39
39
  - **First authorization:** the user creates a new Agentic account. Accounts created by the old SDK or npm tools cannot be selected: choosing one fails, and Codex reports `invalid_request`.
40
- - **Re-authorization:** an account this client created or connected through this flow before can be reused. An account that is connected to a different client is refused ("already connected to another agent"): the user picks or creates another account, or disconnects the other client on the website first.
40
+ - **Re-authorization:** an account created or connected through this flow before can be reused, including one that another agent is connected to. Both agents then work on it.
41
41
  - **Account list full:** the user deletes a few unused old accounts, then creates a new one. Do not fall back to an old-SDK account.
42
42
 
43
43
  ## Client ids
@@ -57,7 +57,7 @@ Any client that supports MCP with OAuth can connect; it does not have to be on a
57
57
 
58
58
  A client that is not in the table presents its own id or registers itself; nothing needs to be set by hand.
59
59
 
60
- Keep the id the same from one authorization to the next. An id spelled differently counts as a different client, and the account then refuses it as "already connected to another agent".
60
+ Keep the id the same from one authorization to the next, so the connection is recognized as the same client each time.
61
61
 
62
62
  ## Codex notes
63
63
 
@@ -71,19 +71,23 @@ These apply to Codex CLI and the Codex desktop app only. They are the standard p
71
71
  ```
72
72
 
73
73
  No callback setting is needed. If `~/.codex/config.toml` already has `callback_url` and `callback_port` for this server, leave them; they still work.
74
- - **Login:**
74
+
75
+ Recent Codex versions start the login as part of `add`: the command prints the authorization link, opens the browser, and waits. If it does, that is the login. Let it finish and do not start another one, because a new login makes the first link useless.
76
+ - **Login** (when `add` did not start one, or to log in again):
75
77
 
76
78
  ```bash
77
79
  codex mcp login bitget-mcp-server
78
80
  ```
79
81
 
80
- The command prints the authorization link, opens the browser, and waits for the callback. **Keep it running until the user has finished in the browser.** The link only works while this command is waiting, so do not stop the command, or let it time out, and hand the link over afterwards. Behind a proxy:
82
+ The command prints the link, opens the browser, and waits for the callback. The link works only while the command is waiting, and Codex stops waiting after about five minutes. So keep the command running, tell the user to approve now, and if it times out, run it again and use the new link. Behind a proxy, prefix it with `HTTPS_PROXY=<proxy> HTTP_PROXY=<proxy>`.
83
+ - **One link at a time.** Every login makes a new link and the earlier ones stop working, but they look the same. If the user retries, ask them to close older Bitget authorization tabs and use only the newest link.
84
+ - **No browser on this machine** (remote or headless):
81
85
 
82
86
  ```bash
83
- HTTPS_PROXY=<proxy> HTTP_PROXY=<proxy> codex mcp login bitget-mcp-server
87
+ codex mcp login --no-browser bitget-mcp-server
84
88
  ```
85
89
 
86
- - **No browser on this machine** (remote or headless): start the login in the background and give the user the link it printed. After they approve, their browser lands on an address that starts with `http://127.0.0.1:` or `http://localhost:` and cannot load, because the callback is waiting on this machine and not on theirs. Ask them to paste that full address, then request it here (for example `curl '<address>'`). The login command then finishes.
90
+ It prints the link and then asks for the address the browser ends on. Give the user the link. After they approve, their browser lands on an address that starts with `http://127.0.0.1:` or `http://localhost:` and may not load, because the callback is meant for this machine. Ask them to paste that full address, and enter it at the prompt. Run the command where you can write to its input.
87
91
  - **On the page:** "Create a new Agentic account" → tick the agreement boxes → Authorize.
88
92
  - **New session:** Codex loads a newly registered server when the next session starts. `codex mcp list` shows whether the server is registered and logged in. After a first-time setup, ask the user to start a new session before trading.
89
93
  - **Desktop app:** it shares `~/.codex/config.toml` and the login state with the CLI. After one CLI login the app shows connected, with no extra click.
@@ -21,6 +21,8 @@ npx @bitget-ai/bitget-agent-skill@latest --target all
21
21
 
22
22
  Read the `SKILL.md` path the installer prints, in full, yourself. Do not ask the user to open it. Keep `@latest`: versions before 4.0.0 install a discontinued skill by default.
23
23
 
24
+ Check the installer's summary line. A target marked `✗` was not installed, so that client will not see the skill. This happens when a sandbox blocks writing to the home directory (Codex reads `~/.agents/skills`). Run the command again with permission to write there, or tell the user which client is missing the skill and the command to run themselves.
25
+
24
26
  ## 2. Register the cloud MCP
25
27
 
26
28
  There is one address: `https://agent.bitget.com/mcp`. Register it yourself, under the server name `bitget-mcp-server`. Do not change the domain and do not configure `BITGET_API_*`.
@@ -52,7 +54,7 @@ Claude Code loads the server when the next session starts (step 3).
52
54
  codex mcp add bitget-mcp-server --url https://agent.bitget.com/mcp --oauth-client-id codex
53
55
  ```
54
56
 
55
- Nothing else needs to be configured. Codex loads the server when the next session starts (step 3); the login in step 5 is a shell command and can be done before that.
57
+ Nothing else needs to be configured. Recent Codex versions start the login right away as part of this command: if a link is printed and the browser opens, that is the login from step 5, so let it finish and do not start another. Codex loads the server when the next session starts (step 3); the login can be done before that.
56
58
 
57
59
  **Other clients**
58
60
 
@@ -8,9 +8,11 @@ Find the situation in the table and take the action. If nothing matches and the
8
8
  |---|---|
9
9
  | The three server tools are missing | Connection problem: follow `first-time-setup.md` from "Check that the tools are available". Do not open authorization, install `@bitget-ai/bitget-agent-mcp`, or reinstall this skill |
10
10
  | Not logged in, and the user wants to trade or query the account | Follow `authorization.md` |
11
- | A private call returns unauthorized or HTTP 401, or the user disconnected on the web | The token is invalid. Stop trading and follow `authorization.md` |
11
+ | A private call returns unauthorized or HTTP 401, or this agent was disconnected | The token is invalid. Stop trading and follow `authorization.md` |
12
12
  | The user cancelled, or the callback did not complete | Say "Authorization was not completed. Should I start again?" |
13
- | Authorization is refused with "already connected to another agent" | The account is connected to a different client. A client id spelled differently counts as a different client, so in Cursor check that `auth.CLIENT_ID` in `mcp.json` is exactly `cursor`. Otherwise the user picks or creates another Agentic account, or disconnects the other client on the website. Do not retry the same account |
13
+ | A result carries `connectedAgents` | Tell the user who else is connected, and point out any marked `new`. Leave their orders alone ("Account rules" in `SKILL.md`) |
14
+ | The user asks to remove an agent they no longer use | `getConnectedAgents`, show the list with last activity, then `disconnectAgent` with that agent's `agentTag` and `confirm=true` after the user picks one |
15
+ | The user asks to disconnect or log out | `do_request_open_api(operation_id="disconnectAgent", confirm=true)`, after telling them what it does ("Account rules" in `SKILL.md`). Do not send them to the Bitget website |
14
16
  | The flow finishes but a private call still says not logged in | Wait a few seconds and retry the read-only call once. If it still fails, run one fresh authorization round |
15
17
  | Codex: the authorization link does not complete | The `codex mcp login` command that printed it is no longer running. Run it again and keep it running until the user finishes ("Codex notes" in `authorization.md`) |
16
18
  | Selecting an existing account on the authorization page fails | The account was created by the old SDK or npm tools. The user creates a new account |