get_account_info()LABSCO SUMMARY
An account you can ask, and act on.
Reading the position and placing the order stop being two different applications — both happen where you are already thinking about the trade.
What it is
A Python server over the Alpaca trading API. Account state, positions, quotes, historical bars and order placement are each their own tool, so an assistant can read the account and act on it in the same session.
What you get
- get_account_info returns balances, buying power and account status
- get_positions lists what you hold and how each position is doing
- get_stock_quote returns the latest quote; get_stock_bars returns historical price bars over a number of days
- place_market_order and place_limit_order submit orders; get_orders lists them by status
- cancel_all_orders clears the open orders; close_all_positions exits everything, cancelling orders first if you ask it to
Requirements
Python 3.10 or later with the mcp, alpaca-py and python-dotenv packages, and an Alpaca API key with its secret, in a .env file or the client config.
Setup effort
Build from source — git clone https://github.com/miguelyad26/alpaca-mcp-server
USE CASES
Checking where the account stands
Balances, buying power and every open position in two calls, without opening the dashboard.
Getting a quote before you decide
The latest quote plus the recent bars, so a decision is made against current prices rather than a remembered level.
Placing an order you just talked through
The market or limit order goes in from the same conversation that reasoned about it, with the symbol, side and size stated once.
Seeing which orders are still open
Orders filtered by status, so what is working and what has filled is answered directly.
Flattening the book at the end of the day
Positions closed and open orders cancelled in one pass, which is the sequence that is easy to half-finish by hand.
9 tools
Listed in project docs. Your client may show a different list.
get_positions()get_stock_quote(symbol)get_stock_bars(symbol, days)get_orders(status, limit)place_market_order(symbol, side, quantity)place_limit_order(symbol, side, quantity, limit_price)cancel_all_orders()close_all_positions(cancel_orders)BEFORE YOU INSTALL
What to know first
Tools you get
9 tools named in the project's documentation.
Requires
- Python 3.10+
- API_KEY_ID in your environment
- API_SECRET_KEY in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
git clone https://github.com/miguelyad26/alpaca-mcp-server
cd alpaca-mcp-server
pip install mcp alpaca-py python-dotenvMCP Clients
Claude Desktop
{
"mcpServers": {
"alpaca": {
"command": "python",
"args": [
"<YOUR_PATH_TO_ALPACA_MCP_SERVER>"
],
"env": {
"API_KEY_ID": "<YOUR_API_KEY_ID>",
"API_SECRET_KEY": "<YOUR_API_SECRET_KEY>"
}
}
}
}