Skip to main content

Use OptAlgo from Claude.ai / ChatGPT

The OptAlgo connector lets a chat app work with your OptAlgo account: Claude (web, desktop and mobile), ChatGPT and Claude Code. You add one URL to the chat app, approve it once in the OptAlgo app, and the chat can then write strategies, backtest them on OptAlgo's engine and run bots on paper in your My Bots.

Connector URLhttps://mcp.optalgo.com/mcp
Works withClaude.ai (web, desktop, mobile), ChatGPT, Claude Code, and other apps that support remote MCP connectors
PlansEvery plan, Free included
Can doRead markets and your account, backtest, paper bots, run your strategies on OptAlgo on paper, file tickets
Can never doTrade real money (on any plan)

What it is​

The connector is a remote MCP server (Model Context Protocol, the standard chat apps use to plug in tools). When you add it, the chat app sends you to OptAlgo to sign in and approve it; OptAlgo then gives the chat app a short-lived token. You never create, copy or paste an API key.

  • No key in the chat. The chat app holds a token that expires after 1 hour and is renewed automatically; each renewal replaces the previous token. Nothing you type in the chat contains a secret.
  • Fixed, safe permissions. Every connector gets the same three permissions: read, backtest, and bots on paper. You cannot widen them, and a connector can never trade real money, even on Plus or Pro.
  • Same account, same rules. Backtests count against your plan's quota, the same rate limits and code rules apply as for API keys, and every call appears in the app's logs.
  • Off in one click. Disconnect it in the app at any time; it stops working at once.

Using a coding agent (Claude Code, Codex) on your own computer and want live trading through it? That is an API key with the device login, which you set up in the app. The connector stays paper only.

Add the connector​

Chat apps change their menus often: the paths below are where the option was at the time of writing. Look for Connectors, Apps or MCP in the app's settings if they have moved.

Claude.ai, Claude desktop and mobile​

  1. In Claude: Settings → Connectors → Add custom connector.
  2. Name it OptAlgo and paste the URL https://mcp.optalgo.com/mcp. Leave the OAuth fields empty: Claude registers itself.
  3. Click Add, then Connect. Claude opens the OptAlgo app to sign in and approve (see below).

A connector added on the web or desktop also works in the mobile app. On a Team or Enterprise plan, an Owner may need to add the connector for the organisation first; then you only click Connect.

In a chat, turn the connector on under the chat's tools menu if Claude does not use it by itself.

ChatGPT​

  1. In ChatGPT: Settings → Apps & Connectors. If creating a connector is not offered, turn on developer mode there first (availability depends on your ChatGPT plan).
  2. Create a connector: name OptAlgo, URL https://mcp.optalgo.com/mcp, authentication OAuth.
  3. Save it and sign in when ChatGPT asks. It opens the OptAlgo app to approve (see below).

Claude Code​

claude mcp add --transport http optalgo https://mcp.optalgo.com/mcp

Then type /mcp in Claude Code, pick optalgo and sign in. Your browser opens the OptAlgo app to approve.

Claude Code can also use an API key with the device login in the LLM reference, which allows live trading when you choose. The connector is the simpler choice when backtests and paper bots are all you need.

Approve it in OptAlgo​

