For AI agents

AI Agents

One endpoint. Your assistant can read your paper-trading account, pull live markets and backtest strategies against years of history — using the same engine the app trades with. What it's allowed to do is set here.

MCP endpoint
https://trade-lab.hirahul.xyz/api/mcp
Trading is off until you turn it on. Reading your account and running backtests work as soon as you connect. Placing orders stays blocked until you enable it and set your own limits — size per order, orders per hour, leverage, and which markets are allowed. Orders only ever run while Trade Lab is open, and only on the paper account. Set your limits

What your assistant can do

22 capabilities over MCP. Reading and research always work; trading is off until you turn it on.

    • preview_orderDry-runs an order through the real engine — cost, margin, liquidation price. Writes nothing
    • preview_ordersDry-runs a whole plan — each step priced against what the last one left behind
    • place_orderQueues an order for your open tab to run
    • set_position_tpslAttaches, changes or clears the take-profit / stop-loss on an open position
    • close_positionCloses a position in full with a reduce-only market order, sized for you
    • cancel_orderQueues a cancellation of a working order
    • modify_orderReprices a working order in place, keeping its queue position
    • close_allFlattens every open position — or one market's — as a single request
    • cancel_allCancels every working order, sparing the stops attached to open positions

    Trading is off. If you turn it on, these limits apply:

    $1,000/order · 10/hr · 5× · all markets

    Edit limits

Backtests run through the same matching, fee and margin logic as live paper trading — there's no separate simplified path — and every result comes back with its own caveats attached, so your assistant sees the limits alongside the numbers.

Who has access

Connected agents

Checking connections…
Blast radius

Agent wallet

₹0.00

An agent can’t open anything until this is funded. Move money in from Funding — which is empty right now, so deposit first. Only Funding can fill it, so there is one path to audit.

Transfer

From
Available₹0.00
To
Balance₹0.00
In orders / margin₹0.00 / ₹0.00
Available ₹0.00Instant · Free
Your rules

Controls

Allow assistants to place orders
Off — an assistant can look at your account and run backtests, but every order it tries is refused.
Executor
Orders are queued by your assistant but filled by an open Trade Lab tab. Nothing fills while none is running.
No Trade Lab tab running
Orders your assistant sends will queue and then expire. Open Trade Lab
Only tabs in this browser are visible here — one open on another device won't show up.
Limits
Applied to every order an assistant places. Checked twice — once when the request arrives, and again in this tab before it reaches the engine.
Allowed marketsNone listed — every market is allowed.
Across the whole bookThese cap total exposure rather than order size. Reduce-only orders are exempt — closing a position is never blocked. Set any to 0 for no limit.
Recent requests
What assistants have asked for, including anything refused — a blocked row tells you which limit is biting.
Loading…
Connect a client

Claude Code

Run once in your own terminal — works in every project after a session restart.

Add the server
claude mcp add --transport http --scope user tradelab https://trade-lab.hirahul.xyz/api/mcp

Then run /mcp and approve. Confirm with claude mcp list → tradelab ✔ Connected.

Claude.ai / Claude Desktop

Settings → Connectors → Add custom connector → paste the endpoint URL.

Endpoint URL
https://trade-lab.hirahul.xyz/api/mcp

Codex

One command, through the mcp-remote bridge — works on every Codex version.

Add the server
codex mcp add tradelab -- npx -y mcp-remote https://trade-lab.hirahul.xyz/api/mcp
Or add it to your config~/.codex/config.toml
[mcp_servers.tradelab]
command = "npx"
args = ["-y", "mcp-remote", "https://trade-lab.hirahul.xyz/api/mcp"]

Cursor

Create .cursor/mcp.json in a project, or ~/.cursor/mcp.json for all projects.

Config.cursor/mcp.json
{ "mcpServers": { "tradelab": { "url": "https://trade-lab.hirahul.xyz/api/mcp" } } }

Any other MCP client

Point it at the endpoint URL (Streamable HTTP). If your client only speaks stdio, bridge it:

stdio bridge
npx -y mcp-remote https://trade-lab.hirahul.xyz/api/mcp
Run the server locally instead

The hosted endpoint above needs nothing installed. This path runs the MCP server from your own checkout and authenticates with credentials you paste in — useful if you're developing against it, or you want the server on your machine rather than ours.

  1. Clone the project and run pnpm install.
  2. Get the absolute path — assistants don't resolve relative paths from your shell.
    Run this in the project folder
    echo "$(pwd)/scripts/mcp-server.mts"
  3. Use the button below to generate a command with your credentials filled in, or substitute them into a template yourself.

Replace /ABS/PATH/scripts/mcp-server.mts with the path from step 2.

Claude Code

With account access
claude mcp add \
  --env TRADELAB_SUPABASE_URL=https://YOUR_REF.supabase.co \
  --env TRADELAB_SUPABASE_ANON_KEY=YOUR_ANON_KEY \
  --env TRADELAB_ACCESS_TOKEN=YOUR_SESSION_JWT \
  --env TRADELAB_REFRESH_TOKEN=YOUR_REFRESH_TOKEN \
  --transport stdio tradelab \
  -- npx tsx "/ABS/PATH/scripts/mcp-server.mts"

Codex CLI

Config file~/.codex/config.toml
[mcp_servers.tradelab]
command = "npx"
args = ["tsx", "/ABS/PATH/scripts/mcp-server.mts"]

[mcp_servers.tradelab.env]
TRADELAB_SUPABASE_URL = "https://YOUR_REF.supabase.co"
TRADELAB_SUPABASE_ANON_KEY = "YOUR_ANON_KEY"
TRADELAB_ACCESS_TOKEN = "YOUR_SESSION_JWT"
TRADELAB_REFRESH_TOKEN = "YOUR_REFRESH_TOKEN"

The generated command carries your sign-in tokens — treat it like a password. Anyone holding it can read your account, and place orders if you've enabled that. Signing out everywhere invalidates it.

If something goes wrong
The client says it needs authentication
That's the expected first state. Approve the connection in your client — in Claude Code that's /mcp— and a browser window will open to confirm it's you.
Connected, but the account tools return nothing
You're connected as a user with no paper-trading account yet. Open Trade Lab and sign in once — the account is created on first sign-in.
Orders time out
Orders only execute while a Trade Lab tab is open, on the market that tab is showing. Open the app and try again.
Positions show no mark price
The market feed didn't respond. Balances and positions are still correct — only the live price is missing.

Connect a walletYour wallet is your account

You’ll be asked to sign a message so we know the address is yours. It costs nothing, moves no funds, and approves no transaction.

Designer Preview

You're viewing a design preview. All data shown is mock — nothing here is real or live.

  • Paper mode is on
  • Default layout applied
  • Live data is off until you turn it on