Alpaca MCP Server
Alpaca's official MCP server: orders for stocks, ETFs, crypto and options, position management and market data in plain language
High risk
We rate an entry high when the tool writes to external systems, handles money, production databases or secrets, or runs arbitrary commands. The CLI installs it only with your consent.
Why this level
- In live mode it places real orders, with a risk of money loss
- You must check paper versus live mode before use
- It requires secret API keys and access to the portfolio
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/alpaca-mcp-serverDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
This entry is high risk, so there is no one-click install. Review the code and add the config by hand.
Run in a terminal
claude mcp add --transport stdio --env 'ALPACA_API_KEY=<your ALPACA_API_KEY>' --env 'ALPACA_SECRET_KEY=<your ALPACA_SECRET_KEY>' alpaca-mcp-server -- uvx alpaca-mcp-server==2.3.2Or add to the file .mcp.json, in the project
{
"mcpServers": {
"alpaca-mcp-server": {
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.cursor/mcp.json, for all projects
{
"mcpServers": {
"alpaca-mcp-server": {
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. For a single project, put the same block into .cursor/mcp.json.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Run in a terminal
code --add-mcp '{"name":"alpaca-mcp-server","type":"stdio","command":"uvx","args":["alpaca-mcp-server==2.3.2"],"env":{"ALPACA_API_KEY":"<your ALPACA_API_KEY>","ALPACA_SECRET_KEY":"<your ALPACA_SECRET_KEY>"}}'Or add to the file .vscode/mcp.json, in the project
{
"servers": {
"alpaca-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the servers key.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Run in a terminal
codex mcp add alpaca-mcp-server --env 'ALPACA_API_KEY=<your ALPACA_API_KEY>' --env 'ALPACA_SECRET_KEY=<your ALPACA_SECRET_KEY>' -- uvx alpaca-mcp-server==2.3.2Or add to the file ~/.codex/config.toml, for all projects
[mcp_servers.alpaca-mcp-server]
command = "uvx"
args = ["alpaca-mcp-server==2.3.2"]
env = { ALPACA_API_KEY = "<your ALPACA_API_KEY>", ALPACA_SECRET_KEY = "<your ALPACA_SECRET_KEY>" }If the file already exists, append the block to the end.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Run in a terminal
gemini mcp add -s user -e 'ALPACA_API_KEY=<your ALPACA_API_KEY>' -e 'ALPACA_SECRET_KEY=<your ALPACA_SECRET_KEY>' alpaca-mcp-server uvx alpaca-mcp-server==2.3.2Or add to the file ~/.gemini/settings.json, for all projects
{
"mcpServers": {
"alpaca-mcp-server": {
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.config/devin/mcp_config.json, for all projects
{
"mcpServers": {
"alpaca-mcp-server": {
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. Legacy Cascade keeps the MCP config in ~/.codeium/windsurf/mcp_config.json.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Formerly Windsurf.
Add to the file cline_mcp_settings.json, for all projects
{
"mcpServers": {
"alpaca-mcp-server": {
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. Open the settings file in Cline: MCP Servers tab, Configure MCP Servers.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file .roo/mcp.json, in the project
{
"mcpServers": {
"alpaca-mcp-server": {
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
A fork of Roo Code, same .roo folders.
Add to the file opencode.json, in the project
{
"mcp": {
"alpaca-mcp-server": {
"type": "local",
"command": [
"uvx",
"alpaca-mcp-server==2.3.2"
],
"environment": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the mcp key.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.config/zed/settings.json, for all projects
{
"context_servers": {
"alpaca-mcp-server": {
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the context_servers key.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file .codeassistant/mcp.json, in the project
{
"mcpServers": {
"alpaca-mcp-server": {
"command": "uvx",
"args": [
"alpaca-mcp-server==2.3.2"
],
"env": {
"ALPACA_API_KEY": "<your ALPACA_API_KEY>",
"ALPACA_SECRET_KEY": "<your ALPACA_SECRET_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
ALPACA_API_KEYsecret, required- Alpaca Trading API key
ALPACA_SECRET_KEYsecret, required- Alpaca Trading API secret key
ALPACA_TOOLSETSoptional- Comma-separated list of toolsets to enable (e.g. account,trading,stock-data). All enabled by default.
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Open a free Alpaca paper account and get keys. Add the server to Claude Code: claude mcp add alpaca --scope user --transport stdio uvx alpaca-mcp-server --env ALPACA_API_KEY=key --env ALPACA_SECRET_KEY=secret. Paper mode is on by default; check it before any live trading.
Other ways from the author
{
"mcpServers": {
"alpaca": {
"command": "uvx",
"args": ["alpaca-mcp-server"],
"env": {
"ALPACA_API_KEY": "your_alpaca_api_key",
"ALPACA_SECRET_KEY": "your_alpaca_secret_key"
}
}
}
}Paper mode is on by default.
Security check
How we reviewHigh riskWe rate an entry high when the tool writes to external systems, handles money, production databases or secrets, or runs arbitrary commands. The CLI installs it only with your consent.
- In live mode it places real orders, with a risk of money loss
- You must check paper versus live mode before use
- It requires secret API keys and access to the portfolio
This is third-party code. Review the repository files before installing.
What it does
The server connects an AI client to Alpaca's trading API and lets you manage an account in plain language. Its tools place market, limit, stop and trailing orders for stocks, ETFs, crypto and options, cancel orders, view and close positions, read portfolio history, manage watchlists, look up assets, the market calendar, corporate actions and news. A separate block is market data: quotes, trades, bars and snapshots, including option Greeks and implied volatility. Paper mode is on by default; live trading must be enabled explicitly.
Who it is for. For traders and developers with an Alpaca account who build trading workflows and analytics through an agent.
Good fit when
- You test trading ideas on an Alpaca paper account
- You need market data and snapshots for stocks, crypto and options
- You manage orders and positions through an AI client
Not a fit when
- You are not ready for the risk of real trades and money loss in live mode
- You have not checked whether paper or live mode is on
- You plan to expose the server to the internet with keys and no protection
Example request
Show the balance and buying power on the paper account, then the latest AAPL quoteMCP
- Transport
- stdio, http
- Authentication
- API key
Environment variables
ALPACA_API_KEYrequired, secret- Alpaca account API key.
ALPACA_SECRET_KEYrequired, secret- Alpaca account secret key.
ALPACA_PAPER_TRADE- Defaults to true for paper mode. Setting false enables live trading.
ALPACA_TOOLSETS- Comma-separated list of toolsets to restrict the available operations.
Limitations
It needs Alpaca API keys, set in the MCP client config. ALPACA_PAPER_TRADE defaults to true; live trading sets it to false, so the mode must be checked before use. The server can place real orders and sees the portfolio, and keys are sensitive. The package does not configure remote MCP authentication, so it must not be exposed to the internet with keys. Alpaca account availability depends on jurisdiction.
How to disable. Remove the alpaca entry from the MCP client config and restart it. Revoke the API keys in the Alpaca dashboard.
FAQ
Can the server spend real money?
Yes, if paper mode is off. By default ALPACA_PAPER_TRADE is true; live trading sets it to false, so the mode matters.
Is this Alpaca's official server?
Yes. The repository belongs to alpacahq, the package is on PyPI and runs through uvx.
Related
MCP serversA set of investment research skills for Claude Code and Codex built on four investors' methodologies. It is a research tool, not investment advice
Stripe's official MCP server, plugins and skills: the agent searches the API and docs, reads and changes account data
inn-check-ru: counterparty risk traffic light
inn-check-ru
An open-source skill that checks a Russian company by tax ID across EGRUL, bailiffs, courts, bankruptcy and sanctions, and returns a dated risk verdict
YooKassa MCP server
MCP-сервер ЮKassa
YooKassa official MCP: an agent creates payment links and invoices, checks statuses and refunds, but cannot move money on its own
README in short
The README covers the v2 server built on FastMCP and OpenAPI, the differences from v1 and setup for Claude Desktop, Cursor, VS Code, PyCharm, Claude Code and Docker. Configuration is through environment variables only: keys, the paper flag and toolset filtering. It lists capabilities for account, orders, positions, watchlists, assets and market data, plus a large set of example prompts and tools. It has separate sections on security, a risk disclosure and the note that live mode is enabled explicitly.