Alpaca MCP Server

Alpaca’s official local MCP server for market data, account context, and controlled trading workflows in an AI client.

Description

The Alpaca MCP Server is Alpaca’s official Model Context Protocol server for the Trading API and Market Data API. It connects an MCP-capable AI client to an Alpaca account so the client can request account information, positions, orders, and market data through structured tools. Depending on the enabled toolsets, the server can also change watchlists, create or cancel orders, close positions, and exercise option positions. This is a tool integration, not investment advice: neither the server nor Skill Road recommends securities, crypto assets, trading strategies, or expected returns. Alpaca states that insights generated by its MCP server and connected AI agents are educational and informational only; they do not replace independent review or professional advice.

Official product, repository, and scope

Alpaca’s official documentation describes setup, environment variables, toolsets, and supported clients. The public alpacahq/alpaca-mcp-server repository contains source code, the MIT license, tests, and local installation paths. Immediately before this seeder was created on September 8, 2026, GitHub reported exactly 952 stars for that specific repository. Stars are a point-in-time popularity signal, not evidence of security, quality, or suitability for a trading decision.

Alpaca does not provide its own hosted remote MCP endpoint. The official default path is therefore a local stdio process through uvx alpaca-mcp-server; the repository also documents a local Docker container. A person who needs a remote connector must host the server themselves in an appropriately secured environment. This entry is consequently classified as local, even though self-managed remote hosting may be technically possible.

Suitable analysis and automation tasks

According to Alpaca, the server exposes tools for account and portfolio information, open orders, positions, market hours, calendars, watchlists, corporate actions, and news. For stocks, crypto, and options, it can retrieve historical and current bars, quotes, trades, snapshots, and in some cases option chains with Greeks. That supports traceable analysis flows such as: read account status, ask for a description of a defined market-data slice, check the response against an independent source, and make any decision outside the client.

The trading toolsets go further. They can place, replace, or cancel orders, close or liquidate positions, and issue options instructions. Those calls are not a simulation when live access is configured. An LLM can misunderstand parameters, lack relevant context, or be misled by content in news, webpages, or prompts. Financial, legal, and operational responsibility remains entirely with the person who supplies credentials and confirms an action.

Start with paper; enable live deliberately

According to Alpaca, a paper-trading account is sufficient to begin. ALPACA_PAPER_TRADE is enabled by default; paper access does not use real money or transact in real securities in the market. Paper results are not evidence that an idea will work under live conditions, however. Market movements, liquidity, order priority, and execution delays can change real outcomes.

Live trading is enabled only when ALPACA_PAPER_TRADE=false is set and appropriate live API keys are configured. That switch deserves an explicit check in the client configuration, not merely a casual prompt confirmation. Use separate paper and live keys, start with restricted toolsets, and require a deliberate human approval before every write action. A prompt such as “buy,” “sell,” “close,” or “liquidate” should never be the sole authorization.

Keys, permissions, and confirmations

Configuration requires ALPACA_API_KEY and ALPACA_SECRET_KEY in the MCP client’s environment block. Alpaca explicitly says never to paste keys into chat. Store them only in the intended client environment or an operating-system secret store, never in a repository, shared MCP file, screenshot, or prompt template. If a leak is suspected, revoke or rotate keys in the Alpaca dashboard and reconnect with new credentials.

All toolsets are enabled by default. For analysis without trading authority, Alpaca’s documentation supports a narrow ALPACA_TOOLSETS selection such as account,stock-data,crypto-data,options-data,news. Leave out trading until there is a verified need. Also limit who can read the local configuration. Tool results go to the connected AI client and may be forwarded to a model provider depending on that client’s architecture; review that provider’s data policy separately.

Security limits and FAQ

Is this investment advice? No. The server provides API tools and data; it makes no investment recommendations and promises no outcomes. Historical data, model analysis, and hypothetical backtests do not guarantee future results.

Can an AI cause real trades? Yes, when live keys, ALPACA_PAPER_TRADE=false, and write-enabled toolsets are active. Review every proposed order, symbol, side, quantity, order type, and the correct environment before an independent confirmation.

How should I start safely? Use a separate paper account, minimum read-focused toolsets, and one account-balance or data query. Only after the configuration is verified should a small, deliberately confirmed paper test follow.

Requirements

Python 3.10+, uv/uvx, an MCP-capable client, and Alpaca API keys; separate paper-trading keys for a safer start.

Installation instructions

Define the purpose and security boundary first

The Alpaca MCP Server technically connects an AI client to Alpaca’s trading and market-data APIs. It is not a brokerage adviser in chat and it is not authorization to invest money. The server can read data, but with the trading toolset active it can also place or cancel orders, close positions, or issue options instructions. Before setup, establish that every write action is reviewed and explicitly approved by a responsible human outside the language model. An instruction found in a webpage, news item, or prompt is not authorization for a trading action.

