Overview
B2Trader can expose your trading account to external AI agents through the Model Context Protocol (MCP) — an open standard that lets AI applications such as…
B2Trader can expose your trading account to external AI agents through the Model Context Protocol (MCP) — an open standard that lets AI applications such as Claude and ChatGPT call a defined set of tools on your behalf. Once you connect an agent, it can read your market data and portfolio, and — on the full-access surface — place and manage orders directly.
This is different from the in-terminal AI Assistant chat, which runs inside the B2Trader terminal and confirms each trade with you before it executes. An external MCP agent runs in its own application (Claude, ChatGPT, or your own client) and connects to B2Trader over the internet using your account sign-in.
Connecting an AI agent is optional — it's your choice whether to use it. The MCP surfaces are available by default, though your broker can restrict or disable them for your platform. If a connection URL below doesn't work, contact your broker.
Two surfaces
B2Trader publishes two separate MCP endpoints. You choose one when you connect your agent.
| Read-only | Full access | |
|---|---|---|
| Endpoint path | /mcp-read-only | /mcp-full-access |
| What the agent can do | View market data, your portfolio, order and position history, and analytics | Everything in read-only plus place, cancel, and close orders and set price triggers |
| Tools exposed | 23 | 38 |
| Trading | None — mutating tools are not present at all | Full trading, with no per-action confirmation |
| OAuth scope | mcp:read | mcp:trade |
| Consent screen | No extra consent | Explicit trade-scope consent (see Full-access safety) |
| Marketplace-listed | Yes | No — connect by URL |
The read-only surface is the one listed in AI marketplaces (for example the Claude and ChatGPT connector directories). It is safe to connect broadly: the trading tools are structurally absent — the agent cannot see or call them.
The full-access surface is connected by pasting its URL directly. It grants your agent the ability to trade with no confirmation gate. Read Full-access safety before you connect it.
Tool categories
Both surfaces expose the same read tools; the full-access surface adds the mutating ones.
| Category | Read-only | Full access |
|---|---|---|
| Market data (tickers, order book, market summaries) | Yes | Yes |
| Portfolio & account (balances, margin, open positions) | Yes | Yes |
| Order & position history | Yes | Yes |
| Analytics & reference data | Yes | Yes |
| Place / cancel / close orders (single) | No | Yes |
| Bulk order / position actions | No | Yes |
| Set & edit price triggers, other account mutations | No | Yes |
| Total tools | 23 | 38 |
The 15 tools that the full-access surface adds are the mutating actions: single trading actions, bulk trading actions, and non-trading account mutations.
Which surface to choose
- Choose read-only if you want an agent to analyze markets, summarize your portfolio, or answer questions about your trading history. This is the recommended default and the safest option.
- Choose full access only if you deliberately want your agent to trade for you without confirming each action, and you understand the risks in Full-access safety.
Prerequisites
Before connecting any agent you need:
- A B2Trader account on a platform that offers the MCP surfaces. They are available by default; a broker can restrict or disable them.
- Your account must be active (
bbp.spot.status = Active) — the same status required to trade in the terminal. A non-active account can sign in, but its tool calls are rejected by the platform. - An AI application that supports MCP with OAuth — for example Claude, ChatGPT, or a custom agent.
How connecting works
You never paste an API key or password into your agent. Connection uses OAuth 2.1 with PKCE:
- You add the B2Trader MCP URL to your agent.
- The agent discovers B2Trader's authorization server automatically — it reads the endpoint's protected-resource metadata at
/.well-known/oauth-protected-resource. - Your browser opens the sign-in page for your platform, where you sign in with the credentials you normally use.
- For the full-access surface, you approve an explicit consent screen describing what the agent may do.
- The agent receives a short-lived access token and is connected. No long-lived secret is stored in the agent.
The sign-in page you see depends on how your broker set up your platform: either the B2Trader sign-in form, or the sign-in page of the portal you normally use to access your account, which opens automatically. If you are already signed in there in the same browser, no sign-in prompt appears.
The per-client steps are covered in the connection guides:
最后更新于