alpaca-guard-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ALPACA_API_KEY | Yes | From Alpaca dashboard | |
| ALPACA_SECRET_KEY | Yes | From Alpaca dashboard | |
| ALPACA_PAPER_TRADE | No | Set to 'false' for live trading (still requires ALPACA_GUARD_ALLOW_LIVE) | true |
| LEMON_CAKE_PAY_TOKEN | No | Currently unused (v0.1 local-ledger mode). Future: switch the guard to LemonCake's Pay Token preflight. | |
| ALPACA_GUARD_ALLOW_LIVE | No | Must literally be 'yes-i-understand' to enable real-money orders | |
| ALPACA_GUARD_LEDGER_DIR | No | Where cap.json lives | ~/.alpaca-guard |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| logging | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| setupA | Show alpaca-guard-mcp setup status: env vars, paper/live mode, current daily cap, and ledger file location. Read-only. |
| guard_statusA | Return today's spend ledger: daily limit, used so far, remaining, lifetime order count, and recent 10 orders. Read-only. |
| guard_set_limitA | Set the daily USD cap. The agent cannot raise its own cap silently — calling this tool is logged in the ledger. Typical use: human operator runs this once to set the daily limit (default $10) before letting the agent loose. |
| get_accountA | Alpaca account snapshot (buying power, cash, equity, portfolio value, PDT flag). Read-only. |
| get_positionsA | Current open positions on Alpaca (symbol, qty, avg entry price, current price, unrealized P&L). Read-only. |
| get_latest_quoteB | Latest bid/ask/mid quote for a given symbol from Alpaca's market-data API. Read-only. |
| guarded_place_orderA | Place an order on Alpaca, but ONLY if the trade's notional USD value fits within today's remaining cap. Pre-flight is mandatory: agent cannot override. If notional > remaining, returns BUDGET_EXCEEDED with a structured hint. On success the charge is recorded to the local ledger so the cap survives MCP restarts. Returns: { allowed, status, tradeNotionalUsd, remainingUsd, limitUsd, alpacaOrder?, x402Receipt? } |
| guarded_close_positionA | Close a position on Alpaca. Pre-flighted against the daily cap: if closing requires re-opening exposure (short close → re-buy) that exceeds the cap, refuses. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: account info, market data, positions, order placement with guard, position closing with guard, cap management, status, and setup. No overlap in functionality.
Tools follow a fairly consistent pattern with 'get_' for read-only, 'guarded_' for guarded actions, and 'guard_' for guard management. However, 'setup' breaks the pattern and 'guard_set_limit' uses an underscore after 'guard', which is a minor inconsistency.
8 tools is well-scoped for a trading guard server. Each tool earns its place by covering essential operations: account, quotes, positions, order/close with safety, cap management, status, and setup.
The tool set covers core workflows: read account/positions/quotes, place/close orders with guard, manage cap, and view status. Missing features like order cancellation or detailed order history are minor gaps that agents can work around.