get_account_info_toolLABSCO SUMMARY
This one places real orders — start on paper.
The market, limit and stop-loss order tools act on whichever Alpaca account the keys belong to, so the paper-trading setting is the first thing to get right. What makes it more than an API wrapper is the layer above: a portfolio health score with specific follow-up actions, correlation matrices that name which positions move together, and a subprocess sandbox for running your own analysis code with your real holdings as context.
What it is
A comprehensive MCP server for Alpaca trading operations, built as a reference implementation of a specific MCP architecture. Alongside the trading tools it carries an analytics layer that classifies your holdings, scores the portfolio, and can execute custom analysis code you supply.
What you get
- 31 MCP tools by the README's count — 11 of them resource mirrors that expose the same data as tools for clients that do not support resources — plus 4 context prompts
- Account and portfolio:
get_account_info_toolfor real-time status,get_positions_toolfor holdings with a suggested role attached to each,get_open_position_toolfor one symbol,get_portfolio_summary_toolfor the whole picture - Market data —
get_stock_quote_toolwith spread analysis,get_stock_trade_tool,get_stock_snapshot_toolwith volatility, andget_historical_bars_toolfor OHLCV history - Order management:
place_market_order_tool,place_limit_order_tool,place_stop_loss_order_tool,get_orders_toolfor history,cancel_order_tool - Portfolio analytics that produce a judgement rather than a table —
generate_portfolio_health_assessment_toolscores diversification, risk concentration and performance balance out of 100 with specific recommendations, andgenerate_advanced_market_correlation_analysis_toolbuilds 30-day correlation matrices to surface over-correlated positions - Custom code execution in a subprocess with a 30-second timeout —
execute_custom_trading_strategy_toolruns your algorithm with portfolio context,execute_portfolio_optimization_strategy_tooloptimises against a risk tolerance,execute_risk_analysis_strategy_toolcomputes your own risk metrics, andexecute_custom_analytics_code_toolworks on any structured dataset - Entity role classification that labels each position — growth candidate, volatile asset, income generator, hedge instrument or speculative play — with the characteristics behind the label
Requirements
An Alpaca trading account; paper trading is supported and recommended. Two required environment variables, ALPACA_API_KEY and ALPACA_SECRET_KEY, with ALPACA_PAPER_TRADE and LOG_LEVEL optional. Python 3.12 or newer and the uv package manager: clone, uv sync, copy .env.example to .env, and run uv run python main.py. A Dockerfile is included for running it as a container with an env file. Credentials are read from the environment only and never appear in error messages; custom code runs in a subprocess sandbox rather than in the server process.
Setup effort
Build from source — git clone https://github.com/JOravetz/alpaca-mcp-gold.git
USE CASES
Reviewing a portfolio properly
Score it out of 100 on diversification, concentration and balance, and read the specific recommendations rather than a list of positions.
Checking whether you are less diversified than you think
Build the 30-day correlation matrix and see which holdings actually move together.
Placing an order from the analysis you just did
Go from the quote and its spread straight to a market, limit or stop-loss order on the same account.
Running your own strategy against real holdings
Execute custom analysis code with portfolio context in an isolated subprocess with a timeout, instead of exporting to a notebook.
Using it from a client without resource support
Every resource has a mirror tool returning the same data, so tool-only clients lose nothing.
23 tools
Listed in project docs. Your client may show a different list.
get_positions_toolget_open_position_toolget_portfolio_summary_toolget_stock_quote_toolget_stock_trade_toolget_stock_snapshot_toolget_historical_bars_toolplace_market_order_toolplace_limit_order_toolplace_stop_loss_order_toolget_orders_toolcancel_order_toolexecute_custom_trading_strategy_toolexecute_portfolio_optimization_strategy_toolexecute_risk_analysis_strategy_toolgenerate_portfolio_health_assessment_toolgenerate_advanced_market_correlation_analysis_toolexecute_custom_analytics_code_toolcreate_sample_dataset_from_portfolio_toolresource_account_info_toolresource_portfolio_summary_toolclear_portfolio_state_toolBEFORE YOU INSTALL
What to know first
Tools you get
23 tools named in the project's documentation. The README counts 31 tools but writes out only 23 names; the unnamed ones are resource mirrors. Prompts such as portfolio_first_look and market_analysis_session are not tools. Three tools place orders and four run code you supply.
Requires
- Python 3.12+
- ALPACA_API_KEY in your environment
- ALPACA_SECRET_KEY in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
# Clone and setup
git clone https://github.com/JOravetz/alpaca-mcp-gold.git
cd alpaca-mcp-gold
# Install dependencies
uv sync
# Configure environment
cp .env.example .env
# Edit .env with your Alpaca API credentialsMCP Clients
Claude Desktop
{
"mcpServers": {
"alpaca-trading-gold": {
"command": "<YOUR_PATH_TO_UV>",
"args": [
"--directory",
"<YOUR_PATH_TO_ALPACA_MCP_GOLD>",
"run",
"python",
"main.py"
],
"env": {
"LOG_LEVEL": "INFO"
}
}
}
}The configuration on this page does not set ALPACA_API_KEY and ALPACA_SECRET_KEY; the project's instructions put them in a .env file. To supply them without depending on where the server looks for that file, use the block's "env" section.