> ## Documentation Index
> Fetch the complete documentation index at: https://docs.askfutures.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Developers overview

> Drive AskFutures from Claude Code, Cursor, or Codex with the MCP server — describe a strategy, wait for the backtest, then optimize.

AskFutures exposes one programmatic surface: an **MCP server**. Connect any
MCP-capable client — Claude Code, Cursor, Codex, or your own — and you get the
same assistant you'd use in chat, available as a set of tools your agent can
call directly.

<Info>
  The MCP server is the *only* public way to drive AskFutures from code. Under
  the hood it runs the exact same strategy engine, deterministic backtester, and
  optimizer as the web app — so the numbers match, byte for byte.
</Info>

## Why use it

<CardGroup cols={3}>
  <Card title="Stay in your editor" icon="terminal">
    Build and backtest futures strategies from Claude Code, Cursor, or Codex
    without leaving the tool you already work in.
  </Card>

  <Card title="Automate the loop" icon="arrows-rotate">
    Script the describe → backtest → optimize → compare cycle. Generate a batch
    of variations, run them, and read the results programmatically.
  </Card>

  <Card title="Same trustworthy engine" icon="shield-check">
    Tools call the same deterministic backtester as the app. Same rules and data
    always produce the same numbers — the AI never invents performance figures.
  </Card>
</CardGroup>

## What you can do

You describe strategies in plain English, just like in chat — the MCP tools
handle the rest:

* **Create a strategy** from a plain-English description (a market plus entry,
  exit, filters, and parameters).
* **Backtest** it on years of real CME Group data, net of modeled slippage and
  commission.
* **Optimize** — sweep parameter ranges to find better-performing settings.
* **Iterate** — refine an existing strategy, version it, and compare runs.
* **Inspect** strategies, sessions, and reference data (symbols, contract specs).

For the full list, see the [MCP tools reference](/developers/tools).

## The async model: create → wait → optimize

The one thing to internalize before you write any code: **the heavy work is
asynchronous.** Building a strategy and running a backtest can take a while —
the engine is replaying years of minute-level history bar by bar. So those tools
don't block. They start a job and hand you back a task you poll until it's done.

```mermaid theme={null}
flowchart LR
  C["create_strategy<br/>(describe it)"] --> T["task started"]
  T --> W["wait_for_completion<br/>(poll)"]
  W --> R["strategy + backtest<br/>results"]
  R --> O["setup_optimization<br/>run_optimization"]
  O --> W2["wait_for_completion<br/>(poll)"]
  W2 --> B["best parameters"]
```

<Steps>
  <Step title="Kick off the work">
    Call a tool like create a strategy or run an optimization. It returns
    immediately with a task to track — not the finished result.
  </Step>

  <Step title="Wait for completion">
    Poll the wait-for-completion tool with that task until the job finishes. A
    good agent does this in a loop, surfacing progress as it goes.
  </Step>

  <Step title="Read the results">
    Once complete, you get the strategy card and backtest metrics — P\&L, win
    rate, drawdown, and the full trade list — ready to inspect or feed into the
    next step.
  </Step>

  <Step title="Iterate or optimize">
    Refine the rules, sweep a parameter range, or compare versions. Each of these
    is another create → wait cycle.
  </Step>
</Steps>

<Tip>
  Most MCP clients (Claude Code, Cursor, Codex) handle the polling loop for you —
  the agent calls the wait tool on its own. You mostly just describe what you
  want.
</Tip>

<Warning>
  Backtest and optimization results are **hypothetical and simulated**, net of
  modeled slippage and commission. Past performance does not guarantee future
  results. Always test before you trade.
</Warning>

## Before you start

You need MCP access enabled on your account. There's no self-serve toggle yet —
see [Authentication](/developers/authentication) for how to request it and how
sign-in works.

## Next steps

<CardGroup cols={3}>
  <Card title="Quickstart" icon="bolt" href="/developers/quickstart">
    Connect Claude Code, Cursor, or Codex in a couple of minutes.
  </Card>

  <Card title="Authentication" icon="key" href="/developers/authentication">
    Sign-in flow, token lifetimes, and getting access enabled.
  </Card>

  <Card title="MCP tools" icon="screwdriver-wrench" href="/developers/tools">
    Every tool, what it does, and what it returns.
  </Card>
</CardGroup>
