alpaca-rs
Rust SDK, CLI, and MCP server for the Alpaca Trading API.
Architecture
Two-layer design for reusability:
Power your agent
การติดตั้งจากผู้เผยแพร่ ไม่ใช่เอนด์พอยต์ของ PlugMCP
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดจากผู้เผยแพร่
Rust SDK, CLI, and MCP server for the Alpaca Trading API.
Two-layer design for reusability:
Rust SDK, CLI, and MCP server for the Alpaca Trading API
api-client-core — Generic async REST + WebSocket client abstractions, pagination helpers, and error types. Reusable by future SDKs for other APIs.alpaca-sdk — Alpaca-specific client, types, and WebSocket streaming built on api-client-core.alpaca-cli — Command-line interface for querying accounts, positions, orders, quotes, and bars.alpaca-mcp — MCP server exposing Alpaca operations as tools for Claude (planned).use alpaca_sdk::{AlpacaClient, AlpacaConfig};
let config = AlpacaConfig::from_env()?;
let client = AlpacaClient::new(config)?;
// Trading
let account = client.get_account().await?;
let positions = client.list_positions().await?;
let order = client.submit_order("AAPL", 10, "buy", "market", "day", None, false).await?;
// Market Data
let quote = client.get_latest_quote("AAPL").await?;
let trade = client.get_latest_trade("TSLA").await?;
let snapshot = client.get_snapshot("SPY").await?;
let bars = client.get_bars("SOXL", start, end, "1Day", None, None, None).await?;
// Reference Data
let assets = client.get_assets(Some("active"), Some("us_equity")).await?;
let calendar = client.get_calendar(Some(start), Some(end)).await?;
let clock = client.get_clock().await?;
use alpaca_sdk::{AlpacaConfig, AlpacaStream, MarketDataFeed};
let config = AlpacaConfig::from_env()?;
// Real-time market data
let mut stream = AlpacaStream::connect_market_data(&config, MarketDataFeed::Iex).await?;
stream.subscribe_trades(&["AAPL", "TSLA"]).await?;
stream.subscribe_quotes(&["SPY"]).await?;
while let Some(msg) = stream.recv().await {
println!("{:?}", msg?);
}
// Trade updates (order fills, cancellations)
let mut updates = AlpacaStream::connect_trade_updates(&config).await?;
updates.listen_trade_updates().await?;
while let Some(update) = updates.recv_trade_update().await {
println!("{:?}", update?);
}
# Set credentials
export APCA_API_KEY_ID=your_key
export APCA_API_SECRET_KEY=your_secret
# Run commands
cargo run -p alpaca-cli -- account
cargo run -p alpaca-cli -- quote AAPL
cargo run -p alpaca-cli -- bars SOXL --start 2024-01-01 --end 2024-12-31
cargo run -p alpaca-cli -- positions
cargo run -p alpaca-cli -- orders --status open
cargo run -p alpaca-cli -- clock
Set environment variables or use AlpacaConfig::paper():
get_option_contracts, trading API) with bounded next_page_token paginationget_option_snapshots, market-data API, v1beta1, OPRA feed)cargo build --workspace # Build all crates
cargo test --workspace # Run all tests
cargo clippy --workspace -- -D warnings # Lint
cargo fmt --all # Format
MIT
Rust SDK, CLI, and MCP server for the Alpaca Trading API
เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Alpaca Rs ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-10-28 Rust SDK, CLI, and MCP server for the Alpaca Trading API