Is the Alpaca MCP server safe? What it can reach
What the Alpaca MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.
Alpaca maintains this server. It runs locally over stdio and signs in with an Alpaca API key and secret. It can place, replace and cancel real orders and close positions, so the key decides whether money moves. It defaults to paper trading, and ALPACA_TOOLSETS can drop the trading tools entirely.
Who maintains it
| Implementation | Kind | Status |
|---|---|---|
| alpacahq/alpaca-mcp-server (v2) | Official | active |
It runs as a local process on your machine.
How it signs in
An Alpaca API key and secret key, passed as ALPACA_API_KEY and ALPACA_SECRET_KEY. The server acts as that Alpaca account, on paper or live depending on ALPACA_PAPER_TRADE.
What its tools can do
| Kind | Tools |
|---|---|
| Read | get_account_info, get_account_config, get_portfolio_history, get_account_activities, get_account_activities_by_type, get_orders, get_order_by_id, get_order_by_client_id, get_all_positions, get_open_position, get_watchlists, get_watchlist_by_id, get_all_assets, get_asset, get_option_contracts, get_option_contract, get_calendar, get_clock, get_corporate_action_announcements, get_corporate_action_announcement, get_stock_bars, get_stock_quotes, get_stock_trades, get_stock_latest_bar, get_stock_latest_quote, get_stock_latest_trade, get_stock_snapshot, get_most_active_stocks, get_market_movers, get_crypto_bars, get_crypto_quotes, get_crypto_trades, get_crypto_latest_bar, get_crypto_latest_quote, get_crypto_latest_trade, get_crypto_snapshot, get_crypto_latest_orderbook, get_option_bars, get_option_trades, get_option_latest_trade, get_option_latest_quote, get_option_snapshot, get_option_chain, get_option_exchange_codes, get_corporate_actions, get_news, get_fixed_income_latest_quotes, get_locates, get_locate, get_locate_quotes, search_alpaca_docs, fetch_alpaca_doc, search_alpaca_api_specs, list_alpaca_api_endpoints, get_alpaca_endpoint_docs |
| Write | create_watchlist, update_watchlist_by_id, add_asset_to_watchlist_by_id, remove_asset_from_watchlist_by_id |
| Can’t be undone | place_stock_order, place_crypto_order, place_option_order, replace_order_by_id, cancel_order_by_id, cancel_all_orders, close_position, close_all_positions, exercise_options_position, do_not_exercise_options_position, delete_watchlist_by_id, create_locate, update_account_config |
This is the v2 rewrite, and the README says none of the v1 tools exist in v2. The locate tools are not available in paper trading. Order tools are listed as destructive because a filled order moves money and cannot be undone.
Built-in limits
| Option | What it does |
|---|---|
ALPACA_PAPER_TRADE | Defaults to true, which uses the paper trading environment. Setting it to false switches to live trading. |
ALPACA_TOOLSETS | A comma-separated list of toolsets to enable: account, trading, watchlists, assets, stock-data, crypto-data, options-data, corporate-actions, news, fixed-income-data and locates. Leave out account and trading for market data only. |
Paper keys | The README has you generate keys from a free paper trading account, and the paper environment is the default. |
The risks
- With live keys, an injected instruction can place or cancel orders, and close_all_positions liquidates the whole portfolio at market prices.
- exercise_options_position acts on a contract you hold and create_locate requests a short-sale locate, and neither is documented as undoable.
- News and documentation tools return third-party text, so a crafted article can try to steer the agent into trading.
- The README says this package does not configure remote MCP authentication, so exposing it to the internet would put your Alpaca keys behind an open endpoint.
Limit it in Claude Code
Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:
claude mcp add --env ALPACA_API_KEY=... --env ALPACA_SECRET_KEY=... alpaca -- uvx alpaca-mcp-serverClaude Code names MCP tools mcp__alpaca__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:
{
"permissions": {
"deny": [
"mcp__alpaca__close_all_positions",
"mcp__alpaca__cancel_all_orders",
"mcp__alpaca__exercise_options_position",
"mcp__alpaca__do_not_exercise_options_position",
"mcp__alpaca__delete_watchlist_by_id",
"mcp__alpaca__create_locate",
"mcp__alpaca__update_account_config"
],
"ask": [
"mcp__alpaca__create_watchlist",
"mcp__alpaca__update_watchlist_by_id",
"mcp__alpaca__add_asset_to_watchlist_by_id",
"mcp__alpaca__remove_asset_from_watchlist_by_id",
"mcp__alpaca__place_stock_order",
"mcp__alpaca__place_crypto_order",
"mcp__alpaca__place_option_order",
"mcp__alpaca__replace_order_by_id",
"mcp__alpaca__cancel_order_by_id",
"mcp__alpaca__close_position"
]
}
}Limit it in Codex
Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:
[mcp_servers.alpaca]
command = "uvx"
args = ["alpaca-mcp-server"]
env_vars = ["ALPACA_API_KEY", "ALPACA_SECRET_KEY"]
disabled_tools = ["close_all_positions", "cancel_all_orders", "exercise_options_position", "do_not_exercise_options_position", "delete_watchlist_by_id", "create_locate", "update_account_config"]Checklist
- Start on a paper account and leave ALPACA_PAPER_TRADE at true.
- Set ALPACA_TOOLSETS to the data toolsets if you do not want the agent to trade.
- Deny close_all_positions and cancel_all_orders.
- Require approval for every order tool before you use live keys.
Checked against the vendor documentation on November 25, 2026. alpacahq/alpaca-mcp-server README · Repository metadata (GitHub API)
What Excellent covers
Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server
Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing