$git clone https://github.com/alpacahq/alpaca-mcp-server</div>
| 1 | <p align="center"> |
| 2 | <img src="https://raw.githubusercontent.com/alpacahq/alpaca-mcp-server/main/assets/01-primary-alpaca-logo.png" alt="Alpaca logo" width="220"> |
| 3 | </p> |
| 4 | |
| 5 | <div align="center"> |
| 6 | |
| 7 | <a href="https://x.com/alpacahq?lang=en" target="_blank"><img src="https://img.shields.io/badge/X-DCDCDC?logo=x&logoColor=000" alt="X"></a> |
| 8 | <a href="https://www.reddit.com/r/alpacamarkets/" target="_blank"><img src="https://img.shields.io/badge/Reddit-DCDCDC?logo=reddit&logoColor=000" alt="Reddit"></a> |
| 9 | <a href="https://alpaca.markets/slack" target="_blank"><img src="https://img.shields.io/badge/Slack-DCDCDC?logo=slack&logoColor=000" alt="Slack"></a> |
| 10 | <a href="https://www.linkedin.com/company/alpacamarkets/" target="_blank"><img src="https://img.shields.io/badge/LinkedIn-DCDCDC" alt="LinkedIn"></a> |
| 11 | <a href="https://forum.alpaca.markets/" target="_blank"><img src="https://img.shields.io/badge/Forum-DCDCDC?logo=discourse&logoColor=000" alt="Forum"></a> |
| 12 | <a href="https://docs.alpaca.markets/docs/getting-started" target="_blank"><img src="https://img.shields.io/badge/Docs-DCDCDC" alt="Docs"></a> |
| 13 | <a href="https://alpaca.markets/sdks/python/" target="_blank"><img src="https://img.shields.io/badge/Python_SDK-DCDCDC?logo=python&logoColor=000" alt="Python SDK"></a> |
| 14 | |
| 15 | </div> |
| 16 | |
| 17 | <p align="center"> |
| 18 | A comprehensive Model Context Protocol (MCP) server for Alpaca's Trading API. Enable natural language trading operations through AI assistants like Claude, Cursor, and VS Code. Supports stocks, options, crypto, portfolio management, and real-time market data. |
| 19 | </p> |
| 20 | |
| 21 | > **Alpaca MCP Server v2 is here.** This version is a complete rewrite built with FastMCP and OpenAPI. If you're upgrading from v1, please read the [Upgrade Guide](#upgrading-from-v1) — tool names, parameters, and configuration have changed. |
| 22 | |
| 23 | ## Table of Contents |
| 24 | |
| 25 | - [Upgrading from V1](#upgrading-from-v1) |
| 26 | - [Prerequisites](#prerequisites) |
| 27 | - [Getting Your API Keys](#getting-your-api-keys) |
| 28 | - [Setup](#setup) |
| 29 | - [Configuration](#configuration) |
| 30 | - [Features](#features) |
| 31 | - [Example Prompts](#example-prompts) |
| 32 | - [Available Tools](#available-tools) |
| 33 | - [Testing](#testing) |
| 34 | - [Project Structure](#project-structure) |
| 35 | - [Troubleshooting](#troubleshooting) |
| 36 | - [Disclosure](#disclosure) |
| 37 | |
| 38 | --- |
| 39 | |
| 40 | ## Upgrading from V1 |
| 41 | |
| 42 | V2 is a **complete rewrite** built with FastMCP and OpenAPI. **None of the V1 tools exist in V2** — tool names, parameters, and schemas have changed. You cannot use V2 as a drop-in replacement if your setup depends on specific V1 tool names or parameters. |
| 43 | |
| 44 | ### What changes |
| 45 | |
| 46 | |
| 47 | | Aspect | V1 | V2 | |
| 48 | | ------------------ | -------------------------------------- | -------------------------------------------------------------------------------------------- | |
| 49 | | **Tool names** | Hand-crafted (e.g. `get_account_info`) | Spec-derived with overrides (e.g. `get_account_info` — names may overlap but schemas differ) | |
| 50 | | **Parameters** | Custom schemas | Aligned with Alpaca API specs | |
| 51 | | **Configuration** | `.env` + `init` command | Env vars in MCP client config only | |
| 52 | | **Tool filtering** | Not supported | `ALPACA_TOOLSETS` env var | |
| 53 | | **Whitelisting** | Not supported | Use `ALPACA_TOOLSETS` to restrict tools | |
| 54 | |
| 55 | |
| 56 | ### How to avoid V1-style usage in V2 |
| 57 | |
| 58 | MCP clients discover tools dynamically from the server. There is no config file where you "whitelist" tool names — the client gets whatever tools the server exposes. To avoid your client or AI assistant using V2 incorrectly: |
| 59 | |
| 60 | 1. **Do not reuse V1 config** — Treat V2 as a new server. Update your MCP client confi |