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.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

paper_account Paper account

Read your Alpaca paper account: equity, cash, buying power, positions, open orders, the market clock, the kill switch and the local order log's verified head.

preview_paper_orders Preview paper orders

Check orders against your paper account, live quotes, the market clock, your limits file and the kill switch; when every order passes, return a five-minute confirmation token for exactly these orders.

ParameterTypeDescription
orders *arrayOrders to check.
feesobjectYour fee schedule, if any (Alpaca equities: no commission).
limitsobjectTighten your limits file for this call only (e.g. {"max_order_notional": 5000}).

rebalance_to_weights Rebalance to weights

Turn target portfolio weights into the whole-share orders that move your paper account there (sells first), check them, and return a confirmation token when all pass.

ParameterTypeDescription
target_weights *objectTarget weight per ticker as a fraction of equity, e.g. {"SPY": 0.6, "TLT": 0.4}.
allow_leveragebooleanAllow gross weight above 1; default false.
allow_shortbooleanAllow negative weights; default false.
cash_buffernumberEquity kept in cash; default 0.02.
feesobjectYour fee schedule, if any (Alpaca equities: no commission).
limitsobjectTighten your limits file for this call only (e.g. {"max_order_notional": 5000}).
liquidate_othersbooleanSell holdings not in target_weights; default false.
min_trade_usdnumberSkip smaller changes; default 50.

verify_attestation Verify an attestation

Check an attestation a pre-trade check or send returned: that it was signed by the trader's keys (Ed25519 and, where present, post-quantum ML-DSA-65; both must hold) and not altered, and, given openings from the trader's commitments file, that committed account figures are what they claim. Offline; reads nothing from Alpaca.

ParameterTypeDescription
attestation *objectAn attestation object a check or send returned.
openingsarrayCommitments to open: label, commitment, salt and value, from the trader's commitments.jsonl.
pq_public_key_pemstringThe signer's ML-DSA-65 public key (PEM), for an attestation also signed post-quantum; default this machine's CANLI_HOME/attest-ml-dsa-65.pub.pem.
public_key_pemstringThe signer's public key (PEM); default this machine's CANLI_HOME/attest-ed25519.pub.pem.

send_paper_orders Send paper orders

Send previewed orders to your Alpaca paper account with their confirmation token (the kill switch is read again first), or cancel open paper orders by id. Every send is logged, hash-chained.

ParameterTypeDescription
cancel_order_idsarrayOpen paper order ids to cancel instead (no token needed).
tokenstringConfirmation token from preview_paper_orders or rebalance_to_weights.