# Canli Paper Trading

> Canli Paper Trading is an open-source MCP server for finance and payments. Paper-trading MCP server with pre-trade checks and single-use confirmation tokens. It runs locally on your machine and is started by your AI client.

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

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
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
```

### Claude Desktop (claude_desktop_config.json)

```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>"
      }
    }
  }
}
```

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

```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>"
      }
    }
  }
}
```

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

```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>"
      }
    }
  }
}
```

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

```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>"
      }
    }
  }
}
```

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

```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>"
      }
    }
  }
}
```

## Tools

- `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

## 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

- [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.
- [Budget Tracker](https://ai-powered.com/mcp/budget-tracker-2): Budget Tracker is a freemium MCP server for finance and payments.
- [Quantivex Research](https://ai-powered.com/mcp/quantivex-research): Quantivex Research is a free MCP server for finance and payments.
- [Provyan](https://ai-powered.com/mcp/provyan): Provyan is a free MCP server for finance and payments.
- [TribuJus](https://ai-powered.com/mcp/tribujus): TribuJus is an open-source MCP server for legal and government.
- [L2WS](https://ai-powered.com/mcp/l2ws): L2WS is a paid MCP server for finance and payments.
- [Invoices](https://ai-powered.com/mcp/invoices): Invoices is a paid MCP server for files and documents.

---
Source: https://ai-powered.com/mcp/canli-paper-trading
