# Backtest360 MCP server

> Enables AI agents to discover indicators, build and validate trading strategies, and run historical backtests using the Backtest360 engine.

- Repository: https://github.com/Backtest360/backtest360-mcp
- Page: https://hostedmcp.org/servers/backtest360/backtest360-mcp
- Transport: stdio, remote
- Stars: 0
- License: MIT
- Latest version: 0.5.0

## Install

### Claude Code

```sh
claude mcp add --env 'BACKTEST360_API_KEY=<YOUR_BACKTEST360_API_KEY>' backtest360-mcp -- uvx backtest360-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "backtest360-mcp": {
      "command": "uvx",
      "args": [
        "backtest360-mcp"
      ],
      "env": {
        "BACKTEST360_API_KEY": "<YOUR_BACKTEST360_API_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "backtest360-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "backtest360-mcp"
      ],
      "env": {
        "BACKTEST360_API_KEY": "<YOUR_BACKTEST360_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"backtest360-mcp","type":"stdio","command":"uvx","args":["backtest360-mcp"],"env":{"BACKTEST360_API_KEY":"<YOUR_BACKTEST360_API_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "backtest360-mcp": {
      "command": "uvx",
      "args": [
        "backtest360-mcp"
      ],
      "env": {
        "BACKTEST360_API_KEY": "<YOUR_BACKTEST360_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add backtest360-mcp --env 'BACKTEST360_API_KEY=<YOUR_BACKTEST360_API_KEY>' -- uvx backtest360-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.backtest360-mcp]
command = "uvx"
args = ["backtest360-mcp"]

[mcp_servers.backtest360-mcp.env]
BACKTEST360_API_KEY = "<YOUR_BACKTEST360_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'BACKTEST360_API_KEY=<YOUR_BACKTEST360_API_KEY>' backtest360-mcp uvx -- backtest360-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "backtest360-mcp": {
      "command": "uvx",
      "args": [
        "backtest360-mcp"
      ],
      "env": {
        "BACKTEST360_API_KEY": "<YOUR_BACKTEST360_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `BACKTEST360_API_KEY` | yes | yes | Backtest360 engine API key, sent to the engine as X-API-Key. Get a free key at https://backtest360.com/api-access. |

## Tools (15)

- `engine_info`
- `get_me`
- `get_catalog`
- `list_indicators`
- `list_templates`
- `get_strategy_schema`
- `validate_strategy`
- `run_backtest`
- `get_latest_signal`
- `compare_backtests`
- `compute_stats`
- `get_data_range`
- `get_ticker_info`
- `get_quote`
- `get_price_history`

## FAQ

### Can I fetch historical price data on the free tier?

No, fetching historical price data from the engine server-side is a paid capability; the free tier only runs backtests on data you upload.

### Does the MCP server perform any calculations itself?

No, the server is a thin adapter that communicates with the engine API and does not compute numbers or contain AI.