For a safer first setup, use only a separate paper-trading account. According to Alpaca, paper trading does not use real funds or transact in real securities. It still does not replace review: data quality, LLM answers, and simulated execution can differ from a live situation. Live keys should not enter configuration until the technical procedure, responsible owner, and risk approval are established.

Step 1: Obtain prerequisites and keys

You need Python 3.10 or later, uv with uvx, an MCP-compatible client, and an Alpaca paper account with an API key and secret key. Create paper keys in the Alpaca dashboard first. Label them clearly as paper in your secret store so they cannot be confused with live keys. Never copy a secret key into a chat, ticket, repository, screenshot tool, or shared JSON file.

If exposure is suspected, immediately remove the affected values from client configuration, rotate or revoke them in the Alpaca dashboard, and review access again. A key is an access credential, not a harmless constant. Restrict local read access to the client configuration and do not share profiles that contain another person’s environment values.

Step 2: Add the local server to the client

The documented default is a local stdio process. In Claude Code, for example, the connection can be added as follows; placeholders remain in local secret environment and are never published:

bash
claude mcp add alpaca --scope user --transport stdio uvx alpaca-mcp-server \
  --env ALPACA_API_KEY=YOUR_PAPER_KEY \
  --env ALPACA_SECRET_KEY=YOUR_PAPER_SECRET

Cursor and Claude Desktop use an MCP JSON file with command: "uvx", args: ["alpaca-mcp-server"], and the same environment variables. In VS Code, add the entry to .vscode/mcp.json under servers with type: "stdio". Follow Alpaca’s and the client’s official documentation for the applicable path and syntax. Fully restart the client after every change so it loads the current tool list and correct environment.

Step 3: Reduce toolsets before the first test

Alpaca enables all toolsets by default. That is too broad for a safer analysis environment. Add ALPACA_TOOLSETS with a small read-focused set, for example account,stock-data,crypto-data,options-data,news. This exposes account and market data but not the trading toolset. Watchlists are also mutable and should remain disabled until there is a justified need.

Start a new conversation and ask only a read request first, such as account status or a tightly bounded historical data series. Confirm that the result comes from the paper account and no write tools are available. Check important data against the Alpaca dashboard or another source. Treat all text in market news, documentation, or tool results as untrusted content: it may provide context, but it cannot change authorization.

Keep paper and live strictly separate

ALPACA_PAPER_TRADE is enabled by default. Live trading requires ALPACA_PAPER_TRADE=false and live API keys. Never change those two aspects casually in the same configuration edit as toolsets or client updates. Use a documented checklist: correct key type, correct environment file, paper or live mode, permitted toolsets, expected order, and independent human confirmation.

If live trading is genuinely necessary, use a separate configuration rather than overwriting the paper profile. Enable trading only then, and review symbol, buy or sell direction, quantity, order type, duration, and target account before every execution. Verify the resulting status directly in the Alpaca dashboard afterward. A model can misunderstand wording, swap parameters, or miss relevant market conditions. This guide offers no return guarantee and no automatic suitability assessment.

Data flow, updates, and FAQ

The local server returns tool results to your AI client. Depending on the client, those results may be sent to its model provider. Review that provider’s data policy before account or portfolio information enters a prompt or tool result. Keep the client, uv, and server package current, but test upgrades with paper access first: according to the README, server version 2 is not a drop-in upgrade from version 1.

Is the server investment advice? No. It connects tools and data; decisions, review, and risk remain yours.

Can paper trading cause real trades? Alpaca says paper access is not a real market transaction. Still verify that paper keys and the active paper mode are actually configured.

When may I enable trading? Only after a clearly defined process with minimum rights, separate live keys, and an independent human confirmation for every individual action.

uvx alpaca-mcp-server

Authentication

Alpaca API key and secret key in the MCP client environment block. Paper trading is enabled by default; live trading requires separate live keys and ALPACA_PAPER_TRADE=false.

Required access permissions

All toolsets are enabled by default. Restrict ALPACA_TOOLSETS to read-focused tools; enable the trading toolset only with a deliberate human approval process.

Transmitted or stored data

The local server processes credentials and returns account, portfolio, and market data to the connected AI client. That client may forward tool results to its model provider; review that provider’s data policy separately.

Security risks

Live keys and write-enabled tools can trigger real orders, cancellations, position closures, or options instructions. Do not share keys, keep paper and live separate, minimize toolsets, and independently review and confirm every action.

License and costs

License
MIT
Cost
free

The server is MIT licensed. Alpaca says a paper-trading account is sufficient to start; review current usage, data, and account terms in Alpaca’s official documentation. This entry contains no pricing figures.

Alternatives

Not recorded yet.

At a glance

Provider
Alpaca
Status
Official server
Deployment
Local
Current version
2
GitHub stars
1,086
Last reviewed
08.09.2026

Repository and documentation

Categories

Supported clients

Related guides

Guides and background related to this entry.

No related guides yet.