Skip to content
MCP server

Canli Backtest

Lookahead-free backtests using point-in-time SEC factors, your prices and real costs

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI
Runs
Locally
Version
0.6.0
Listing updated
3 days ago

About Canli Backtest

Canli Backtest is an open-source MCP server for finance and payments. It runs locally on your machine and is started by your AI client.

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.

Install

Run in a terminal

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

Add to claude_desktop_config.json

{
  "mcpServers": {
    "canli-backtest-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-backtest-mcp"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "canli-backtest-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-backtest-mcp"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

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

Add to ~/.codeium/windsurf/mcp_config.json

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

Add to your client's MCP settings (most use this shape)

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

Tools this server provides (11)

Taken from the project documentation; the running server may differ.

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.

What it does

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

Pricing

Open source

Free, MIT licensed

Prices change. Check canlicapital.com before you buy.

Canli Backtest 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 to Canli Backtest

  1. Open-source analytics app where an AI agent builds charts and dashboards from your data

    • Remote
    • Open source
    • 7.7K GitHub stars
    • Analytics and data
  2. Hosted MCP connector for managing Google Ads, Meta Ads, GA4 and Search Console from chat

    • 8 tools
    • Remote
    • Freemium
    • 8.1K GitHub stars
    • Marketing and SEO
  3. Remote MCP server exposing the Vybe Solana API to AI clients and code editors

    • 44 tools
    • Remote
    • 2.8K GitHub stars
    • Finance and payments
  4. Indian NSE and BSE stock market data for AI assistants through 48 MCP tools

    • 17 tools
    • Remote
    • Freemium
    • 150 GitHub stars
    • Finance and payments
  5. World Monitor

    MCP server

    Live geopolitical intelligence dashboard with an API and MCP server for agents

    • Remote
    • Freemium
    • Analytics and data
  6. Budget Tracker

    MCP server

    Local MCP expense ledger that logs receipts and mileage, splits VAT and prepares rebilling

    • 14 tools
    • Remote
    • Freemium
    • 2 GitHub stars
    • Finance and payments