by alpacahq
Alpaca’s official MCP Server lets you trade stocks, ETFs, crypto, and options, run data analysis, and build strategies in plain English directly from your favorite LLM tools and IDEs
# Add to your Claude Code skills
git clone https://github.com/alpacahq/alpaca-mcp-server
Alpaca MCP Server v2 is here. This version is a complete rewrite built with FastMCP and OpenAPI. If you're upgrading from v1, please read the Upgrade Guide — tool names, parameters, and configuration have changed.
V2 is a complete rewrite built with FastMCP and OpenAPI. None of the V1 tools exist in V2 — tool names, parameters, and schemas have changed. You cannot use V2 as a drop-in replacement if your setup depends on specific V1 tool names or parameters.
| Aspect | V1 | V2 |
| ------------------ | -------------------------------------- | -------------------------------------------------------------------------------------------- |
| Tool names | Hand-crafted (e.g. get_account_info) | Spec-derived with overrides (e.g. — names may overlap but schemas differ) |
| | Custom schemas | Aligned with Alpaca API specs |
| | + command | Env vars in MCP client config only |
| | Not supported | env var |
| | Not supported | Use to restrict tools |
No comments yet. Be the first to share your thoughts!
get_account_info.envinitALPACA_TOOLSETSALPACA_TOOLSETSMCP clients discover tools dynamically from the server. There is no config file where you "whitelist" tool names — the client gets whatever tools the server exposes. To avoid your client or AI assistant using V2 incorrectly:
.env or init-based setup.get_account_info"), update them to match V2 tool names or remove those references and let the LLM discover tools from context.ALPACA_TOOLSETS — If you previously limited which capabilities your assistant could use, V2 supports server-side filtering via the ALPACA_TOOLSETS env var. See Configuration > Toolset Filtering for the list of toolsets.Assume no backward compatibility with V1. Reconfigure your MCP client for V2, restart it, and use a fresh session. Check the Available Tools section for the current tool list.
If you documented allowed tools, wrote scripts that call tools by name, or built prompts around specific V1 tool/parameter shapes — treat them as obsolete. Recreate them using the Available Tools listed below and the current parameter schemas exposed by the server.
If you need to stay on V1, pin to the last V1 release (e.g. uvx alpaca-mcp-server==1.x.x serve) in your MCP client config. V1 remains available on PyPI for existing setups.
Add the server to your MCP client config, then restart the client. No init command, no .env files — credentials are set in one place only.
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"alpaca": {
"command": "uvx",
"args": ["alpaca-mcp-server"],
"env": {
"ALPACA_API_KEY": "your_alpaca_api_key",
"ALPACA_SECRET_KEY": "your_alpaca_secret_key"
}
}
}
}
Install from the Cursor Directory in a few clicks, or add to ~/.cursor/mcp.json:
{
"mcpServers": {
"alpaca": {
"command": "uvx",
"args": ["alpaca-mcp-server"],
"env": {
"ALPACA_API_KEY": "your_alpaca_api_key",
"ALPACA_SECRET_KEY": "your_alpaca_secret_key"
}
}
}
}
Create .vscode/mcp.json in your project root. See the official docs.
{
"mcp": {
"servers": {
"alpaca": {
"type": "stdio",
"command": "uvx",
"args": ["alpaca-mcp-server"],
"env": {
"ALPACA_API_KEY": "your_alpaca_api_key",
"ALPACA_SECRET_KEY": "your_alpaca_secret_key"
}
}
}
}
}
PyCharm
See the official guide.
ALPACA_API_KEY=your_alpaca_api_key
ALPACA_SECRET_KEY=your_alpaca_secret_key
Claude Code
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 with /mcp in the Claude Code CLI.
Gemini CLI
See the Gemini CLI MCP docs.
Add to your settings.json:
{
"mcpServers": {
"alpaca": {
"type": "stdio",
"command": "uvx",
"args": ["alpaca-mcp-server"],
"env": {
"ALPACA_API_KEY": "your_alpaca_api_key",
"ALPACA_SECRET_KEY": "your_alpaca_secret_key"
}
}
}
}
Docker
git clone https://github.com/alpacahq/alpaca-mcp-server.git
cd alpaca-mcp-server
docker build -t mcp/alpaca:latest .
Add to your MCP client config:
{
"mcpServers": {
"alpaca": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "ALPACA_API_KEY=your_key",
"-e", "ALPACA_SECRET_KEY=your_secret",
"-e", "ALPACA_PAPER_TRADE=true",
"mcp/alpaca:latest"
]
}
}
}
All configuration is through environment variables set in your MCP client config. No files are written to disk.
| Variable | Required | Default | Description |
| -------------------- | -------- | ------- | ------------------------------------------ |
| ALPACA_API_KEY | Yes | — | Your Alpaca API key |
| ALPACA_SECRET_KEY | Yes | — | Your Alpaca secret key |
| ALPACA_PAPER_TRADE | No | true | Set to false for live trading |
| ALPACA_TOOLSETS | No | all | Comma-separated list of toolsets to enable |
Update the env block in your MCP client config and restart:
{
"env": {
"ALPACA_API_KEY": "your_live_api_key",