# Connect Claude to Alpaca MCP: setup, paper mode, safety

> Set up Alpaca's MCP server in Claude Desktop or Claude Code: API keys, paper vs live, how to verify, and the safety settings that limit what Claude can trade.

Canonical: https://tradingagentstack.com/guides/connect-claude-to-alpaca-mcp/

1. [Home](https://tradingagentstack.com/)

2. [Guides](https://tradingagentstack.com/guides/)

# How to connect Claude to Alpaca via MCP

By [Ahsen Rajab (@Satovinci)](https://tradingagentstack.com/about/)

✓ Written from official docs · checked 2026-11-27

Alpaca's official MCP server runs locally and exposes 65 tools across the Trading and Market Data APIs. These steps come from [Alpaca's MCP docs](https://docs.alpaca.markets/us/docs/trading-api-mcp).

## Prerequisites

- Python 3.10+

- `uv` with `uvx`

- Alpaca API keys (a free paper trading account is enough to start)

- An MCP client: Claude Desktop, Claude Code, Cursor, VS Code, Gemini CLI or PyCharm

## Claude Desktop

Add to `claude_desktop_config.json`:

```
{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": ["alpaca-mcp-server"],
      "env": {
        "ALPACA_API_KEY": "your_alpaca_api_key",
        "ALPACA_SECRET_KEY": "your_alpaca_secret_key"
      }
    }
  }
}
```

## Claude Code (CLI)

```
claude mcp add alpaca --scope user --transport stdio uvx alpaca-mcp-server \
  --env ALPACA_API_KEY=your_alpaca_api_key \
  --env ALPACA_SECRET_KEY=your_alpaca_secret_key
```

## Verify

Restart the client and ask: *"What is my Alpaca account balance and buying power?"* If account details come back, it is connected.

## Safety settings

- `ALPACA_PAPER_TRADE` defaults to `true`. Live trading only happens when you set it to `false` and use live keys.

- `ALPACA_TOOLSETS` limits the tools exposed. A read-only example from the docs: `account,stock-data,crypto-data,options-data,news` (no `trading` toolset).

- Alpaca warns: never paste API keys into chat; orders execute directly against the Trading API, so review AI-suggested orders.

- Some real-time data needs an Algo Trader Plus subscription.

Source: [https://docs.alpaca.markets/us/docs/trading-api-mcp](https://docs.alpaca.markets/us/docs/trading-api-mcp). Not financial advice.

## Related

- [Best broker for AI agents (2026)](https://tradingagentstack.com/best-broker-for-ai-agents/)

- [Alpaca MCP vs IBKR MCP](https://tradingagentstack.com/compare/alpaca-mcp-vs-ibkr-mcp/)

- [Safety controls of broker MCPs](https://tradingagentstack.com/broker-mcp-safety-controls/)

- [All broker MCP servers](https://tradingagentstack.com/category/broker-mcp/)

- [How to connect Claude (or any MCP client) to Interactive Brokers](https://tradingagentstack.com/guides/connect-claude-to-ibkr-mcp/)

- [How to connect Claude to the tastytrade MCP server](https://tradingagentstack.com/guides/connect-claude-to-tastytrade-mcp/)

- [How to connect Claude (and other AI agents) to the Robinhood Trading MCP](https://tradingagentstack.com/guides/connect-claude-to-robinhood-mcp/)

- [How to connect Claude to TradeStation MCP](https://tradingagentstack.com/guides/connect-claude-to-tradestation-mcp/)

- [How to connect Claude (and other AI apps) to the Public hosted MCP server](https://tradingagentstack.com/guides/connect-claude-to-public-mcp/)

- [Connect ChatGPT, Cursor or Claude Code to Interactive Brokers (IBKR MCP)](https://tradingagentstack.com/guides/ibkr-mcp-chatgpt-cursor-claude-code/)

- [How to connect Claude, ChatGPT or Cursor to the Tradier MCP server (paper first)](https://tradingagentstack.com/guides/connect-claude-to-tradier-mcp/)

- [How to connect Claude or Cursor to the moomoo MCP server (OAuth scopes explained)](https://tradingagentstack.com/guides/connect-claude-to-moomoo-mcp/)

- [Set up a 3Commas or Bitsgap bot with a safe exchange API key (no withdrawals, IP whitelist)](https://tradingagentstack.com/guides/safe-exchange-api-key-3commas-bitsgap/)

- [Run Freqtrade in dry-run mode (paper trading with a simulated wallet)](https://tradingagentstack.com/guides/freqtrade-dry-run/)

- [Give an AI agent IBKR paper trading access (TWS API or Web API)](https://tradingagentstack.com/guides/ibkr-paper-trading-api-for-ai-agents/)

[Need a custom AI trading agent built? Broker or exchange integration, MCP setup, Polymarket/Kalshi bots, safety guardrails, VPS deployment. →](https://tradingagentstack.com/go/build?from=/guides/connect-claude-to-alpaca-mcp/&cta=generic-guide)

Building an agent on this? When it trades a public account on Hyperliquid or Polymarket, [get its track record verified](https://tradingagentstack.com/get-your-ai-agent-verified/): we check it from public data on the spot, then list it with a signed record. See [the AI trading bot leaderboard](https://tradingagentstack.com/ai-trading-leaderboard/), and how the agents already out there are doing in the [AI trading bot statistics](https://tradingagentstack.com/ai-trading-bot-statistics/).

## For agents

- [When to use this site, and the page index](https://tradingagentstack.com/llms.txt)
- [Sitemap](https://tradingagentstack.com/sitemap.xml)
- [Contact](https://tradingagentstack.com/contact/)
- [MCP server](https://tradingagentstack.com/mcp/)
- [MCP discovery](https://tradingagentstack.com/.well-known/mcp)
