# Canli Backtest

> Canli Backtest is an open-source MCP server for finance and payments. Lookahead-free backtests using point-in-time SEC factors, your prices and real costs. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Website:** https://canlicapital.com/mcp-servers
- **Repository:** https://github.com/arhancanli/canlicapital/tree/HEAD/mcp-backtest
- **MCP Registry name:** io.github.arhancanli/canli-backtest-mcp
- **Categories:** finance and payments, analytics and data
- **Listing updated:** 2026-11-14

## About

Canli Backtest targets three habits that inflate agent-run backtests: using data before it was public, ignoring trading costs, and reporting only the best of many variants. A factor tool builds signals such as ROA, gross margin or asset growth only from what had been filed with the SEC by each date, as it stood then. The backtest tool uses your own price data, trades only on signal rows at least a set number of trading days old, and stops if anything reaches past that.

Costs are charged on the actual trades from drifted positions to new targets. Given a capital figure and a dollar-volume file, fills are limited to a share of recent volume with square-root impact, and the reply shows Sharpe at several sizes. When a ledger is used, every run is recorded in a hash-chained ledger and the reply gives the best run's deflated Sharpe after counting all trials.

Additional tools cover a breadth lab with 24 cross-sectional signals, parallel sweeps and effective independent bets. It runs locally over stdio, so prices, signals and ledgers stay on your machine. It is free and MIT licensed.

## Features

- **Point-in-time factors:** Builds factors only from filings public by each date.
- **Enforced no lookahead:** Trades only on signals at least a set lag old.
- **Trade-level costs:** Charges costs on actual trades from drifted positions.
- **Capacity limits:** Caps fills by participation in daily volume with impact.
- **Trial ledger:** Records every variant and deflates the best Sharpe by trials tried.
- **Breadth lab:** Builds netted books from 24 signals and runs sweeps in parallel.

## Good for

- Test a fundamentals signal without using restated or unfiled data
- Check how a strategy's Sharpe changes with capital size
- Judge the best of 200 variants against luck alone
- Shard a parameter sweep across several machines

## Install

### Claude Code (Terminal)

```sh
claude mcp add canli-backtest-mcp -- npx -y canli-backtest-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "canli-backtest-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-backtest-mcp"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "canli-backtest-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-backtest-mcp"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "canli-backtest-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "canli-backtest-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "canli-backtest-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-backtest-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "canli-backtest-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-backtest-mcp"
      ]
    }
  }
}
```

## Tools

- `list_factors`: Lists the factors pit_factor builds and what each measures.
- `pit_factor`: Builds a point-in-time factor for your tickers, monthly, and writes a signal CSV.
- `backtest_signal`: Ranks on a signal, goes long the top quantile and rebalances, with lag, cost and ledger options.
- `price_panel`: Builds a price, dollar-volume and industry-group panel from a fund's holdings.
- `breadth_signals`: Lists the 24 cross-sectional signals with references.
- `breadth_book`: Trades signals within groups as netted sleeves and reports the book's Sharpe after costs.
- `breadth_sweep`: Runs a grid of book settings in parallel or in shards.
- `effective_bets`: Counts independent bets in a set of return series.
- `annotation_packet`: Builds blind labelling packets of figures.
- `annotation_agreement`: Computes agreement between labellers.
- `annotation_gold`: Builds a gold set with its datasheet.

## FAQ

### Does my data leave my machine?

No. The README says it is local stdio only and your prices, signals and ledgers stay with you.

### How is lookahead prevented?

The backtest only trades on signal rows dated at least lag_days trading days earlier and stops if anything reaches past that.

### What does it cost?

It is free and MIT licensed.

### What is the trial ledger for?

It records every variant so the best run is judged against the whole search.

### Is Canli Backtest free?

Yes. Canli Backtest is open source, so you can use and self-host it for free.

### How do I add Canli Backtest to Claude Code?

Run this command in your terminal: claude mcp add canli-backtest-mcp -- npx -y canli-backtest-mcp

### What are the best alternatives to Canli Backtest?

The closest alternatives to Canli Backtest are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, Solana MCP by Vybe, Tapetide - Indian Stock Market MCP and World Monitor.

## Alternatives

- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [Google Ads + Meta Ads + SEO/GEO MCP](https://ai-powered.com/mcp/google-ads-meta-ads-seo-geo-mcp): Google Ads + Meta Ads + SEO/GEO MCP is a freemium MCP server for marketing and seo.
- [Solana MCP by Vybe](https://ai-powered.com/mcp/solana-mcp-by-vybe): Solana MCP by Vybe is an MCP server for finance and payments.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [World Monitor](https://ai-powered.com/mcp/world-monitor): World Monitor is a freemium MCP server for analytics and data.
- [Budget Tracker](https://ai-powered.com/mcp/budget-tracker-2): Budget Tracker is a freemium MCP server for finance and payments.
- [CompanyData](https://ai-powered.com/mcp/companydata): CompanyData is a paid MCP server for analytics and data.
- [ChartAnt](https://ai-powered.com/mcp/chartant): ChartAnt is a freemium MCP server for design and media.

---
Source: https://ai-powered.com/mcp/canli-backtest
