Skip to content
MCP server

Canli Paper Trading

Paper-trading MCP server with pre-trade checks and single-use confirmation tokens

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, self-hosted
Runs
Locally
Version
0.3.1
Listing updated
2 days ago

About Canli Paper Trading

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

Canli Paper Trading puts guard rails between an AI agent and your Alpaca paper account. Every order is previewed against your own limits, the market clock and a kill switch. Only orders that pass receive a five-minute token, bound to the exact orders previewed, and only a token can send them. The package has no live trading host and refuses live keys.

Limits live in a limits.json file, and a call can tighten them for one preview but never loosen them. Creating a file named KILL makes every preview fail and every send refuse. Sent orders carry an id derived from the token so a retry cannot fill twice, and each send is appended to a hash-chained order log.

Previews and sends return signed attestations, using an Ed25519 key made locally and, on Node 24.7 or later, an ML-DSA-65 key too. Setting CANLI_PAPER_PRIVATE=1 hides the account figures from the model. It is MIT licensed and runs locally over stdio.

Install

Run in a terminal

claude mcp add canli-paper-trading-mcp --env ALPACA_PAPER_KEY_ID='<ALPACA_PAPER_KEY_ID>' --env ALPACA_PAPER_SECRET_KEY='<ALPACA_PAPER_SECRET_KEY>' -- npx -y canli-paper-trading-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "canli-paper-trading-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-paper-trading-mcp"
      ],
      "env": {
        "ALPACA_PAPER_KEY_ID": "<ALPACA_PAPER_KEY_ID>",
        "ALPACA_PAPER_SECRET_KEY": "<ALPACA_PAPER_SECRET_KEY>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "canli-paper-trading-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-paper-trading-mcp"
      ],
      "env": {
        "ALPACA_PAPER_KEY_ID": "<ALPACA_PAPER_KEY_ID>",
        "ALPACA_PAPER_SECRET_KEY": "<ALPACA_PAPER_SECRET_KEY>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "canli-paper-trading-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "canli-paper-trading-mcp"
      ],
      "env": {
        "ALPACA_PAPER_KEY_ID": "<ALPACA_PAPER_KEY_ID>",
        "ALPACA_PAPER_SECRET_KEY": "<ALPACA_PAPER_SECRET_KEY>"
      }
    }
  }
}

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

{
  "mcpServers": {
    "canli-paper-trading-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-paper-trading-mcp"
      ],
      "env": {
        "ALPACA_PAPER_KEY_ID": "<ALPACA_PAPER_KEY_ID>",
        "ALPACA_PAPER_SECRET_KEY": "<ALPACA_PAPER_SECRET_KEY>"
      }
    }
  }
}

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

{
  "mcpServers": {
    "canli-paper-trading-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "canli-paper-trading-mcp"
      ],
      "env": {
        "ALPACA_PAPER_KEY_ID": "<ALPACA_PAPER_KEY_ID>",
        "ALPACA_PAPER_SECRET_KEY": "<ALPACA_PAPER_SECRET_KEY>"
      }
    }
  }
}

Configuration

  • ALPACA_PAPER_KEY_IDYour Alpaca paper API key id (starts with PK).Required
  • ALPACA_PAPER_SECRET_KEYYour Alpaca paper API secret key.Required
  • CANLI_HOMEDirectory with limits.json, KILL and the order log; default ~/.canli.

Tools this server provides (4)

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

paper_account
Equity, cash, buying power, positions, open orders, market clock, kill switch and order log head
preview_paper_orders
Runs pre-trade checks and returns a token only if every order passes
rebalance_to_weights
Turns target weights into whole-share orders, checks them and returns a token
send_paper_orders
Sends previewed orders with their token, or cancels open orders by id

What it does

Pre-trade checks
Kill switch, allowed symbols and types, market hours, price collar, notional and position caps.
Confirmation tokens
Single use, five minutes, bound to the exact orders previewed.
Rebalance to weights
Turns target weights into whole-share orders, sells first.
Tamper-evident log
Order log lines chain by hash, and paper_account reports whether the chain verifies.
Signed attestations
Statements about checked orders signed with a locally generated key.
Private balances
An option replaces account figures with commitments so the model never sees them.

Good for

  • Let an agent trade a paper account under hard limits
  • Rebalance a paper portfolio from backtest weights
  • Audit what an agent did with a hash-chained log
  • Stop all agent trading instantly with a KILL file

Pricing

Open source

MIT licensed, free

Prices change. Check canlicapital.com before you buy.

Canli Paper Trading FAQ

Can it trade a live account?

No. It is paper-only and live keys are refused.

Where do my keys go?

They stay in your environment; only Alpaca's paper API is contacted.

Can an agent loosen my limits?

No. A call can only tighten limits for one preview.

How do I stop it?

Create a file named KILL in the CANLI_HOME directory.

Is Canli Paper Trading free?

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

How do I add Canli Paper Trading to Claude Code?

Run this command in your terminal: claude mcp add canli-paper-trading-mcp --env ALPACA_PAPER_KEY_ID='<ALPACA_PAPER_KEY_ID>' --env ALPACA_PAPER_SECRET_KEY='<ALPACA_PAPER_SECRET_KEY>' -- npx -y canli-paper-trading-mcp

What are the best alternatives to Canli Paper Trading?

The closest alternatives to Canli Paper Trading are Solana MCP by Vybe, Tapetide - Indian Stock Market MCP, Budget Tracker, Quantivex Research and Provyan.

Alternatives to Canli Paper Trading

  1. Remote MCP server exposing the Vybe Solana API to AI clients and code editors

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

    • 17 tools
    • Remote
    • Freemium
    • 150 GitHub stars
    • Finance and payments
  3. 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
  4. Stock scores, what a price assumes, earnings quality and quiet profit revisions

    • 11 tools
    • Remote
    • Free
    • Finance and payments
  5. Provyan

    MCP server

    Backtested crypto signal results on 94 coins, with luck odds and sources

    • 4 tools
    • Remote
    • Free
    • Finance and payments
  6. TribuJus

    MCP server

    Read-only access to UK bank accounts, cards and transactions via TrueLayer Open Banking

    Not checked yet
    • 5 tools
    • Remote
    • Open source
    • Legal and government