Guide agents to call tac-engine MCP tools for Alpaca trading and market data (news, corporate actions, screener, FX, stocks, options, realtime streams) via MCP Inspector, Cursor, or other clients.
tradeac-alpaca
Use tac-engine MCP tools — not raw Alpaca REST — for brokerage ops and market data. Same tool surface will back TradeAC’s Next.js UI later.
MCP-first policy
Prefer the MCP tools registered in this session (tac-engine server, tools listed below) over writing scripts that reimplement them. If a tool exists, call it directly — do not reinvent it with curl/bash/python (raw Alpaca REST, hand-rolled pagination, own JSON-RPC clients).
NEVER script directly against the MCP server (spawning the binary, talking stdio JSON-RPC, or driving it via bash/curl) unless the MCP tool surface genuinely can't do the job — and in that case stop and ask the user to confirm first before writing the script.
If a direct Alpaca call is needed (e.g. an endpoint with no tool), say so and let the user confirm the approach; otherwise keep everything on the MCP surface.
Hosts / env
Purpose
Env
Default
Trading REST
APCA_BASE_URL
https://paper-api.alpaca.markets
Market data REST
APCA_DATA_BASE_URL
https://data.alpaca.markets
Market data WS
APCA_STREAM_BASE_URL
wss://stream.data.alpaca.markets
Auth
APCA_API_KEY_ID, APCA_API_SECRET_KEY
required
cargo build --release
./target/release/tac-engine
Secrets policy
NEVER write secrets into files: API keys (APCA_API_KEY_ID/APCA_API_SECRET_KEY), DB passwords, OAuth tokens, or credential-bearing URLs in scripts, configs, notes or committed code.
NEVER read *.env / .env.* directly (cat/tail/grep/sed/head on .env). That pulls secrets into this session and leaks them to any agent sharing it.
When a tool or command needs an env var, ASK the user to set it in the environment (shell/container env, or the user-owned .env) and reference it by name ($VAR), never by value. If it's missing, report which variable is required instead of reading it yourself.
If you find a committed secret, flag it, remove it, and replace it with a placeholder.
subscribe_market_stream opens a short-lived WebSocket (samples then disconnects). Most Alpaca plans allow one concurrent stream — close other clients first.
Tool catalog
Lake tools (get_lake_bars, get_lake_ta, get_lake_sp, get_lake_features, backfill_lake_calendar, …) live under tradeac-lake (see tac-engine/skills/tradeac-lake/SKILL.md). When a lake call's purpose is backfilling/persisting (not reading the payload), pass "quiet": true so the tool returns a summary (count/first_t/last_t/source/columns) instead of echoing back the full bar/feature rows.