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.
无需输入参数。
io.github.arhancanli由 GitHub 账号 arhancanli 发布v0.3.1更新于 Oct 25, 2026
Agent trading on your Alpaca paper account behind pre-trade checks and confirmation tokens.
让助手只能通过盘前检查、五分钟确认令牌和紧急停止开关来操作 Alpaca 模拟(paper)账户。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
参照 仓库 中的启动说明。
Lets an AI agent trade your Alpaca paper account without being able to skip the checks. Every order is previewed against your own limits, the market clock and a kill switch; only orders that pass get a five-minute confirmation token, and only a token can send them. Paper only: the package contains no live trading host, and live keys are refused.
Local stdio. Your keys stay in your environment; nothing goes anywhere except Alpaca's paper API.
The pre-trade checks are canlicapital's shared core (js/pretrade-core.js, mirrored byte for byte
and tested in the repository). Per order: kill switch, allowed symbols and order types, market open
or closed, price collar, order and daily notional caps, position, gross and net caps against your
whole book, reduce-only integrity, and an estimated cost (half spread; commission and impact when
you supply fees and volume). A rejection lists every reason; nothing is resized.
Your limits live in CANLI_HOME/limits.json (default ~/.canli), for example:
A call can tighten these for one preview, never loosen them. While a file named KILL exists in
that directory, every preview fails and every send is refused.
client_order_id derived from its token. Alpaca refuses a repeated id,
so a retried send cannot fill twice.Every send and cancel is appended to CANLI_HOME/paper-orders.jsonl, each line holding the hash of
the one before. paper_account reports whether the chain still verifies; an edited line breaks it.
Every preview, rebalance and send returns an attestation: which orders were checked (their hash),
against which limits (their hash), the verdict, the kill switch, the time, and commitments to the
account's equity and positions, signed with an Ed25519 key made on your machine the first time
(CANLI_HOME/attest-ed25519.pem, mode 0600; it never leaves the machine). Give
attest-ed25519.pub.pem to an auditor or counterparty; verify_attestation checks a statement was
signed by that key and not altered. On Node 24.7 or later each statement is also signed with an
ML-DSA-65 key (FIPS 204, a post-quantum signature; attest-ml-dsa-65.pem), over the same statement
naming both keys: give both public keys, and both signatures must hold, so a statement stays
unforgeable even if one scheme is broken.
Set CANLI_PAPER_PRIVATE=1 and the model never sees the account's figures: paper_account returns
commitments (SHA-256 of a random salt and the value) instead of equity, cash, buying power and
positions; rebalance_to_weights sizes orders without showing them; numbers in check messages are
blanked. The salts are written only to CANLI_HOME/commitments.jsonl, so you can later open a
commitment to someone (show its value and salt) and verify_attestation confirms it.
This is a signature over commitments, not a zero-knowledge proof: whoever you open a value to learns it, and the checks are this server's code. Brokers accept API keys, not proofs; the keys stay in the environment and are never shown to the model in either mode.
PK).Then ask: "Rebalance my paper account to 60% SPY and 40% TLT, show me the checks, and send it if everything passes."
Pairs with canli-quant-mcp: backtest a strategy there, then move the paper account to its target weights here.
It does not trade real money, and there is no setting that makes it. It does not decide what to trade. Paper fills are Alpaca's simulation and are kinder than real markets (no queue position, no market impact); a strategy that works on paper has not yet shown it works live.
MIT licence.
来源:mcp-paper/README.md,提交 019682d
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
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.
feeslimitsorders必填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.
feeslimitsallow_shortcash_buffermin_trade_usdallow_leveragetarget_weights必填liquidate_othersVerify 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.
openingsattestation必填public_key_pempq_public_key_pemSend 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.
tokencancel_order_ids已满足适用检查项的 90%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
{ "max_order_notional": 10000, "max_position_frac": 0.2, "max_gross": 1.0, "allowed_types": ["limit"] }claude mcp add canli-paper -e ALPACA_PAPER_KEY_ID=PK... -e ALPACA_PAPER_SECRET_KEY=... -- npx -y canli-paper-trading-mcp