Back to Home
alpacahq icon

alpaca-mcp-server

Verified Safe

by alpacahq

Overview

A comprehensive Model Context Protocol (MCP) server for Alpaca's Trading API, enabling natural language trading operations through AI assistants for stocks, options, crypto, portfolio management, and real-time market data.

Installation

Run Command
uvx alpaca-mcp-server serve

Environment Variables

  • ALPACA_API_KEY
  • ALPACA_SECRET_KEY

Security Notes

The project demonstrates strong security practices for credential handling. It actively warns against passing API keys via command-line arguments, uses `getpass` for interactive secret input, and attempts to set restrictive file permissions on the `.env` file. The `AuthHeaderMiddleware` correctly extracts and passes OAuth `Authorization` headers, prioritizing them over environment variables, which is a secure pattern for multi-tenant and remote deployments. While binding to `0.0.0.0` for HTTP transport requires external security measures, the documentation explicitly highlights this need. No `eval` or arbitrary code execution from untrusted input was found in the core server logic.

Similar Servers

Stats

Interest Score96
Security Score9
Cost ClassHigh
Avg Tokens5000
Stars366
Forks110
Last Update2025-11-26

Tags

financial tradingalpaca APIAI assistantmarket dataportfolio management