Alpaca

Alpaca

A comprehensive MCP server for Alpaca Trading API enabling natural language trading and data access.

359
Stars
102
Forks
0
Releases

Overview

An Alpaca MCP server enabling natural language trading and data access via Alpaca's Trading API. It provides real-time market data (quotes, trades, bars) and historical data across stocks, crypto, and options, plus full account, positions, and order management. Users can search assets, manage multiple watchlists, perform option strategies (including multi-leg spreads), trade crypto, and fetch market calendars and corporate actions. The server also offers market status checks, portfolio history, and detailed snapshots. It supports OAuth 2.0 passthrough authentication, allowing multi-tenant usage where each LLM chat request can carry its own user token, and forwards Authorization headers to Alpaca calls. It is designed for integration with various MCP clients (Claude Desktop, Cursor, VS Code, Claude Code, PyCharm, Gemini CLI, etc.) and supports multiple transports (stdio for local clients, HTTP/SSE for remote usage, with an HTTP transport setup). The repository provides installation methods (uvx, install.py, Docker), configuration guides, and example prompts to demonstrate trading scenarios. The MCP server can operate in live or paper trading modes and is configurable via both environment variables and client JSON configs.

Details

Owner
alpacahq
Language
Python
License
MIT License
Updated
2025-12-07

Features

Market Data

Real-time quotes, trades, and price bars for stocks, crypto, and options; historical data with flexible timeframes; stock snapshots and trade-level history; option quotes and Greeks.

Account Management

View balances, buying power, and account status; inspect all open and closed positions.

Position Management

Get detailed info on holdings; liquidate all or partial positions by share count or percentage.

Order Management

Place stock, ETF, crypto, and options orders; support for market, limit, stop, stop-limit, and trailing-stop; cancel orders; retrieve full order history.

Options Trading

Search option contracts by expiration, strike price, and type; place single-leg or multi-leg strategies; get latest quotes, Greeks, and implied volatility.

Crypto Trading

Place market, limit, and stop-limit crypto orders; supports GTC and IOC; handle quantity or notional-based orders.

Market Status & Corporate Actions

Check if markets are open; fetch market calendar and trading sessions; view upcoming/historical corporate announcements (earnings, splits, dividends).

Watchlist Management

Create, update, and view personal watchlists; manage multiple watchlists for tracking assets.

Audience

AI developersIntegrate natural-language trading and data access into AI assistants using Alpaca's API.
TradersLeverage MCP prompts to view portfolios, place orders, and monitor real-time market data.

Tags

AlpacaMCPTrading APIStocksOptionsCryptoMarket DataPortfolio ManagementOrder ManagementOAuth 2.0WatchlistsAsset SearchAI AssistantsMulti-tenantAuthentication Passthrough