Alpaca MCP server

OfficialAlpacaConfig last verified Jun 1, 2026

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.

Add to ~/.claude.json

~/.claude.json
json
{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "<ALPACA_API_KEY>",
        "ALPACA_SECRET_KEY": "<ALPACA_SECRET_KEY>",
        "ALPACA_PAPER_TRADE": "<ALPACA_PAPER_TRADE>"
      }
    }
  }
}
Or via CLI
bash
claude mcp add alpaca -- uvx alpaca-mcp-server

Available tools

ToolDescription
get_account_infoReturns account details including buying power and equity.
get_account_configReturns the account's trading configuration.
update_account_configUpdates the account's trading configuration.
get_portfolio_historyReturns the account's portfolio value history over time.
get_account_activitiesReturns account activity records such as fills and transfers.
get_ordersLists orders filtered by status.
get_order_by_idReturns a single order by its id.
place_stock_orderPlaces a stock or ETF order.
place_option_orderPlaces an options order.
place_crypto_orderPlaces a cryptocurrency order.
replace_order_by_idReplaces an existing order with new parameters.
cancel_order_by_idCancels a single order by id.
cancel_all_ordersCancels all open orders.
get_all_positionsLists all open positions.
get_open_positionReturns a single open position by symbol.
close_positionCloses a single open position.
close_all_positionsCloses all open positions.
exercise_options_positionExercises an options position.
create_watchlistCreates a new watchlist.
get_watchlistsLists the account's watchlists.
add_asset_to_watchlist_by_idAdds an asset to a watchlist.
remove_asset_from_watchlist_by_idRemoves an asset from a watchlist.
get_all_assetsLists tradable assets.
get_assetReturns details for a single asset.
get_option_contractsLists option contracts for an underlying.
get_calendarReturns the market trading calendar.
get_clockReturns the current market clock and open/closed status.
get_corporate_action_announcementsLists corporate-action announcements.
get_stock_barsReturns historical OHLCV bars for a stock.
get_stock_quotesReturns historical quotes for a stock.
get_stock_tradesReturns historical trades for a stock.
get_stock_latest_quoteReturns the latest quote for a stock.
get_stock_latest_tradeReturns the latest trade for a stock.
get_stock_snapshotReturns a full snapshot for a stock.
get_most_active_stocksReturns the day's most-active stocks.
get_market_moversReturns the day's top gainers and losers.
get_crypto_barsReturns historical OHLCV bars for a crypto pair.
get_crypto_latest_quoteReturns the latest quote for a crypto pair.
get_crypto_latest_orderbookReturns the latest order book for a crypto pair.
get_crypto_snapshotReturns a full snapshot for a crypto pair.
get_option_barsReturns historical OHLCV bars for an option contract.
get_option_latest_quoteReturns the latest quote for an option contract.
get_option_snapshotReturns a full snapshot for an option contract.
get_option_chainReturns the option chain for an underlying.
get_newsReturns 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.
← Browse all finance servers