Integrations
Used for loading Alpaca API credentials from environment variables to securely connect to the Alpaca trading platform.
Required for cloning the repository as part of the installation process.
Source for cloning the repository containing the MCP server code.
Alpaca MCP Server
This is a Model Context Protocol (MCP) server for Alpaca, allowing LLMs like Claude to interact with the Alpaca trading API. It enables trading stocks, checking positions, fetching market data, and managing your account - all through natural language.
Features
- 📚 Alpaca Documentation - Access Alpaca SDK documentation to build
- 📊 Market Data - Get real-time stock quotes and historical price data
- 💵 Account Information - Check your balances, buying power, and status
- 📈 Position Management - View current positions and their performance
- 🛒 Order Placement - Place market and limit orders through natural language
- 📋 Order Management - List, track, and cancel orders
Prerequisites
- Python 3.10+
- Alpaca API keys
- Claude for Desktop or another MCP client
Installation
- Clone this repository:Copy
- Install the required packages:Copy
- Create a
.env
file with your Alpaca API credentials:Copy
Usage
Running the server
Start the server by running:
Configuring Claude for Desktop
- Open Claude for Desktop
- Go to Settings
- Click on "Developer" and then "Edit Config"
- Add the server configuration to
claude_desktop_config.json
:
- Save and restart Claude for Desktop
Available Tools
The server exposes the following tools:
get_account_info()
- Get account balances and statusget_positions()
- List all current positions in the portfolioget_stock_quote(symbol)
- Get the latest quote for a stockget_stock_bars(symbol, days)
- Get historical price bars for a stockget_orders(status, limit)
- List orders with specified statusplace_market_order(symbol, side, quantity)
- Place a market orderplace_limit_order(symbol, side, quantity, limit_price)
- Place a limit ordercancel_all_orders()
- Cancel all open ordersclose_all_positions(cancel_orders)
- Close all open positions
Example Queries
Once the server is connected to Claude, you can ask questions like:
- "What's my current account balance and buying power?"
- "Show me my current positions"
- "Get the latest quote for AAPL"
- "Show me the price history for TSLA over the last 10 days"
- "Buy 5 shares of MSFT at market price"
- "Sell 10 shares of AMZN with a limit price of $130"
- "Cancel all my open orders"
Note
This server uses Alpaca's paper trading by default. To use real money trading, change paper=True
to paper=False
in the TradingClient
initialization.
Security Notice
This MCP server will have access to your Alpaca account and can place real trades. Always review what Claude is suggesting before approving any trades.
License
MIT
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that enables LLMs like Claude to interact with the Alpaca trading API, allowing for trading stocks, checking positions, fetching market data, and managing accounts through natural language.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.Last updated -313232TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables Claude and other LLMs to interact with Notion workspaces, providing capabilities like searching, retrieving, creating and updating pages, as well as managing databases.Last updated -2752TypeScript
- -securityAlicense-qualityA Model Context Protocol server enabling LLMs like Claude to interact with the Alpaca trading API through natural language for stock trading, checking positions, fetching market data, and managing your account.Last updated -PythonMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLMs like Claude to interact with the Nostr social network, allowing for fetching user profiles, text notes, and zap payment information.Last updated -525TypeScriptMIT License