Skip to content

Products MCP

Let your agent run the sweep.
You keep the judgment.

Connect Claude Code, Claude Desktop, Cursor, or another MCP client that supports remote servers with custom headers. Your agent can run supported Pine Script strategies, sweep their inputs, and read the results under the same plan limits as the app.

Tokens act as you: they inherit your plan and allowance, and never grant admin access.

Session
Example session MCP client connected to https://api.trainbard.com/mcp

    Tool calls and responses use the real field names, shortened where marked with “…”. Values come from the example sweep. Each client shows tool calls in its own way, and the agent's replies are its own.

    Six tools, one account.

    The same backtesting engine as the app, exposed as tools your agent can call. With saved strategies enabled for your account, it can also read and save strategies in your Library.

    get_usage

    Your weekly research allowance and plan limits: combinations per sweep, date range, and active-run cap.

    run_backtest

    Compile a Pine Script v6 strategy and run one parameter set, or sweep ranges. Returns the result table.

    run_detailed_backtest

    Run one parameter set and return its metrics plus the full trade list, with candles on request.

    get_backtest_results

    Re-read, re-sort, page, or keep waiting on a run started through MCP. Costs nothing.

    list_backtests

    List active runs and recent MCP runs whose rows are still held, to recover a lost batch_id. Costs nothing.

    cancel_backtest

    Cancel work that hasn't been dispatched yet, for one run or all of them.

    Connect with two values.

    An endpoint and a token. Keep up to ten tokens, one per client, and revoke any of them from the same page. A revoked token stops working immediately.

    1. Create a token. Open Settings → MCP in the app, name the client, and choose Create token. It is shown once; TrainBard stores only a hash.
    2. Add the server. Give your client the endpoint and an Authorization header with the token.
    3. Ask for a test. Describe the strategy, market, dates, fees, and the ranges to sweep.

    Claude Code

    claude mcp add --transport http trainbard https://api.trainbard.com/mcp --header "Authorization: Bearer tb_…"

    Other clients

    { "url": "https://api.trainbard.com/mcp",
      "headers": { "Authorization": "Bearer tb_…" } }

    Streamable HTTP with a bearer token. Clients that only support OAuth-based remote servers cannot connect yet.

    Same rules as the app.

    MCP runs share your plan, your weekly research allowance, and your one active run with the web app. Nothing is saved on TrainBard unless your agent explicitly saves a strategy.

    Allowance

    Each successfully completed combination uses one unit of your weekly research allowance. Failed combinations are free.

    One run at a time

    A new submission is rejected while another run is active, and the rejection names the run in the way so your agent can wait or cancel.

    Results are yours to keep

    Rows are held for 30 minutes after a run finishes so your agent can re-sort or page them. Have it save what you need.

    Read the MCP guide ↗

    Give your agent a backtester.

    Create a token, connect your client, and ask for your first sweep.