# Alpaca MCP server

> Trade stocks, ETFs, options and crypto and pull market data through Alpaca's Trading API.

- Listing: https://mcp.tc/i/alpaca
- Connect: this is a local (stdio) server; install it on your machine (see Install). The listing link is a page, not an MCP endpoint.
- Type: local (stdio)
- Auth: API key
- Category: [Finance & Payments](https://mcp.tc/c/finance-payments)
- Vendor: Alpaca
- Homepage: <https://alpaca.markets/mcp-server>
- Docs: <https://github.com/alpacahq/alpaca-mcp-server>
- Repository: <https://github.com/alpacahq/alpaca-mcp-server>
- Package: pypi `alpaca-mcp-server`

## About

Connects an AI assistant to Alpaca's Trading and Market Data APIs. It covers stocks, ETFs, options and crypto, and supports account and portfolio queries, order placement and market data lookups. Version 2 generates more than 60 tools from Alpaca's OpenAPI specs using FastMCP.

Runs locally over stdio with uvx alpaca-mcp-server and needs Python 3.10+ and uv. Set ALPACA\_API\_KEY and ALPACA\_SECRET\_KEY in the MCP client config; a free paper trading account is enough to start. The optional ALPACA\_TOOLSETS variable limits which toolsets are enabled, such as account, trading or stock-data.

## What it can do

- Trade stocks, ETFs, options and crypto in plain language
- Check account details and portfolio positions
- Pull real-time and historical market data
- Restrict enabled tools with ALPACA\_TOOLSETS
- Practice with a free paper trading account

## Example prompts

- "Show my Alpaca account balance and current positions."
- "Get the latest quote and recent daily bars for AAPL."
- "Place a paper limit order to buy 10 shares of MSFT at 400."
- "What crypto assets can I trade on Alpaca?"

## Install

### Claude Code

1. Run this in a terminal, in your project folder:

```bash
claude mcp add --transport stdio alpaca --env "ALPACA_API_KEY=<YOUR_ALPACA_API_KEY>" --env "ALPACA_SECRET_KEY=<YOUR_ALPACA_SECRET_KEY>" -- uvx alpaca-mcp-server
```

2. Start Claude Code and type `/mcp`. **alpaca** should show as connected.

Add `--scope user` to make it available in every project. Replace the placeholders with your own values.

### Claude Desktop

1. Open **Settings → Developer → Edit Config**. It opens `claude_desktop_config.json`. Add:

`claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "<YOUR_ALPACA_API_KEY>",
        "ALPACA_SECRET_KEY": "<YOUR_ALPACA_SECRET_KEY>"
      }
    }
  }
}
```

2. Save the file and restart Claude Desktop. Replace the placeholders with your own values.

Needs uv (Python) on your computer. The file lives in `~/Library/Application Support/Claude/` on macOS and `%APPDATA%\Claude\` on Windows.

### Cursor

[Add to Cursor](<https://cursor.com/install-mcp?name=alpaca&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJhbHBhY2EtbWNwLXNlcnZlciJdLCJlbnYiOnsiQUxQQUNBX0FQSV9LRVkiOiI8WU9VUl9BTFBBQ0FfQVBJX0tFWT4iLCJBTFBBQ0FfU0VDUkVUX0tFWSI6IjxZT1VSX0FMUEFDQV9TRUNSRVRfS0VZPiJ9fQ%3D%3D>) (opens Cursor)

Or add it by hand to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (this project):

`mcp.json`:

```json
{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "<YOUR_ALPACA_API_KEY>",
        "ALPACA_SECRET_KEY": "<YOUR_ALPACA_SECRET_KEY>"
      }
    }
  }
}
```

Needs uv (Python) on your computer. Replace the placeholders with your own values.

### VS Code

Add it to `.vscode/mcp.json`. VS Code asks for the secret the first time and stores it securely:

`.vscode/mcp.json`:

```json
{
  "servers": {
    "alpaca": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "${input:alpaca-api-key}",
        "ALPACA_SECRET_KEY": "${input:alpaca-secret-key}"
      }
    }
  },
  "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
    }
  ]
}
```

Needs uv (Python) on your computer.

### Devin Desktop

1. Add it to `~/.config/devin/mcp_config.json` (macOS and Linux) or `%APPDATA%\devin\mcp_config.json` (Windows):

`mcp_config.json`:

```json
{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "<YOUR_ALPACA_API_KEY>",
        "ALPACA_SECRET_KEY": "<YOUR_ALPACA_SECRET_KEY>"
      }
    }
  }
}
```

2. Refresh the MCP server list in Cascade. Replace the placeholders with your own values.

Devin Desktop is the new name for Windsurf.

### Codex

```bash
codex mcp add alpaca --env "ALPACA_API_KEY=<YOUR_ALPACA_API_KEY>" --env "ALPACA_SECRET_KEY=<YOUR_ALPACA_SECRET_KEY>" -- uvx alpaca-mcp-server
```

Or edit `~/.codex/config.toml` directly:

`config.toml`:

```toml
[mcp_servers.alpaca]
command = "uvx"
args = ["alpaca-mcp-server"]
env = { ALPACA_API_KEY = "<YOUR_ALPACA_API_KEY>", ALPACA_SECRET_KEY = "<YOUR_ALPACA_SECRET_KEY>" }
```

Needs uv (Python) on your computer. Replace the placeholders with your own values.

### Gemini CLI

```bash
gemini mcp add -e "ALPACA_API_KEY=<YOUR_ALPACA_API_KEY>" -e "ALPACA_SECRET_KEY=<YOUR_ALPACA_SECRET_KEY>" alpaca uvx alpaca-mcp-server
```

This adds it to the current project. Add `-s user` to use it everywhere.

### Any client

Most clients that start local servers accept this shape:

```json
{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": [
        "alpaca-mcp-server"
      ],
      "env": {
        "ALPACA_API_KEY": "<YOUR_ALPACA_API_KEY>",
        "ALPACA_SECRET_KEY": "<YOUR_ALPACA_SECRET_KEY>"
      }
    }
  }
}
```

Zed puts servers under `context_servers` in its settings, with the same `command`, `args` and `env` fields.

Needs uv (Python) on your computer. Replace the placeholders with your own values.

## Details

- Server version: 2.3.2
- Last checked: 2026-10-03
- Listed: 2026-10-03
- Updated: 2026-10-03

---
Source: https://mcp.tc/i/alpaca (mcp.tc is an independent directory, not affiliated with this server's publisher). Corrections: https://mcp.tc/report
