Trading Guide
Connect Claude to Alpaca: Free Paper Trading Setup
You can connect Claude directly to a free Alpaca paper trading account and have it check balances, pull live market data, and help screen premarket candidates — all in plain English, with no coding required once it's running. This guide walks a brand-new user through the entire setup, start to finish.
Time required: about 30–45 minutes the first time. Cost: free (paper trading and the connector are both free). Platform: written for Windows, with Mac notes where steps differ.
What You're Building
Alpaca is a brokerage that offers a free "paper" (simulated) trading account and a full market-data API. The connector — built on the Model Context Protocol (MCP) — lets Claude Desktop talk to that account directly. There are four stages:
- Stage 1 — Create the Alpaca account and generate API keys
- Stage 2 — Install the two prerequisites (Python and uv)
- Stage 3 — Wire the connector into Claude Desktop
- Stage 4 — Verify the connection
Stage 1 — Alpaca Account and API Keys
- Sign up at alpaca.markets. When asked, choose Trading API (for trading your own account), not Broker API (for businesses building their own brokerage).
- Stay on the Paper account. It comes funded with $100,000 in simulated money and risks nothing real.
- Turn on MFA first. Activate an authenticator app and save the recovery codes somewhere safe — losing your phone without them locks you out.
- Generate paper API keys. Click API in the sidebar and generate
keys. You'll get a Key ID (starts with
PK) and a Secret Key, which is shown only once. Copy both into a password manager immediately.
Security first: Never paste your API keys into a chat window, an email, or a screenshot. They belong in one local configuration file and nowhere else. If they're ever exposed, regenerate them — on a paper account there's no real harm, just regenerate and move on.
Stage 2 — Install the Prerequisites
Two one-time installs are needed on your machine:
- Python 3.10 or newer from python.org. During install, check the box that says "Add Python to PATH" — this is the single most common gotcha.
- uv — a fast package manager that runs the connector on demand.
Install uv from PowerShell (Windows):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
On Mac or Linux, use:
curl -LsSf https://astral.sh/uv/install.sh | sh
Close and reopen your terminal, then confirm both installed correctly:
python --version
uvx --version
Both should print a version number. If either says "not recognized," it didn't land on your PATH — fix that before continuing. There are no virtual environments, repositories, or Docker to deal with.
Stage 3 — Wire the Connector Into Claude Desktop
You'll add a small block to one configuration file. The most reliable way to open it, regardless of how Claude Desktop was installed, is through Settings → Developer → Edit Config. (Microsoft Store installs are sandboxed at a non-standard path, so always use the Edit Config button rather than hunting for the file manually.)
Paste in the Alpaca server block, filling in your two keys. Use the official server and skip third-party forks:
{
"mcpServers": {
"alpaca": {
"command": "uvx",
"args": ["alpaca-mcp-server"],
"env": {
"ALPACA_API_KEY": "PKxxxxxxxxxxxxxxx",
"ALPACA_SECRET_KEY": "your-secret-key-here",
"ALPACA_PAPER_TRADE": "true"
}
}
}
}
If the file already contains other servers, merge this alpaca entry into the existing
mcpServers object rather than overwriting it.
Windows PATH gotcha: Claude Desktop's background processes don't always inherit your
PATH, so a bare "command": "uvx" can fail to launch. If it does, use the full path with
doubled backslashes:
"command": "C:\\Users\\YOURNAME\\.local\\bin\\uvx.exe",
Save the file, then fully restart Claude Desktop. A normal close often leaves background processes running, so on Windows force-quit first:
taskkill /F /IM claude.exe /T
On Mac, quit from the menu bar or run killall Claude, then relaunch.
Stage 4 — Verify the Connection
- Open Settings → Developer → Local MCP servers. The
alpacaserver should show as running. If it shows failed, the usual culprits are a key typo, the PATH issue above, or the file not saving. - In a new chat, ask: "What's my Alpaca balance?"
- On the first tool call you'll get a permission prompt. For a read-only call like account info, "Always Allow" is fine. For anything that places orders, keep confirmations on so you approve each one.
A healthy fresh paper account reports roughly $100,000 equity, $100,000 cash, $200,000 buying power (Reg-T 2x), no open positions, and zero day trades.
Everyday Use After Setup
Once it's running you never touch the configuration again. You can simply ask things like:
- "What's my Alpaca balance and any open positions?"
- "Pull the daily bars for TSLA over the last 30 days."
- "Show me today's premarket movers." (depending on the tools the server exposes)
Data-feed tip: A free Alpaca account streams the IEX feed by default, which is thin on low-float premarket names and can show stale or missing prices on exactly the gappers you're scanning. If a price looks off, ask Claude to use the delayed SIP feed — full-market coverage, 15-minute delay, still free. Live real-time SIP requires a paid Alpaca data plan.
Finding the Names in the First Place
A data connection like this reads a stock once it's already on your radar — it won't go hunting across the market for you. That discovery step belongs to a scanner. For premarket gappers and relative-strength movers I use ZenBot Scanner to surface names, then bring the ticker here for Claude to pull data and screen against my rules.
Which Claude Plan Do You Need?
The local setup above works on any plan, including Free — but only in the Claude Desktop app, since the configuration-file method isn't available in the browser. The real constraint on the Free plan is usage limits: a data-heavy premarket workflow will hit message caps quickly, which makes a paid plan the practical floor for daily use.
Works With Other AI Tools?
This isn't Claude-only. It rides on the Model Context Protocol (MCP), an open standard now supported across major AI assistants. Any MCP-capable client can connect to the same Alpaca server; only the connection method differs:
- Local connection — the app launches the server on your own machine, exactly as in this guide. This works in desktop apps such as Claude Desktop, ChatGPT Desktop, Cursor, and VS Code.
- Remote connection — the app connects to a web-hosted server instead. Browser-based apps can't launch a local process, so they need a hosted version of the server and a URL.
Troubleshooting
- Server shows "failed" on launch: the connector can't find uvx — use the full
uvx.exepath in the command field. - "Not recognized" on python or uvx: the "Add to PATH" step was skipped — reinstall with that box checked and reopen your terminal.
- Authentication or 403 errors: the keys are wrong or were rotated — regenerate them in Alpaca, paste the new values, and restart.
- Can't find the config file: you have the Microsoft Store install — use Settings → Developer → Edit Config instead of the file path.
- Changes not taking effect: the app didn't fully restart — force-quit and relaunch.
Final Thoughts
Connecting Claude to a free Alpaca paper account turns a chat window into a hands-free way to check your account and pull market data — a low-risk way to build the workflow before any real capital is involved. Set it up once, keep it on paper, and let it do the fetching while you focus on the read.
Prefer a printable version?
Download the full step-by-step guide as a PDF, or explore the indicators that pair with it.