> For the complete documentation index, see [llms.txt](https://trader-docs.b2trader.b2broker.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trader-docs.b2trader.b2broker.com/connect-your-ai-agent/connect-chatgpt.md).

# Connect ChatGPT

You can connect B2Trader to **ChatGPT** as a **connector**. It uses the same B2Trader MCP URL and OAuth sign-in as every other agent. Pick the surface you need first — see [Overview](/connect-your-ai-agent/overview.md):

* Read-only: `https://<your-broker-domain>/mcp-read-only`
* Full access: `https://<your-broker-domain>/mcp-full-access`

{% hint style="info" %}
Ask your broker for the exact base URL for your platform. The read-only connector may also be discoverable directly in ChatGPT's connector directory. Connector availability depends on your ChatGPT plan.
{% endhint %}

## Connect the B2Trader connector

1. In ChatGPT, open **Settings** → **Connectors**.
2. Choose to add a connector by **URL** (custom connector).
3. Paste the B2Trader MCP **URL** for the surface you want (read-only or full access).
4. Confirm. ChatGPT reads the endpoint's OAuth metadata and opens the B2Trader sign-in page in your browser.
5. Sign in with your normal **B2Trader credentials**. Authentication uses OAuth 2.1 with PKCE — no API key is pasted into ChatGPT.
6. **Full access only:** approve the consent screen (see [The full-access consent screen](#the-full-access-consent-screen)).
7. ChatGPT lists the connector as connected, and the B2Trader tools become available to it.

## The full-access consent screen

When you connect the **full-access** surface, B2Trader shows an explicit consent screen before issuing a token. It reads:

{% hint style="danger" %}
Connecting this AI agent lets it place, cancel and close orders and set triggers on your account directly, with no per-action confirmation. These actions are irreversible. This differs from the in-terminal AI chat, which confirms each trade.
{% endhint %}

* **Approve** — ChatGPT receives a token carrying the `mcp:trade` scope and can trade on your account.
* **Decline** — no token is issued and ChatGPT stays disconnected from the full-access surface.

The read-only surface does **not** show this screen — it only grants the `mcp:read` scope.

Before approving full access, read [Full-access safety](/connect-your-ai-agent/full-access-safety.md).

## What "connected" looks like

* The connector appears as connected in ChatGPT's settings.
* B2Trader tools are available to ChatGPT in your chats.
* On read-only, no order-placing or position-closing tools appear — they are not part of that surface.

## Disconnecting

* In ChatGPT, remove the connector to stop it calling B2Trader.
* To revoke B2Trader's side of the grant, use the account console — see [How to stop your agent](/connect-your-ai-agent/full-access-safety.md#how-to-stop-your-agent).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://trader-docs.b2trader.b2broker.com/connect-your-ai-agent/connect-chatgpt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
