# Canli Validation

Canli Validation — an MCP server for trading strategy validation via deflated Sharpe ratio, CSCV overfitting probability and data-snooping tests, with signed receipts.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6 repo stars
- Author: arhancanli
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/arhancanli/canlicapital/tree/HEAD/mcp
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/canli-validation

## What it does

The server exposes twenty tools: deflated Sharpe ratio accounting for the number of trials, CSCV overfitting probability, data-snooping tests (Hansen's SPA, White's Reality Check, Romano-Wolf StepM), minimum track record length, haircut Sharpe, and luck-equivalent trials. Each result includes a signed receipt verifiable offline.

Runs in three modes: over the public HTTP endpoint at `https://canlicapital.com/mcp`, locally via `npx` with `CANLI_LOCAL=1` (computes on your machine, no key needed), or through the free API with stored receipts (a key is issued on first request). For data-snooping tests, a matrix file is read from disk and sent as numbers.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://canlicapital.com/mcp`
- Environment variables: `CANLI_KEY`, `CANLI_LOCAL`, `CANLI_API_BASE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http canli-validation-mcp https://canlicapital.com/mcp
```

2. **Platform CLI**
```bash
claude mcp add --env CANLI_KEY=<CANLI_KEY> --env CANLI_LOCAL=<CANLI_LOCAL> --env CANLI_API_BASE=<CANLI_API_BASE> --transport stdio mcp -- npx -y canli-validation-mcp
```
Replace <…> with your own values

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add mcp --url https://canlicapital.com/mcp
```

2. **Platform CLI**
```bash
codex mcp add mcp --env CANLI_KEY=<CANLI_KEY> --env CANLI_LOCAL=<CANLI_LOCAL> --env CANLI_API_BASE=<CANLI_API_BASE> -- npx -y canli-validation-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "url": "https://canlicapital.com/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "canli-validation-mcp"
            ],
            "env": {
                "CANLI_KEY": "<CANLI_KEY>",
                "CANLI_LOCAL": "<CANLI_LOCAL>",
                "CANLI_API_BASE": "<CANLI_API_BASE>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "http",
            "url": "https://canlicapital.com/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "canli-validation-mcp"
            ],
            "env": {
                "CANLI_KEY": "<CANLI_KEY>",
                "CANLI_LOCAL": "<CANLI_LOCAL>",
                "CANLI_API_BASE": "<CANLI_API_BASE>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http mcp https://canlicapital.com/mcp
```

2. **Platform CLI**
```bash
gemini mcp add -e CANLI_KEY=<CANLI_KEY> -e CANLI_LOCAL=<CANLI_LOCAL> -e CANLI_API_BASE=<CANLI_API_BASE> mcp npx -y canli-validation-mcp
```
Replace <…> with your own values

## When to use it
- determine whether the best result out of hundreds of parameter trials is genuine or lucky noise
- compute the deflated Sharpe ratio correcting for multiple testing
- calculate the minimum backtest length required for a claimed Sharpe ratio
- obtain a signed validation receipt verifiable offline

## Example prompts
- I tested 229 strategy variants; the best one had an annualized Sharpe of 1.5 over 730 daily returns (365 per year), skew -0.5, kurtosis 5, with Sharpe ratios spread by 0.57 across variants. Is it real?
- Calculate deflated Sharpe: 156 trials, final Sharpe 1.8, 500 observations, skewness -0.3.
- Verify the validation receipt with id `a1b2c3d4` — is the signature valid?

## Similar
- [walk-forward-validation](https://affpapa.org/en/nevibecode/skills/walk-forward-validation.md) — skill · 837 installs
- [Apex — AI Component Card Store](https://affpapa.org/en/nevibecode/mcp/apex-ai-component-card-store.md) — MCP server · 523 installs
- [Varrd](https://affpapa.org/en/nevibecode/mcp/varrd.md) — MCP server · 2427 installs
- [algorithmic-trading](https://affpapa.org/en/nevibecode/skills/algorithmic-trading.md) — skill · 544 installs
- [llmquant-options](https://affpapa.org/en/nevibecode/skills/llmquant-options.md) — skill · 517 installs
- [AKQuant](https://affpapa.org/en/nevibecode/mcp/akquant.md) — MCP server · ★ 2627 repo stars

From the same set: [arhancanli/canlicapital](https://affpapa.org/en/nevibecode/by/arhancanli/canlicapital.md) — 8 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
