Alpaca MCP Server
Published · Updated
At a glance
- Category
- Business & payments
- GitHub repository
- alpacahq/alpaca-mcp-server
- Watch out for
- The server can place real trades and liquidate positions when ALPACA_PAPER_TRADE is false, so the README tells you to review every action the model proposes.
Alpaca publishes this server for its Trading API. It lets an agent read account and portfolio data, pull stock, crypto and options market data, and place, replace or cancel orders. It is listed in the official MCP registry as io.github.alpacahq/alpaca-mcp-server and ships on PyPI as alpaca-mcp-server.
Version 2 was a full rewrite on FastMCP and Alpaca's OpenAPI specs, and tool names, parameters and configuration all changed from v1. If you had a v1 setup, read the upgrade section first or pin the last 1.x release. The current release at the time of writing is v2.4.1.
It runs locally over stdio, launched with uvx, and reads your API key and secret from the client's env block. Paper trading is the default. A Docker image and a streamable HTTP mode exist too, but the package does not set up MCP authentication for remote use.
How it connects
Your AI app
An assistant or agent that supports MCP
Alpaca MCP Server
Runs as
- Python (uv / pip)
Gives the agent
- Account and portfolio
- Order management
- Positions
- Market data
- Assets, calendar and watchlists
- Toolset filtering
Alpaca
Signs in with
- API key
What it can do
- Account and portfolio
- get_account_info, get_account_config, get_portfolio_history and get_account_activities report balances, margin, restrictions, equity over time, fills and dividends.
- Order management
- place_stock_order, place_crypto_order and place_option_order submit orders, while get_orders, replace_order_by_id, cancel_order_by_id and cancel_all_orders manage them.
- Positions
- get_all_positions, get_open_position, close_position and close_all_positions handle holdings, and exercise_options_position exercises a held option.
- Market data
- Tools such as get_stock_bars, get_stock_latest_quote, get_stock_snapshot, get_market_movers, get_most_active_stocks and get_crypto_bars return historical and latest data.
- Assets, calendar and watchlists
- get_asset, get_option_contracts, get_calendar and get_clock cover reference data and market hours, and create_watchlist and related tools manage watchlists.
- Toolset filtering
- ALPACA_TOOLSETS limits the server to named groups such as account, trading, stock-data, crypto-data, options-data, news or locates.
Setting it up
Get API keys from your Alpaca account, install uv, and add the server to your client config, then restart the client. For Claude Code the README gives claude mcp add alpaca --scope user --transport stdio uvx alpaca-mcp-server --env ALPACA_API_KEY=your_alpaca_api_key --env ALPACA_SECRET_KEY=your_alpaca_secret_key. Claude Desktop, Cursor (~/.cursor/mcp.json) and VS Code with Copilot (the workspace-root .mcp.json, under mcpServers) all take the same shape: command uvx, args ["alpaca-mcp-server"], and the two keys in env. ALPACA_PAPER_TRADE defaults to true; set it to false with live keys only when you want real orders. To keep an agent read-only, set ALPACA_TOOLSETS to something like stock-data,crypto-data.
claude mcp add alpaca -- uvx alpaca-mcp-serverRuns the alpaca-mcp-server package from PyPI. Add any API keys, environment variables or extra arguments the setup notes above list. Combine several servers in the MCP config generator
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Check buying power, account status and portfolio history before planning a trade
- Place a limit or bracket order for a stock in a paper account and track its status
- Search option contracts by expiration and strike, then submit a multi-leg strategy
- Pull the top market movers and most active stocks for a morning scan
- Maintain watchlists and look up market hours with get_clock and get_calendar
Limitations and things to watch
- The server can place real trades and liquidate positions when ALPACA_PAPER_TRADE is false, so the README tells you to review every action the model proposes.
- It does not configure MCP OAuth, so Alpaca says not to expose the HTTP mode on the public internet, and Claude Mobile and ChatGPT, which need a remote server, are not supported setups.
- Version 2 changed tool names, parameters and configuration, so v1 prompts and configs need updating or a pinned 1.x install.
- Docs lookups are scoped to the Trading, Market Data and Authentication APIs; Broker API docs are excluded.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /alpacahq/alpaca-mcp-server
- github.com /alpacahq/alpaca-mcp-server/releases
- pypi.org /project/alpaca-mcp-server
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.