@alpaca-open-api/mcp
v1.0.2
Published
Model Context Protocol (MCP) server for the Alpaca Markets API — exposes all Trading, Market Data, Broker, and AuthX endpoints to AI agents
Maintainers
Readme
- 🤖 Every Alpaca endpoint as an
alpaca_<operationId>MCP tool, via onenpx. - 🛰️ Trading, Market Data, Broker, AuthX — up to 273 tools.
- 🔒 Host + auth resolved per API; inputs validated by Zod schemas generated from the OpenAPI specs.
Install
Run with no install, straight over stdio:
npx -y @alpaca-open-api/mcpAdd it to your AI agent
Claude Code
claude mcp add alpaca \
--env ALPACA_API_KEY=your_paper_key \
--env ALPACA_API_SECRET=your_paper_secret \
--env ALPACA_ENV=paper \
-- npx -y @alpaca-open-api/mcpClaude Desktop / Cursor / any MCP client — add to your MCP config:
{
"mcpServers": {
"alpaca": {
"command": "npx",
"args": ["-y", "@alpaca-open-api/mcp"],
"env": {
"ALPACA_API_KEY": "your_paper_key",
"ALPACA_API_SECRET": "your_paper_secret",
"ALPACA_ENV": "paper"
}
}
}
}Configuration
| Variable | Required | Default | Purpose |
| --- | :---: | --- | --- |
| ALPACA_API_KEY | ✅ | — | API key (live and paper keys are different) |
| ALPACA_API_SECRET | ✅ | — | API secret |
| ALPACA_ENV | | live | paper or live |
| ALPACA_TOOLSETS | | trading,data | Comma-separated subset to expose: trading,data,broker,authx (all four = ~273 tools) |
⚠️ The server defaults to
liveand allows order placement in the defaulttradingtoolset. UseALPACA_ENV=paperwith your paper keys while you experiment. Live and paper API keys differ.
Documentation
Full docs, the typed library client (@alpaca-open-api/core), and source:
https://github.com/yagop/alpaca-open-api
Disclaimer
Unofficial and not affiliated with, endorsed by, or sponsored by Alpaca. Provided "as is", without warranty of any kind. Nothing here is financial, investment, or trading advice. Trading involves substantial risk of loss — always test with paper trading (ALPACA_ENV=paper) first.
