Canli Paper Trading

v0.3.1
io.github.arhancanli/canli-paper-trading-mcp Checked 1 day ago Published 1 month ago

Agent trading on your Alpaca paper account behind pre-trade checks and confirmation tokens.

Values you need

VariableWhat it is
ALPACA_PAPER_KEY_IDrequired secret Your Alpaca paper API key id (starts with PK).
ALPACA_PAPER_SECRET_KEYrequired secret Your Alpaca paper API secret key.
CANLI_HOMEoptional Directory with limits.json, KILL and the order log; default ~/.canli.

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add canli-paper-trading-mcp -e 'ALPACA_PAPER_KEY_ID=<ALPACA_PAPER_KEY_ID>' -e 'ALPACA_PAPER_SECRET_KEY=<ALPACA_PAPER_SECRET_KEY>' -- npx -y canli-paper-trading-mcp@0.3.1
Add to claude_desktop_config.json
{
  "mcpServers": {
    "canli-paper-trading-mcp": {
      "args": [
        "-y",
        "canli-paper-trading-mcp@0.3.1"
      ],
      "command": "npx",
      "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": {
      "args": [
        "-y",
        "canli-paper-trading-mcp@0.3.1"
      ],
      "command": "npx",
      "env": {
        "ALPACA_PAPER_KEY_ID": "<ALPACA_PAPER_KEY_ID>",
        "ALPACA_PAPER_SECRET_KEY": "<ALPACA_PAPER_SECRET_KEY>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "ALPACA_PAPER_KEY_ID",
      "id": "alpaca-paper-key-id",
      "password": true,
      "type": "promptString"
    },
    {
      "description": "ALPACA_PAPER_SECRET_KEY",
      "id": "alpaca-paper-secret-key",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "canli-paper-trading-mcp": {
      "args": [
        "-y",
        "canli-paper-trading-mcp@0.3.1"
      ],
      "command": "npx",
      "env": {
        "ALPACA_PAPER_KEY_ID": "${input:alpaca-paper-key-id}",
        "ALPACA_PAPER_SECRET_KEY": "${input:alpaca-paper-secret-key}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.canli-paper-trading-mcp]
command = "npx"
args = ["-y", "canli-paper-trading-mcp@0.3.1"]
env = { "ALPACA_PAPER_KEY_ID" = "<ALPACA_PAPER_KEY_ID>", "ALPACA_PAPER_SECRET_KEY" = "<ALPACA_PAPER_SECRET_KEY>" }

For AI agents

  1. Ask the user for: ALPACA_PAPER_KEY_ID, ALPACA_PAPER_SECRET_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: paper_account, preview_paper_orders, rebalance_to_weights, verify_attestation, send_paper_orders.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json