
Alpaca's Official MCP Server
@alpacahq
About Alpaca's Official MCP Server
With Alpaca's MCP server, you can:
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"alpaca": {
"command": "uvx",
"args": [
"alpaca-mcp-server",
"serve"
],
"env": {
"ALPACA_API_KEY": "your_alpaca_api_key",
"ALPACA_SECRET_KEY": "your_alpaca_secret_key"
}
}
}
}Tools
44Retrieves and formats the current account information including balances and status. Returns: str: Account details with ID, status, buying power, cash, equity, and PDT status
Retrieves and formats all current positions in the portfolio. Returns: str: List of positions with symbol, quantity, market value, entry/current price, and P/L
Retrieves and formats details for a specific open position. Args: symbol (str): The symbol name of the asset to get position for (e.g., 'AAPL', 'MSFT') Returns: str: Formatted string containing the position details or an error message
Retrieves and formats detailed information about a specific asset. Args: symbol (str): The symbol of the asset to get information for Returns: str: Asset details with name, exchange, class, status, and trading properties
Get all available assets with optional filtering. Args: status (Optional[str]): Filter by asset status (e.g., 'active', 'inactive') asset_class (Optional[str]): Filter by asset class (e.g., 'us_equity', 'crypto') exchange (Optional[str]): Filter by exchange (e.g., 'NYSE', 'NASDAQ') attributes (Optional[str]): Comma-separated values for multiple attributes Returns: str: Formatted list of assets with symbol, name, exchange, class, and status
Retrieves and formats corporate action announcements. Args: ca_types (Optional[List[CorporateActionsType]]): List of corporate action types to filter by (default: all types) Available types from https://alpaca.markets/sdks/python/api_reference/data/enums.html#corporateactionstype: - CorporateActionsType.REVERSE_SPLIT: Reverse split - CorporateActionsType.FORWARD_SPLIT: Forward split - CorporateActionsType.UNIT_SPLIT: Unit split - CorporateActionsType.CASH_DIVIDEND: Cash dividend - CorporateActionsType.STOCK_DIVIDEND: Stock dividend - CorporateActionsType.SPIN_OFF: Spin off - CorporateActionsType.CASH_MERGER: Cash merger - CorporateActionsType.STOCK_MERGER: Stock merger - CorporateActionsType.STOCK_AND_CASH_MERGER: Stock and cash merger - CorporateActionsType.REDEMPTION: Redemption - CorporateActionsType.NAME_CHANGE: Name change - CorporateActionsType.WORTHLESS_REMOVAL: Worthless removal - CorporateActionsType.RIGHTS_DISTRIBUTION: Rights distribution start (Optional[date]): Start date for the announcements (default: current day) end (Optional[date]): End date for the announcements (default: current day) symbols (Optional[List[str]]): Optional list of stock symbols to filter by cusips (Optional[List[str]]): Optional list of CUSIPs to filter by ids (Optional[List[str]]): Optional list of corporate action IDs (mutually exclusive with other filters) limit (Optional[int]): Maximum number of results to return (default: 1000) sort (Optional[str]): Sort order (asc or desc, default: asc) Returns: str: Formatted string containing corporate announcement details References: - API Documentation: https://docs.alpaca.markets/reference/corporateactions-1 - CorporateActionsType Enum: https://alpaca.markets/sdks/python/api_reference/data/enums.html#corporateactionstype - CorporateActionsRequest: https://alpaca.markets/sdks/python/api_reference/data/corporate_actions/requests.html#corporateactionsrequest
Retrieves account portfolio history (equity and P/L) over a requested time window. Args: timeframe (Optional[str]): Resolution of each data point (e.g., "1Min", "5Min", "15Min", "1H", "1D"). period (Optional[str]): Window length (e.g., "1W", "1M", "3M", "6M", "1Y", "all"). start (Optional[str]): Start time in ISO (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS). end (Optional[str]): End time in ISO (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS). date_end (Optional[str]): End date (alternative to end) as ISO date or datetime. intraday_reporting (Optional[str]): "market_hours", "extended_hours", or "continuous". pnl_reset (Optional[str]): P/L reset behavior (e.g., "daily", "weekly", "no_reset"). extended_hours (Optional[bool]): Include extended hours where applicable. cashflow_types (Optional[List[str]]): Optional cashflow categories to include. Returns: str: JSON string with keys: timestamp, equity, profit_loss, profit_loss_pct, base_value, timeframe, and optional cashflow.
Creates a new watchlist with specified symbols. Args: name (str): Name of the watchlist symbols (List[str]): List of symbols to include in the watchlist Returns: str: Confirmation message with watchlist creation status
Get all watchlists for the account. Returns: str: List of watchlists with name, ID, and timestamps
Update an existing watchlist. Args: watchlist_id (str): The UUID of the watchlist to update name (str): New name for the watchlist symbols (List[str]): New list of symbols for the watchlist Returns: str: Confirmation message with updated watchlist name
Get a specific watchlist by its ID. Args: watchlist_id (str): The UUID of the watchlist Returns: str: Watchlist details including name, ID, timestamps, and symbols
Add an asset by symbol to a specific watchlist. Args: watchlist_id (str): The UUID of the watchlist symbol (str): The asset symbol to add (e.g., 'AAPL') Returns: str: Confirmation with updated watchlist symbols
Remove an asset by symbol from a specific watchlist. Args: watchlist_id (str): The UUID of the watchlist symbol (str): The asset symbol to remove (e.g., 'AAPL') Returns: str: Confirmation with updated watchlist symbols
Delete a specific watchlist by its ID. Args: watchlist_id (str): The UUID of the watchlist to delete Returns: str: Confirmation message on successful deletion
Retrieves and formats market calendar for specified date range. Args: start_date (str): Start date in YYYY-MM-DD format end_date (str): End date in YYYY-MM-DD format Returns: str: Formatted string containing market calendar information
Retrieves and formats current market status and next open/close times. Returns: str: Market status with current time, open/closed state, and next open/close times
Retrieves and formats historical price bars for a stock with configurable timeframe and time range. Args: symbol (Union[str, List[str]]): Stock ticker symbol(s) (e.g., 'AAPL', 'MSFT' or ['AAPL', 'MSFT']) days (int): Number of days to look back (default: 5, ignored if start is provided) hours (int): Number of hours to look back (default: 0, ignored if start is provided) minutes (int): Number of minutes to look back (default: 30, ignored if start is provided) timeframe (str): Bar timeframe - supports flexible Alpaca's formats: - Minutes: "1Min" to "59Min" (or "1T" to "59T"), e.g., "5Min", "15Min", "30Min" - Hours: "1Hour" to "23Hour" (or "1H" to "23H"), e.g., "1Hour", "4Hour", "6Hour" - Days: "1Day" (or "1D") - Weeks: "1Week" (or "1W") - Months: "1Month", "2Month", "3Month", "4Month", "6Month", or "12Month" (or use "M" suffix) (default: "1Day") limit (Optional[int]): Maximum number of bars to return (default: 1000) start (Optional[str]): Start time in ISO format (e.g., "2023-01-01T09:30:00" or "2023-01-01") end (Optional[str]): End time in ISO format (e.g., "2023-01-01T16:00:00" or "2023-01-01") sort (Optional[Sort]): Chronological order of response (ASC or DESC, default: ASC) feed (Optional[DataFeed]): The stock data feed to retrieve from (DataFeed.IEX or DataFeed.SIP, default: None) currency (Optional[SupportedCurrencies]): Currency for prices (default: USD) asof (Optional[str]): The asof date in YYYY-MM-DD format tz (str): Timezone for naive datetime strings (default: "America/New_York") Supported: "UTC", "ET", "EST", "EDT", "America/New_York" Returns: str: Formatted string containing historical price data with timestamps, OHLCV data
Retrieves and formats historical quote data (level 1 bid/ask) for a stock. Args: symbol (Union[str, List[str]]): Stock ticker symbol(s) (e.g., 'AAPL', 'MSFT' or ['AAPL', 'MSFT']) days (int): Number of days to look back (default: 0, ignored if start is provided) hours (int): Number of hours to look back (default: 0, ignored if start is provided) minutes (int): Number of minutes to look back (default: 20, ignored if start is provided) limit (Optional[int]): Upper limit of number of data points to return (default: 1000) start (Optional[str]): Start time in ISO format (e.g., "2023-01-01T09:30:00" or "2023-01-01") end (Optional[str]): End time in ISO format (e.g., "2023-01-01T16:00:00" or "2023-01-01") sort (Optional[Sort]): Chronological order of response (ASC or DESC) feed (Optional[DataFeed]): The stock data feed to retrieve from (DataFeed.IEX or DataFeed.SIP, default: None) currency (Optional[SupportedCurrencies]): Currency for prices (default: USD) asof (Optional[str]): The asof date in YYYY-MM-DD format tz (str): Timezone for naive datetime strings (default: "America/New_York") Supported: "UTC", "ET", "EST", "EDT", "America/New_York" Returns: str: Formatted string containing quote summary or an error message
Retrieves and formats historical trades for a stock. Args: symbol (Union[str, List[str]]): Stock ticker symbol(s) (e.g., 'AAPL', 'MSFT' or ['AAPL', 'MSFT']) days (int): Number of days to look back (default: 0, ignored if start is provided) hours (int): Number of hours to look back (default: 0, ignored if start is provided) minutes (int): Number of minutes to look back (default: 30, ignored if start is provided) limit (Optional[int]): Upper limit of number of data points to return start (Optional[str]): Start time in ISO format (e.g., "2023-01-01T09:30:00" or "2023-01-01") end (Optional[str]): End time in ISO format (e.g., "2023-01-01T16:00:00" or "2023-01-01") sort (Optional[Sort]): Chronological order of response (ASC or DESC) feed (Optional[DataFeed]): The stock data feed to retrieve from (DataFeed.IEX or DataFeed.SIP, default: None) currency (Optional[SupportedCurrencies]): Currency for prices (default: USD) asof (Optional[str]): The asof date in YYYY-MM-DD format tz (str): Timezone for naive datetime strings (default: "America/New_York") Supported: "UTC", "ET", "EST", "EDT", "America/New_York" Returns: str: Formatted string containing trade history or an error message
Get the latest minute bar for one or more stocks. Args: symbol_or_symbols: Stock ticker symbol(s) (e.g., 'AAPL' or ['AAPL', 'MSFT']) feed: The stock data feed to retrieve from (DataFeed.IEX or DataFeed.SIP, default: None) currency: The currency for prices (optional, defaults to USD) Returns: A formatted string containing the latest bar details or an error message
Retrieves and formats the latest quote for one or more stocks. Args: symbol_or_symbols (Union[str, List[str]]): Stock ticker symbol(s) (e.g., 'AAPL' or ['AAPL', 'MSFT']) feed (Optional[DataFeed]): Data feed source (IEX or SIP) currency (Optional[SupportedCurrencies]): Currency for prices (default: USD) Returns: str: Latest bid/ask prices, sizes, and timestamp for each symbol
Get the latest trade for one or more stocks. Args: symbol_or_symbols: Stock ticker symbol(s) (e.g., 'AAPL' or ['AAPL', 'MSFT']) feed: The stock data feed to retrieve from (DataFeed.IEX or DataFeed.SIP, default: None) currency: The currency for prices (optional, defaults to USD) Returns: A formatted string containing the latest trade details or an error message
Retrieves comprehensive snapshots of stock symbols including latest trade, quote, minute bar, daily bar, and previous daily bar. Args: symbol_or_symbols: Single stock symbol or list of stock symbols (e.g., 'AAPL' or ['AAPL', 'MSFT']) feed: The stock data feed to retrieve from (DataFeed.IEX or DataFeed.SIP, default: None) currency: The currency the data should be returned in (default: USD) Returns: Formatted string with comprehensive snapshots including: - latest_quote: Current bid/ask prices and sizes - latest_trade: Most recent trade price, size, and exchange - minute_bar: Latest minute OHLCV bar - daily_bar: Current day's OHLCV bar - previous_daily_bar: Previous trading day's OHLCV bar
Retrieves and formats historical price bars for a cryptocurrency with configurable timeframe and time range. Args: symbol (Union[str, List[str]]): Crypto symbol(s) (e.g., 'BTC/USD', 'ETH/USD' or ['BTC/USD', 'ETH/USD']) days (int): Number of days to look back (default: 1, ignored if start is provided) hours (int): Number of hours to look back (default: 0, ignored if start is provided) minutes (int): Number of minutes to look back (default: 30, ignored if start is provided) timeframe (str): Bar timeframe - supports flexible Alpaca's formats: - Minutes: "1Min", "2Min", "3Min", "4Min", "5Min", "15Min", "30Min", etc. - Hours: "1Hour", "2Hour", "3Hour", "4Hour", "6Hour", etc. - Days: "1Day", "2Day", "3Day", etc. - Weeks: "1Week", "2Week", etc. - Months: "1Month", "2Month", etc. (default: "1Hour") limit (Optional[int]): Maximum number of bars to return (optional) start (Optional[str]): Start time in ISO format (e.g., "2023-01-01T09:30:00" or "2023-01-01") end (Optional[str]): End time in ISO format (e.g., "2023-01-01T16:00:00" or "2023-01-01") feed (CryptoFeed): The crypto data feed to retrieve from (default: US) tz (str): Timezone for naive datetime strings (default: "America/New_York") Supported: "UTC", "ET", "EST", "EDT", "America/New_York" Returns: str: Formatted string containing historical crypto price data with timestamps, OHLCV data
Retrieves and formats historical quote data for a cryptocurrency. Args: symbol (Union[str, List[str]]): Crypto symbol(s) (e.g., 'BTC/USD', 'ETH/USD' or ['BTC/USD', 'ETH/USD']) days (int): Number of days to look back (default: 0, ignored if start is provided) hours (int): Number of hours to look back (default: 0, ignored if start is provided) minutes (int): Number of minutes to look back (default: 15, ignored if start is provided) limit (Optional[int]): Maximum number of quotes to return (optional) start (Optional[str]): Start time in ISO format (e.g., "2023-01-01T09:30:00" or "2023-01-01") end (Optional[str]): End time in ISO format (e.g., "2023-01-01T16:00:00" or "2023-01-01") feed (CryptoFeed): The crypto data feed to retrieve from (default: US) tz (str): Timezone for naive datetime strings (default: "America/New_York") Supported: "UTC", "ET", "EST", "EDT", "America/New_York" Returns: str: Formatted string containing historical crypto quote data with timestamps, bid/ask prices and sizes
Retrieves and formats historical trade prints for a cryptocurrency. Args: symbol (Union[str, List[str]]): Crypto symbol(s) (e.g., 'BTC/USD' or ['BTC/USD','ETH/USD']) days (int): Number of days to look back (default: 0, ignored if start is provided) hours (int): Number of hours to look back (default: 0, ignored if start is provided) minutes (int): Number of minutes to look back (default: 15, ignored if start is provided) limit (Optional[int]): Maximum number of trades to return start (Optional[str]): ISO start time (e.g., "2023-01-01T09:30:00") end (Optional[str]): ISO end time (e.g., "2023-01-01T16:00:00") sort (Optional[str]): 'asc' or 'desc' chronological order feed (CryptoFeed): Crypto data feed (default: US) tz (str): Timezone for naive datetime strings (default: "America/New_York") Supported: "UTC", "ET", "EST", "EDT", "America/New_York" Returns: str: Formatted trade history
Returns the latest minute bar for one or more crypto symbols.
Returns the latest quote for one or more crypto symbols. Args: symbol (Union[str, List[str]]): Crypto symbol(s) (e.g., 'BTC/USD' or ['BTC/USD','ETH/USD']) feed (CryptoFeed): The crypto data feed (default: US) Returns: str: Formatted latest quote(s)
Returns the latest trade for one or more crypto symbols.
Returns a snapshot for one or more crypto symbols including latest trade, quote, minute bar, daily bar, and previous daily bar. Args: symbol (Union[str, List[str]]): Crypto symbol(s) (e.g., 'BTC/USD' or ['BTC/USD', 'ETH/USD']) feed (CryptoFeed): Data feed source (default: US) Returns: str: Snapshot with latest quote, trade, and OHLCV bars for each symbol
Returns the latest orderbook for one or more crypto symbols.
Retrieves option contracts for underlying symbol(s). Args: underlying_symbols (Union[str, List[str]]): Underlying asset symbol(s) (e.g., 'SPY', 'AAPL') expiration_date (Optional[date]): Specific expiration date expiration_date_gte (Optional[date]): Minimum expiration date expiration_date_lte (Optional[date]): Maximum expiration date expiration_expression (Optional[str]): Natural language (e.g., "week of September 2, 2025") strike_price_gte (Optional[str]): Minimum strike price strike_price_lte (Optional[str]): Maximum strike price contract_type (Optional[str]): Filter by 'call' or 'put' status (Optional[AssetStatus]): Filter by status (default: 'active') root_symbol (Optional[str]): Filter by root symbol limit (Optional[int]): Maximum number of contracts to return Returns: str: List of option contracts with symbol, strike, expiration, type, and status Examples: get_option_contracts("NVDA", expiration_expression="week of September 2, 2025") get_option_contracts(["SPY", "AAPL"], expiration_date_gte=date(2025,9,1), expiration_date_lte=date(2025,9,5))
Retrieves and formats the latest quote for one or more option contracts. This endpoint returns real-time pricing and market data, including bid/ask prices, sizes, and exchange information. Args: symbol_or_symbols (Union[str, List[str]]): Option contract symbol(s) (e.g., 'AAPL230616C00150000' or ['AAPL230616C00150000', 'MSFT230616P00300000']) feed (Optional[OptionsFeed]): Data feed source (OptionsFeed.OPRA or OptionsFeed.INDICATIVE) Default: OptionsFeed.OPRA if the user has the options subscription, OptionsFeed.INDICATIVE otherwise Returns: str: Formatted string containing the latest quote information including: - Ask Price and Ask Size - Bid Price and Bid Size - Ask Exchange and Bid Exchange - Trade Conditions - Tape Information - Timestamp (in UTC) Note: This endpoint returns real-time market data. For contract specifications and static data, use get_option_contracts instead.
Retrieves comprehensive snapshots of option contracts including latest trade, quote, implied volatility, and Greeks. Args: symbol_or_symbols (Union[str, List[str]]): Option symbol(s) (e.g., 'AAPL250613P00205000') feed (Optional[OptionsFeed]): Data feed source (OPRA or INDICATIVE) Returns: str: Snapshot with quote, trade, implied volatility, and Greeks for each contract
Retrieves option chain data for an underlying symbol, including latest trade, quote, implied volatility, and greeks for each contract. Args: underlying_symbol (str): The underlying symbol (e.g., 'AAPL', 'SPY') feed (Optional[OptionsFeed]): Data feed source (OPRA or INDICATIVE) (default: OPRA if the user has the options subscription, INDICATIVE otherwise) contract_type (Optional[str]): Filter by contract type ('call', 'put', or None for both) strike_price_gte (Optional[float]): Minimum strike price filter strike_price_lte (Optional[float]): Maximum strike price filter expiration_date (Optional[Union[date, str]]): Exact expiration date (YYYY-MM-DD) expiration_date_gte (Optional[Union[date, str]]): Minimum expiration date expiration_date_lte (Optional[Union[date, str]]): Maximum expiration date root_symbol (Optional[str]): Filter by root symbol limit (Optional[int]): Max snapshots to return (1-1000, default 100) Returns: str: Formatted option chain with quote, trade, IV, and greeks for each contract
Retrieves and formats orders with the specified filters. Args: status (str): Order status filter (open, closed, all) limit (int): Max orders to return (default: 10, max: 500) after (Optional[str]): Orders after this timestamp (ISO format) until (Optional[str]): Orders until this timestamp (ISO format) direction (Optional[str]): Sort order (asc or desc) nested (Optional[bool]): Roll up multi-leg orders under legs field side (Optional[str]): Filter by side (buy or sell) symbols (Optional[List[str]]): Filter by symbols Returns: str: Order details with symbol, type, side, quantity, status, and fill info
Places a stock order using the specified order type and parameters. Args: symbol (str): Stock ticker symbol (e.g., 'AAPL', 'MSFT') side (str): Order side ('buy' or 'sell') quantity (float): Number of shares to trade type (str): Order type ('market', 'limit', 'stop', 'stop_limit', 'trailing_stop') time_in_force (Union[str, TimeInForce]): Time in force ('day', 'gtc', 'opg', 'cls', 'ioc', 'fok' or TimeInForce enum) order_class (Union[str, OrderClass]): Order class ('simple', 'bracket', 'oco', 'oto' or OrderClass enum) limit_price (Optional[float]): Limit price (required for LIMIT, STOP_LIMIT) stop_price (Optional[float]): Stop price (required for STOP, STOP_LIMIT) trail_price (Optional[float]): Trail price (for TRAILING_STOP) trail_percent (Optional[float]): Trail percent (for TRAILING_STOP) extended_hours (bool): Allow extended hours execution client_order_id (Optional[str]): Custom order identifier Returns: str: Order confirmation with details or error message
Place a crypto order (market, limit, stop_limit) with GTC/IOC time in force. Rules: - Market: require exactly one of qty or notional - Limit: require qty and limit_price (notional not supported) - Stop Limit: require qty, stop_price and limit_price (notional not supported) - time_in_force: only GTC or IOC are supported for crypto orders Args: symbol (str): Crypto symbol (e.g., 'BTC/USD', 'ETH/USD') side (str): Order side ('buy' or 'sell') order_type (str): Order type ('market', 'limit', 'stop_limit') time_in_force (Union[str, TimeInForce]): Time in force ('GTC' or 'IOC') qty (Optional[float]): Quantity to trade notional (Optional[float]): Notional value (market orders only) limit_price (Optional[float]): Limit price (required for limit/stop_limit) stop_price (Optional[float]): Stop price (required for stop_limit) client_order_id (Optional[str]): Custom order identifier Returns: str: Order confirmation with order ID, status, and execution details
Places a market order for options (single or multi-leg) and returns the order details. Supports up to 4 legs for multi-leg orders. Single vs Multi-Leg Orders: - Single-leg: One option contract (buy/sell call or put). Uses "simple" order class. - Multi-leg: Multiple option contracts executed together as one strategy (spreads, straddles, etc.). Uses "mleg" order class. API Processing: - Single-leg orders: Sent as standard MarketOrderRequest with symbol and side - Multi-leg orders: Sent as MarketOrderRequest with legs array for atomic execution Args: legs (List[Dict[str, Any]]): List of option legs, where each leg is a dictionary containing: - symbol (str): Option contract symbol (e.g., 'AAPL230616C00150000') - side (str): 'buy' or 'sell' - ratio_qty (int): Quantity ratio for the leg (1-4) order_class (Optional[Union[str, OrderClass]]): Order class ('simple', 'bracket', 'oco', 'oto', 'mleg' or OrderClass enum) Defaults to 'simple' for single leg, 'mleg' for multi-leg quantity (int): Base quantity for the order (default: 1) time_in_force (Union[str, TimeInForce]): Time in force ('day' or TimeInForce.DAY - only DAY is supported for options) extended_hours (bool): Whether to allow execution during extended hours (default: False) Returns: str: Formatted string containing order details or error message Examples: # Single-leg: Buy 1 call option legs = [{"symbol": "AAPL230616C00150000", "side": "buy", "ratio_qty": 1}] # Multi-leg: Bull call spread (executed atomically) legs = [ {"symbol": "AAPL230616C00150000", "side": "buy", "ratio_qty": 1}, {"symbol": "AAPL230616C00160000", "side": "sell", "ratio_qty": 1} ] Note: Some option strategies may require specific account permissions: - Level 1: Covered calls, Covered puts, Cash-Secured put, etc. - Level 2: Long calls, Long puts, cash-secured puts, etc. - Level 3: Spreads and combinations: Butterfly Spreads, Straddles, Strangles, Calendar Spreads (except for short call calendar spread, short strangles, short straddles) - Level 4: Uncovered options (naked calls/puts), Short Strangles, Short Straddles, Short Call Calendar Spread, etc. If you receive a permission error, please check your account's option trading level.
Cancel all open orders. Returns: A formatted string containing the status of each cancelled order.
Cancel a specific order by its ID. Args: order_id: The UUID of the order to cancel Returns: A formatted string containing the status of the cancelled order.
Closes a specific position for a single symbol. This method will throw an error if the position does not exist! Args: symbol (str): The symbol of the position to close qty (Optional[str]): Optional number of shares to liquidate percentage (Optional[str]): Optional percentage of shares to liquidate (must result in at least 1 share) Returns: str: Formatted string containing position closure details or error message
Closes all open positions. Args: cancel_orders (bool): If True, cancels all open orders before liquidating positions Returns: str: Formatted string containing position closure results
Exercises a held option contract, converting it into the underlying asset. Args: symbol_or_contract_id (str): Option contract symbol (e.g., 'NVDA250919C001680') or contract ID Returns: str: Success message or error details
Overview
What is Alpaca's Official MCP Server?
A Model Context Protocol (MCP) server for Alpaca's Trading API that enables natural language trading operations through AI assistants like Claude, Cursor, and VS Code. It supports stocks, options, crypto, portfolio management, and real-time market data.
How to use Alpaca's Official MCP Server?
Install prerequisites (Python 3.10+, uv, Alpaca API keys, an MCP client) and run uvx alpaca-mcp-server init or python3 install.py. Then configure your MCP client by adding the server to its JSON config file with your API keys in the env section.
Key features of Alpaca's Official MCP Server
- Real-time and historical market data for stocks, crypto, and options
- Account balance, buying power, and position inspection
- Place and cancel market, limit, stop, and trailing-stop orders
- Single-leg and multi-leg options trading (spreads, straddles)
- Crypto market, limit, and stop-limit order support
- Market status and corporate actions data
Use cases of Alpaca's Official MCP Server
- Ask an AI assistant to check your portfolio's current balance and positions
- Place a market order for stocks or crypto using natural language
- Search and trade options contracts by expiration, strike, and type
- Liquidate all or a percentage of a position through a text command
FAQ from Alpaca's Official MCP Server
What are the runtime requirements?
Python 3.10 or higher, the uv package manager, and a compatible MCP client (Claude Desktop, Cursor, VS Code, etc.).
How do I get API keys and switch between paper and live trading?
Generate free paper trading API keys from the Alpaca dashboard. To switch to live trading, update the ALPACA_API_KEY, ALPACA_SECRET_KEY, and set ALPACA_PAPER_TRADE=False in both the .env file and your MCP client config JSON.
What financial instruments are supported?
Stocks, ETFs, crypto, and options (single-leg and multi-leg strategies) across US markets.
Where do my API credentials and data live?
All credentials are stored locally in your .env file and MCP client config JSON. The server can run locally or be deployed remotely (e.g., with Docker or to a cloud service for Claude Mobile/ChatGPT).
Does the server support OAuth or remote HTTP transport?
Yes, the README documents both OAuth Bearer Token Support and HTTP Transport for remote usage.
More Other MCP servers
AutoBrowser MCP
autobrowser-aiBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
Nginx UI
0xJackyYet another WebUI for Nginx
XcodeBuildMCP
cameroncookeA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Comments