logo
icon

Alpaca MCP Server

Remote Model Context Protocol server for Alpaca's Trading API — trade stocks, options, and crypto from Claude, ChatGPT, or any MCP-compatible AI client over HTTPS.

template cover
Deployed6 times
PublisherzeaburZeabur
Created2026-05-07
Tags
AIDeveloper Tool

Alpaca MCP Server on Zeabur

A remote Model Context Protocol server for Alpaca's Trading API. Once deployed, you can add this server as a custom connector in Claude (web/desktop/mobile) or ChatGPT to trade stocks, options, and crypto and run market analysis through plain-English chat.

Original project: github.com/alpacahq/alpaca-mcp-server — MIT License.

1. Get your Alpaca API keys

  1. Sign up at alpaca.markets
  2. Open the Paper Trading dashboard (recommended for testing)
  3. Generate an API key pair under API KeysGenerate New Key
  4. Copy the API Key ID into ALPACA_API_KEY and the Secret Key into ALPACA_SECRET_KEY when deploying this template

To trade with real money, switch the dashboard to Live, generate live keys, and set ALPACA_PAPER_TRADE=false after deployment.

2. Deploy and configure

Click Deploy and pick a public domain — Zeabur gives you a free .zeabur.app subdomain or you can bind your own.

After the service starts, open the service URL in your browser and log in with the launcher password from the Instructions tab. The web launcher lets you:

  • Set or update ALPACA_API_KEY and ALPACA_SECRET_KEY
  • Toggle ALPACA_PAPER_TRADE
  • Restart the internal MCP server
  • Copy the MCP endpoint or a ready-to-paste setup prompt for Claude Code / Codex

3. Connect your AI client

Your MCP endpoint is https://<your-domain>/mcp.

Claude (web, desktop, mobile):

  1. Settings → Connectors → Add custom connector
  2. Name: Alpaca, URL: https://<your-domain>/mcp
  3. Save and toggle the connector on in any chat

ChatGPT:

  1. Settings → Connectors → New connector
  2. URL: https://<your-domain>/mcp, transport: Streamable HTTP

Configuration

VariableDefaultPurpose
ALPACA_API_KEYOptional at deploy time. Alpaca API key ID, configurable in the launcher
ALPACA_SECRET_KEYOptional at deploy time. Alpaca API secret, configurable in the launcher
ALPACA_PAPER_TRADEtrueSet to false to enable live (real-money) trading
WEB_LAUNCHER_PASSWORDAutoPassword for the web launcher login

Advanced: you can also set ALPACA_TOOLSETS post-deploy under Variables — a comma-separated list (e.g. account,positions,orders) that restricts which tool families the MCP server exposes to the AI client.

Security warning

This deployment exposes your Alpaca trading credentials behind an HTTPS endpoint with no built-in auth — anyone with the URL can issue trades on your account. For production use:

  • Keep ALPACA_PAPER_TRADE=true until you've verified the setup
  • Treat the public URL as a secret; do not share it
  • Consider putting the service behind an authenticating proxy

License & attribution

The Alpaca MCP Server is licensed under the MIT License by Alpaca Securities LLC. This Zeabur template repackages the upstream Docker build and is not an official Alpaca product.