The chat app sends you to app.optalgo.com/connect-chat. Log in if asked. The page shows:

  • the chat's name, as the chat app registered it (for example "Claude");
  • where it sends you back after you approve (for example claude.ai or chatgpt.com). If this is not the chat app you just used, click Deny;
  • a warning when the sign-in started on another network than the browser you are approving in (someone may have sent you the link). Approve only if you just clicked Connect in your own chat app;
  • the permissions, which are always the same: Read (markets, your account, bots, trades and backtests), Backtests (run strategy code the chat writes on OptAlgo's engine) and Bots, on paper only (create paper bots, open and close paper positions). No live trading: this cannot be ticked, on any plan.

Click Approve. You are sent back to the chat, which is now connected. You approve once per chat app; the chat renews its own token from then on.

Your first prompt​

Paste this into a new chat:

Using the OptAlgo connector: list the markets, then write a simple EMA-crossover strategy
for BTCUSDT.P on 1h, validate it, backtest 2024-01-01..2025-01-01, read the grade and
improve it once.

The chat lists the markets, writes the strategy, validates it for free, runs the backtest, reads the honesty grade before any return figure, changes one thing and runs it again. Every run appears on your Backtest page at app.optalgo.com/backtest.

To see paper trading, follow up with:

Create a paper bot for BTCUSDT.P, open a small long, show me the trade, then close it.

Watch it at app.optalgo.com/my-bots.

The tools the chat gets​

Every tool is paper only: none can trade real money, create a live bot or switch anything to live, on any plan. The one read that also works on a live hosted strategy is compare_with_backtest (it places no order). Only run_backtest and compare_with_backtest use backtest units.

ToolWhat it does
Guide and account
guide(topic)The agent guide, one small section at a time (index, connect, sdk, backtests, research, hosted, errors, tickets, reference): the same files as docs.optalgo.com/llm/index.md, so the chat never needs the web
capabilitiesWhat OptAlgo can and cannot do today. The chat checks it before promising you something; a missing capability becomes a feature ticket
account(section)Read-only: your account and plan with the tickets left (me), PnL by mode (summary), paper and exchange balances, open positions, the equity curve, your exchange connections (never their keys)
limitsYour plan's backtest limits and the units left this month or day
Markets
marketsThe exchanges, symbols and timeframes you can backtest, and where each history starts
price(symbols)The live price of up to 20 symbols, from OptAlgo (the price paper orders fill at)
Backtests
strategy_sdkHow to write the strategy file: the SDK, the intents and the run spec
validate_strategy(source, spec)Checks the code and the run spec and reports every problem at once, with the estimated cost. Free
run_backtest(source, spec)Submits the backtest; returns its id. Uses units
backtest_status(id)Queued, running, done or failed; queue position and estimated wait
backtest_result(id)A compact result: honesty grade first, then the search verdict, the findings and the main metrics (net of fees)
backtest_chart(id)Equity, drawdown and trades of a finished run (a run that kept no equity curve says so and points to backtest_result)
candles(id, start, end)The bars of a finished backtest in a window, with the strategy's plots, fills and trades: "why did it enter here?"
backtestsYour earlier backtests and favourites; with an id, its trades.csv or result.json
download_codeThe strategy.py a backtest ran or a hosted strategy runs, as text
Paper bots
list_botsYour My Bots bots
create_paper_botA new bot on paper
paper_signalOpens or adjusts a position on a paper bot. No price needed: OptAlgo prices the entry and turns a stop or target in percent (stop_loss_pct, take_profit_pct) into prices. Leverage defaults to 1 on futures; the ticker comes from the bot
close_paperCloses a paper bot's positions
manage_paper_botRenames a paper bot, changes its paper budget or slots, starts, stops, deletes or converts it to multi-symbol, sets a ticker's weight. Never switches it to live
bot_infoOne bot's settings, stats, equity, tickers and logs, or what happened to one signal
tradesYour trades, open and closed
Strategies on OptAlgo (hosted, paper only)
deploy_strategyRuns a backtested strategy (grade A to C) on OptAlgo, on paper, in My Bots. dry_run first: the whole check, nothing created
list_strategies · strategy_statusYour hosted strategies; one strategy's status, last decision, errors and live eligibility
strategy_decisionsWhat it decided at every bar, and why an action was not sent
compare_with_backtestIts real trades (paper, or live for a live hosted strategy) matched against a backtest of the same code over the same period. Uses units; a dry run gives the cost
pause_strategy · resume_strategyStops or restarts its decisions; open positions keep their stops
manage_strategyRenames it, changes its paper budget, or deletes it (open positions wind down, or close now)
Support
report_issueFiles a ticket with the OptAlgo team. The chat files it on its own, without asking you: when something on OptAlgo's side goes wrong, when you want something OptAlgo cannot do yet (a feature request), when the docs and the tools disagree, when a result looks wrong, or when an answer confused you. Also when you ask it to "contact support" or "open a ticket". It tells you the ticket id in one line; never with your strategy code or keys
ticketsYour tickets and the team's replies

A hosted strategy runs everything its backtest ran: one symbol per decision, or several legs on one account (pairs, 2 to 4 legs, deployed on exactly the backtest's legs and sized on the whole allocation), funding / open-interest series and references on any timeframe (what a hosted strategy runs). On a multi-leg strategy, deploy_strategy's on_leg_failure decides what happens when one leg's entry fails: unwind (the default) closes the other legs, keep lets each leg stand on its own. Going live is always your decision, in the app. Tickets: 20 a day per user, a repeat of the same problem counting once; a person is at [email protected].

Paper trading on Free has a monthly paper trade limit, as in the app.

Prices come from OptAlgo. The chat reads prices with price and markets with markets, from OptAlgo's own market data (the exchange's ticker only as a fallback), so it never goes to the web for a price and you get no extra permission prompts. It asks you only for what you want (symbol, direction, size); everything else has a sensible default.

The loop​

A good chat works in this order, and you can ask it to:

  1. markets and limits: symbols and a timeframe that exist, with history over the window; the quota left.
  2. strategy_sdk before the first strategy (and guide for anything else).
  3. validate_strategy: free, and it lists every problem at once. Fix them all and validate again until it is clean.
  4. run_backtest, then backtest_status until the run is done (or failed, with a fix).
  5. backtest_result: the honesty grade first (A best to D), then the search verdict (how many variants were tried on this data, and whether the result is likely luck). A C result has caveats the findings explain; a D result is not realistic, so do not quote its numbers. Judge it net of fees: fees eat short-timeframe strategies (15m and below) first.
  6. Fix one thing and repeat from step 3; for parameters, one research run instead of many single runs.
  7. Paper: a paper bot (create_paper_bot, paper_signal), or run the strategy on OptAlgo with deploy_strategy (dry_run first).
  8. Watch it with strategy_status and strategy_decisions, and compare it with its backtest (compare_with_backtest).

A single backtest is in-sample: a good-looking number from one run is a starting point, not proof. The grades, the findings and the strategy SDK are explained in section 2 of the LLM reference.

Limits and quota​

The connector uses your plan, exactly like an API key:

FreePlusPro
Backtest units (1 unit = up to 10 s of run time)50 per month30 per day200 per day
Paper botsYesYesYes
Live trading through the connectorNoNoNo
  • Validating, reading results and the other tools cost nothing; only run_backtest uses units. The per-run limits (symbols, history, trials, time, memory) are in Plans.
  • When the quota is used up, the chat is told when it resets and must stop submitting.
  • The same rate limits as API keys apply, and every call shows in the app's logs.

Safety​

  • Paper only, always. A connector cannot open live positions, create live bots or switch a bot to live, on any plan. Live trading stays in the app, or goes through an API key that you create and limit yourself.
  • Never paste an API key into a chat. The connector does not need one. If you pasted a key (oa_live_…) into any chat, consider it exposed: revoke it under AI agents in the app.
  • Disconnect at any time: app.optalgo.com/ai-agents → Connected chats → Disconnect. It takes effect at once; the chat's token stops working on its next call.
  • Code rules. Strategies may only use numpy, math and optalgo_engine.sdk. Code that tries anything forbidden (files, the network, processes, os, subprocess, open, eval, dunder escapes and similar) is refused and counts as a strike on your account. After 3 strikes your account's API access is suspended, API keys and connectors alike, until [email protected] restores it. Honest mistakes (a loop over bars, a wrong signature, lookahead, a syntax error) never count. See Forbidden code: strikes.

Troubleshooting​

The approval page says a plan is required. Your account's plan or subscription does not currently allow API access. Check Subscription in the app; Free can connect, so this usually means the account itself needs attention. Contact [email protected] if it persists.

The approval page says API access is suspended. The account reached the strike limit for forbidden code (account_suspended). Only [email protected] can restore it.

The chat reports connector_paper_only. It tried something with real money. That is not available through a connector: do it in the app (details).

The chat reports invalid_token, or says it was signed out. The connection expired or was disconnected. Reconnect: in Claude, open the connector and click Connect; in ChatGPT, sign in to the connector again; in Claude Code, run /mcp and sign in.

The chat cannot reach OptAlgo, or calls time out. Usually a temporary network or provider problem; there is nothing to change on your side. Try again in a minute.

The chat does not use the connector. Make sure it is turned on for this chat, and name it in your prompt ("Using the OptAlgo connector, …").

Errors a connector user may see​

The chat receives these codes when OptAlgo refuses a call. The full list of backtest and market errors, with their fixes, is in Errors and what to do.

connector_paper_only (403)​

The call would touch real money: a live signal or close, a live bot, switching a bot to live, or raising a live bot's allocation. Connectors are paper only on every plan, so retrying or upgrading does not change this. Use paper bots in the chat; for live trading, use the app, or an API key you create there.

connector_not_allowed (403)​

The chat asked for something the connector does not offer (an action outside its tools, such as creating API keys or changing your exchange connections). Do it in the app.

invalid_token (401)​

The chat's token expired, was revoked, or the chat was disconnected. Reconnect the connector in the chat app (troubleshooting). Do not paste an API key instead.

account_suspended (403)​

API access is suspended after repeated security violations (3 strikes): every API key and every connector of the account stops. Contact [email protected]. Reconnecting does not help.

Quota, per-run limit and code errors (monthly_quota, daily_quota, max_symbols, security_violation …) are the same as for API keys: see the LLM reference.

FAQ​

Can it trade live?​

No. A connector is paper only, on every plan, and this cannot be changed. Live trading is in the app (or through an API key you create and limit yourself).

Do I need to paste an API key?​

No, and you never should. The connector signs in through OptAlgo; there is no key to copy.

Does it work on the Free plan?​

Yes: backtests (50 units a month) and paper bots.

Where do I see what the chat did?​

Backtests on the Backtest page, paper bots and trades in My Bots, and every call in the app's logs.

How do I stop it?​

app.optalgo.com/ai-agents → Connected chats → Disconnect. It stops at once. You can also remove the connector in the chat app.

Will the chat look up prices on the web?​

No. The connector gives it OptAlgo's live prices (price), and a paper signal does not need a price at all: OptAlgo prices the entry itself. If a chat still tries to fetch a price from a website, tell it to use the OptAlgo price tool.

Is the chat's code safe to run?​

It runs in OptAlgo's sandbox and may only use numpy, math and the OptAlgo SDK. Forbidden code is refused before it runs.