# Alpaca MCP Server (MCP server)

> Alpaca MCP Server is an MCP server that adds finance tools to AI assistants such as Claude Desktop, Claude Code and Cursor. Alpaca’s official MCP Server lets you trade stocks, ETFs, crypto, and options, run data analysis, and build strategies in… It has 1,008 GitHub stars, is released under the MIT license and runs locally with uvx alpaca-mcp-server.

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.

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/alpacahq/alpaca-mcp-server |
| GitHub stars | 1,008 |
| License | MIT |
| Language | Python |
| Transport | stdio |
| Packages | pypi: alpaca-mcp-server |
| Remote URL | none |
| Needs API key | yes |
| Official | yes |
| Works with | Claude Desktop, Claude Code, Cursor, VS Code |
| Category | Finance |
| Latest release | v2.3.2 (Sep 15, 2026) |
| Last commit | Sep 25, 2026 |

## Install

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "alpaca-mcp-server": {
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "your-value",
        "ALPACA_SECRET_KEY": "your-value"
      }
    }
  }
}
```

Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.

### Claude Code

```sh
claude mcp add --env ALPACA_API_KEY=your-value --env ALPACA_SECRET_KEY=your-value --transport stdio alpaca-mcp-server -- uvx alpaca-mcp-server
```

### Cursor (.cursor/mcp.json)

```json
{
  "mcpServers": {
    "alpaca-mcp-server": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "your-value",
        "ALPACA_SECRET_KEY": "your-value"
      }
    }
  }
}
```

Project file; use ~/.cursor/mcp.json to enable it in every project.

### VS Code (.vscode/mcp.json)

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "alpaca_api_key",
      "description": "ALPACA_API_KEY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "alpaca_secret_key",
      "description": "ALPACA_SECRET_KEY",
      "password": true
    }
  ],
  "servers": {
    "alpaca-mcp-server": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "${input:alpaca_api_key}",
        "ALPACA_SECRET_KEY": "${input:alpaca_secret_key}"
      }
    }
  }
}
```

Config formats checked against the official docs on 2026-10-07.

## Environment variables

- `ALPACA_API_KEY` (secret): Shown in the README's example configuration.
- `ALPACA_SECRET_KEY` (secret): Shown in the README's example configuration.
- `ALPACA_PAPER_TRADE`: Shown in the README's example configuration.
- `ALPACA_TOOLSETS`: Shown in the README's example configuration.

## Tools

- `get_account_info`: Balance, margin, and account status
- `get_account_config`: Trading restrictions, margin settings, PDT checks
- `update_account_config`: Update account configuration settings
- `get_portfolio_history`: Equity and P/L over time
- `get_account_activities`: Fills, dividends, transfers
- `get_account_activities_by_type`: Activities filtered by type
- `get_orders`: Retrieve orders with filters
- `get_order_by_id`: Single order by ID
- `get_order_by_client_id`: Single order by client order ID
- `replace_order_by_id`: Replace an existing open order
- `cancel_order_by_id`: Cancel a specific order
- `cancel_all_orders`: Cancel all open orders
- `place_stock_order`: Stocks/ETFs (market, limit, stop, stop-limit, trailing-stop, brackets)
- `place_crypto_order`: Crypto (market, limit, stop-limit)
- `place_option_order`: Options (single-leg or multi-leg)
- `get_all_positions`: All current positions
- `get_open_position`: Details for a specific position
- `close_position`: Close a specific position
- `close_all_positions`: Liquidate entire portfolio
- `exercise_options_position`: Exercise a held option contract
- `do_not_exercise_options_position`: Do-not-exercise instruction
- `create_watchlist`: Create a new watchlist
- `get_watchlists`: List all watchlists
- `get_watchlist_by_id`: Get a specific watchlist
- `update_watchlist_by_id`: Update a watchlist
- `delete_watchlist_by_id`: Delete a watchlist
- `add_asset_to_watchlist_by_id`: Add an asset to a watchlist
- `remove_asset_from_watchlist_by_id`: Remove an asset from a watchlist
- `get_all_assets`: List assets with optional filtering
- `get_asset`: Detailed info for a specific asset
- `get_option_contracts`: Option contracts for underlying symbol(s)
- `get_option_contract`: Single option contract by symbol or ID
- `get_calendar`: Market calendar for a date range
- `get_clock`: Current market status and next open/close
- `get_corporate_action_announcements`: Corporate action announcements
- `get_corporate_action_announcement`: Single announcement by ID
- `get_stock_bars`: Historical OHLCV bars
- `get_stock_quotes`: Historical bid/ask quotes
- `get_stock_trades`: Historical trades
- `get_stock_latest_bar`: Latest minute bar

## Similar MCP servers

- [CCXT](https://appsgit.com/mcp-servers/ccxt): Official CCXT MCP server - Market data and trading across 100+ exchanges and prediction markets. (44,271 stars, MIT, official)
- [Finance Toolkit](https://appsgit.com/mcp-servers/finance-toolkit): 200+ transparent financial metrics calculated from raw statements, not third-party endpoints. (5,402 stars, MIT, needs API key)
- [Tradingview MCP](https://appsgit.com/mcp-servers/tradingview-mcp): Real-time market data, screeners, technical analysis & backtesting for stocks, crypto and forex. (4,948 stars, MIT)
- [EdgarTools](https://appsgit.com/mcp-servers/edgartools): Open-source SEC EDGAR toolkit — 13 tools, 7 prompts, every filing type. (2,776 stars, MIT)
- [AI](https://appsgit.com/mcp-servers/ai): MCP server integrating with Stripe - tools for customers, products, payments, and more. (1,859 stars, MIT, official)
- [Tradememory Protocol](https://appsgit.com/mcp-servers/tradememory-protocol): Tamper-evident decision audit trail and outcome-weighted memory for AI trading agents. (1,425 stars, MIT)

---

Canonical page: https://appsgit.com/mcp-servers/alpaca-mcp-server
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed nightly.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
