Alpaca MCP server
Alpaca's official MCP server lets an agent trade stocks, options, and crypto, manage positions, and pull market data in plain English.
Alpaca MCP Server is the official server from Alpaca, the developer-first brokerage, that lets an AI agent research markets and place real trades through natural language. It covers the full trading loop: read account info and portfolio history, place stock, options, and crypto orders, replace or cancel orders, and manage open positions including closing one or all of them and exercising options contracts. It also exposes watchlists, the market calendar and clock, assets and option contracts, and corporate-action announcements, so an agent can plan around market hours and instrument availability.
On the data side it provides bars, quotes, trades, latest snapshots, and order books for stocks, options, and crypto, plus market movers, most-active lists, and news, giving an agent the inputs to analyze before it acts. It is a Python server (a v2 rewrite built on FastMCP) launched with uvx or Docker, authenticating with ALPACA_API_KEY and ALPACA_SECRET_KEY. Critically, it defaults to paper trading via ALPACA_PAPER_TRADE, so an agent can be tested against fake money before you flip it to live; the optional ALPACA_TOOLSETS variable lets you restrict which tool groups are exposed. Because live mode moves real money, keep a human in the loop and start on paper.
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Available tools
| Tool | Description |
|---|---|
| get_account_info | Returns account details including buying power and equity. |
| get_account_config | Returns the account's trading configuration. |
| update_account_config | Updates the account's trading configuration. |
| get_portfolio_history | Returns the account's portfolio value history over time. |
| get_account_activities | Returns account activity records such as fills and transfers. |
| get_orders | Lists orders filtered by status. |
| get_order_by_id | Returns a single order by its id. |
| place_stock_order | Places a stock or ETF order. |
| place_option_order | Places an options order. |
| place_crypto_order | Places a cryptocurrency order. |
| replace_order_by_id | Replaces an existing order with new parameters. |
| cancel_order_by_id | Cancels a single order by id. |
| cancel_all_orders | Cancels all open orders. |
| get_all_positions | Lists all open positions. |
| get_open_position | Returns a single open position by symbol. |
| close_position | Closes a single open position. |
| close_all_positions | Closes all open positions. |
| exercise_options_position | Exercises an options position. |
| create_watchlist | Creates a new watchlist. |
| get_watchlists | Lists the account's watchlists. |
| add_asset_to_watchlist_by_id | Adds an asset to a watchlist. |
| remove_asset_from_watchlist_by_id | Removes an asset from a watchlist. |
| get_all_assets | Lists tradable assets. |
| get_asset | Returns details for a single asset. |
| get_option_contracts | Lists option contracts for an underlying. |
| get_calendar | Returns the market trading calendar. |
| get_clock | Returns the current market clock and open/closed status. |
| get_corporate_action_announcements | Lists corporate-action announcements. |
| get_stock_bars | Returns historical OHLCV bars for a stock. |
| get_stock_quotes | Returns historical quotes for a stock. |
| get_stock_trades | Returns historical trades for a stock. |
| get_stock_latest_quote | Returns the latest quote for a stock. |
| get_stock_latest_trade | Returns the latest trade for a stock. |
| get_stock_snapshot | Returns a full snapshot for a stock. |
| get_most_active_stocks | Returns the day's most-active stocks. |
| get_market_movers | Returns the day's top gainers and losers. |
| get_crypto_bars | Returns historical OHLCV bars for a crypto pair. |
| get_crypto_latest_quote | Returns the latest quote for a crypto pair. |
| get_crypto_latest_orderbook | Returns the latest order book for a crypto pair. |
| get_crypto_snapshot | Returns a full snapshot for a crypto pair. |
| get_option_bars | Returns historical OHLCV bars for an option contract. |
| get_option_latest_quote | Returns the latest quote for an option contract. |
| get_option_snapshot | Returns a full snapshot for an option contract. |
| get_option_chain | Returns the option chain for an underlying. |
| get_news | Returns market news articles for given symbols. |
Required configuration
- ALPACA_API_KEYRequired
Your Alpaca API key.
- ALPACA_SECRET_KEYRequired
Your Alpaca API secret key.
- ALPACA_PAPER_TRADEOptional
Use the paper-trading environment. Defaults to true; set to false for live trading.
- ALPACA_TOOLSETSOptional
Comma-separated list of tool groups to expose, restricting which tools are available.
What you can do with it
Research then trade in one conversation
The agent pulls bars, the latest quote, and recent news for a ticker, reasons about it, and places a paper order, keeping analysis and execution in the same flow.
Manage a portfolio hands-free
Ask the agent to review open positions and portfolio history and it can rebalance by closing or trimming positions and placing new orders, all against the paper account first.
FAQ
- Is it free?
- Yes. The server is free and open source (MIT) from Alpaca; you only need an Alpaca account and API keys. Paper trading and market data are available without funding a live account.
- Does it support remote/OAuth?
- No hosted OAuth endpoint. It runs locally over stdio via uvx (or Docker) and authenticates with your Alpaca API key and secret; it can also serve HTTP locally.
- Will it trade real money?
- Only if you opt in. It defaults to paper trading via ALPACA_PAPER_TRADE; set it to false to trade live. Keep a human in the loop before enabling live mode.