About this project

Alpaca MCP Server is an official Model Context Protocol server for Alpaca's Trading and Market Data APIs. It allows MCP-compatible assistants and IDEs—including Claude Desktop, Claude Code, Cursor, VS Code, PyCharm, and Antigravity—to discover Alpaca tools and perform trading or research tasks through natural-language requests. Version 2 is a complete rewrite built with FastMCP and OpenAPI. It is not backward compatible with v1: tool names, parameters, schemas, and configuration changed, so upgraded installations should be reconfigured, clients restarted, and fresh sessions started. V1 can remain pinned to the last 1.x release if needed. The server runs locally over stdio using uvx, or can be built and run with Docker. Configuration is supplied through environment variables in the MCP client configuration: ALPACA_API_KEY and ALPACA_SECRET_KEY are required, ALPACA_PAPER_TRADE defaults to true, and ALPACA_TOOLSETS can restrict exposed capabilities. The README warns against exposing the server directly to the public internet because it does not itself provide remote MCP authentication. Exposed capabilities are organized into toolsets for account and portfolio information, trading, positions, watchlists, assets and market status, stock data, crypto data, options data, corporate actions, news, fixed-income data, and short-sale locates. Specific operations include viewing balances and buying power, retrieving portfolio history and account activities, placing stock/ETF, crypto, and option orders, replacing or canceling orders, viewing or closing positions, exercising options, and managing watchlists. Market-data tools cover historical and latest bars, quotes, trades, snapshots, order books, option chains, Greeks, implied volatility, calendars, clocks, corporate-action announcements, news, and fixed-income quotes. The server also includes documentation lookup tools for Alpaca guides and OpenAPI endpoint references. Some data and locate capabilities depend on Alpaca subscription or live-account eligibility. The project documents setup for multiple MCP clients, live-trading configuration, toolset filtering, example prompts, and a test suite containing integrity checks, server-construction tests, paper-API integration tests, and documentation integration tests.