canli-backtest-mcp 0.5.1 / Free and open source
canli-backtest-mcp: backtests an AI agent can trust
canli-backtest-mcp is a free, open-source MCP server for backtests an AI agent can trust. It builds point-in-time factors from SEC filings, tests any signal on your own prices with lookahead blocked in code, charges costs on the actual trades, and records every variant, so the best result is judged against the whole search.
Price: $0 to run. Updated 2026-11-02. 32 tools. MIT licence. Registry name io.github.arhancanli/canli-backtest-mcp.
Add it to your AI assistant
claude mcp add canli-backtest -- npx -y canli-backtest-mcp{"mcpServers":{"canli-backtest":{"command":"npx","args":["-y","canli-backtest-mcp"]}}}Or take every Canli Capital server at once with npx -y canli-mcp: canli-mcp puts them behind 5 tools and 2,524 tokens of context. Steps for each client.
What to ask it
Questions it has answered
Each page shows the call and the recorded result.
Common questions
Is canli-backtest-mcp free?
Yes. It is MIT-licensed and needs no API key and no account.
How does it stop lookahead?
pit_factor uses only what had been filed with the SEC by each date, as it stood then. backtest_signal trades only on signal rows dated at least lag_days trading days earlier, and stops if anything reaches past that.
Does my data leave my machine?
It runs locally over stdio. Your prices, signals and ledgers stay on your machine.
Which AI assistants can use it?
Claude, Claude Code, Cursor, VS Code, Codex, Gemini CLI, Windsurf, Cline, Zed and any other MCP client.
Does a good result here mean a strategy works?
No. It removes common ways a backtest flatters itself, and it reports how much of a result luck could explain. Past results do not promise future ones, and this is not investment advice.
Every tool in canli-backtest-mcp
| Tool | What it does |
|---|---|
list_factors | The point-in-time factors pit_factor builds from SEC filings, and what each measures. |
pit_factor | Build a factor from SEC filings for a list of tickers, monthly from start to end, using only what had been filed by each date (restatements invisible until filed). Writes a signal CSV for backtest_signal. Values are what companies reported to the SEC in XBRL, as filed by each date; a company that files late, files outside XBRL or changes its tags can be missing. |
backtest_signal | Backtest a signal against your prices: rank, long and short quantiles, rebalance, trading only on what was known lag_days earlier, costs on actual trades. Every reply holds the result against the crises its dates cover and lists the ones it does not. With capital_usd and dollar_volume_file, orders fill only as far as the market traded, pay square-root impact, and the reply shows the Sharpe at each size the market can take. Pass ledger to judge the best of a search against all of it. A backtest measures one path of history under these costs; it does not establish that the signal will keep working. |
proof_filings | Add what companies filed to a signed, append-only ledger: each figure with its filing, and a restatement line whenever a later filing changes one. Re-running adds only what is new. It shows the lines were not altered afterwards, not that a figure is right. |
proof_file | Record a file's hash in a signed, append-only ledger, a backtest result or a returns file, so anyone can later check this exact file existed by then. Nothing else about the file is claimed. |
proof_verify | Check a proof ledger from the file alone: every hash, order and signature, and any heads published elsewhere. Says which line first fails. |
proof_find | Look up a file, company or concept in a proof ledger. No record means only that this ledger holds none, not that anything is wrong. |
league_new | Start a paper league: a schedule of rounds and rules with a hash to publish. No prizes, no stakes and nobody's money. |
league_commit | Commit a league entry before its round closes: only the hash of its CSV of ticker,score goes in the ledger, and the file is shown after the round. Only the latest commit counts, so revealing whichever of several did best is refused. |
league_score | Score a paper league from its files and prices, repeatable by anyone: each entrant's rank correlation with what followed, set against the best luck gives across that many entrants, how different each is from the rest, and a paper book of the top entrants chosen on earlier rounds only. |
exchange_new | Start a paper exchange where different AI agents and scripted traders (market makers, momentum, value, deleveragers, stop-losses, levered longs) trade in limit order books, with margin rules and forced selling, plus shocks at set steps. Made-up assets and money, reproducible from a seed. |
exchange_join | Join a paper exchange as an agent. Returns the token its other calls need, so no agent can act as another. |
exchange_view | What an agent in a paper exchange can see: the books, recent trades and its own account. No other agent's positions. |
exchange_orders | Send an agent's limit orders, market orders and cancels for the coming step of a paper exchange. An empty list passes. |
exchange_step | Move a paper exchange on. Waits for every joined agent to act, so nobody moves time on the others. |
exchange_report | What happened in a paper exchange: each asset's worst fall and recovery, spreads and depth, who gained and lost, forced selling and the longest chain of it, and a hash anyone can check by replaying. |
exchange_run | Run a whole paper exchange of scripted traders in one call and report it: for comparing set-ups, such as how much leverage turns a shock into a cascade. A simulation, not a forecast. |
agent_consensus | Combine several AI agents' probabilities, and count how many independent views they really hold, from how their errors move together: five models that share their mistakes are not five votes. Weights each by its record on settled questions. |
find_diversifiers | Rank candidate strategies by what they add to a book: independent bets added first, then how they behave on the book's worst days, with return shown last and never used to rank. Correlation first. |
arena_new | Start a paper market for AI agents to trade in: made-up assets and made-up money, with scripted traders, reproducible from a seed. Nothing here represents or reaches a real security, token or currency. |
arena_orders | Send paper orders for an agent in an arena, for the coming auction. No short selling and no borrowing. |
arena_step | Clear a paper arena's next call auctions at one price per asset, and show prices and standings. Paper only. |
crisis_replay | Hold any strategy's daily returns against named market crises (2000-02 dot-com bust, 2008-09 bank crisis, 2011 US downgrade and euro debt scare, 2013 taper tantrum in bonds and others): its return, drawdown and worst day in each one its dates fully cover, and the crises it was not there for, listed as untested and never as passed. |
cpcv | Combinatorial purged cross-validation of a search: choose the best trial on training days, score it on held-out blocks, with purge and embargo at the edges, for every choice of blocks, stitched into whole paths. Returns the spread of out-of-sample Sharpes against the in-sample one. Splits can run as shards on other machines and merge back. Paths share days and data, so their spread is not a confidence interval and they are not independent tests. |
price_panel | Build a price panel from free sources for breadth_book or backtest_signal: the tickers you name or an index fund's current holdings, daily adjusted closes and dollar volume, and each company's Fama-French industry from its SEC SIC code, written as CSV files. |
breadth_signals | The cross-sectional signals breadth_book builds sleeves from: momentum, reversal, low volatility and beta, idiosyncratic risk, lottery demand, skewness, price delay, seasonality and liquidity, each with its formula's source and the data it needs. |
breadth_book | Build many weakly correlated sleeves (every signal inside every group of names) from your price panel and trade them as one netted account, ALPHAC's breadth lab: rank-weighted within each group, overlapping portfolios, hedged and scaled to a volatility target, costs on actual trades. Returns the book netted and standalone, the netting ratio, effective independent bets and ideas, and writes every sleeve's returns as a training dataset. A sleeve built on many signals and groups is a search: report the number of sleeves, keep a period untouched for the test, and judge the book there, not on the years used to choose it. |
breadth_sweep | Run a grid of breadth-book settings (signal sets, smoothing, target volatility, costs, minimum names) in parallel on every core of this machine, or as shards other machines run and merge_files joins. Every combination counts as a trial: the best Sharpe is set against what the best of that many trials reaches by luck, and with split_date the chosen settings are scored after the split. |
effective_bets | How many independent bets a set of return series holds: the participation ratio of their weekly correlations (n for unrelated series, 1 for copies), and with families, the families' bets and the ideas they cluster into. |
annotation_packet | Start a labelled dataset: figures (company, measure, period, value) are checked by machine against the SEC filings and written as blind CSV packets for two or more people to label, with guidelines and a key holding the machine labels. |
annotation_agreement | Read filled annotation packets: how often the people agree (Cohen's kappa), how often they agree with the machine, and every disagreement. |
annotation_gold | Merge filled annotation packets and a reviewer's decisions into a gold dataset (JSONL: each item's label, who decided it, the machine label and source) with a datasheet of agreement and hashes. |
All Canli Capital MCP servers · How they work and are tested · How they compare with other finance MCP servers
