Alpaca MCP Server
Enables secure storage and loading of Alpaca API credentials through environment variables stored in a .env file.
Required for cloning the repository during the installation process.
The repository hosting the MCP server code that users need to clone for installation.
The MCP server is built using Python and requires Python 3.10+ for execution.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Alpaca MCP Serverwhat's my current account balance and buying power?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
📊 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
Related MCP server: Alpaca MCP Server
Prerequisites
Python 3.10+
Alpaca API keys
Claude for Desktop or another MCP client
Installation
Clone this repository:
git clone https://github.com/YOUR_USERNAME/alpaca-mcp.git cd alpaca-mcpInstall the required packages:
pip install mcp alpaca-py python-dotenvCreate a
.envfile with your Alpaca API credentials:API_KEY_ID=your_alpaca_api_key API_SECRET_KEY=your_alpaca_secret_key
Usage
Running the server
Start the server by running:
python alpaca_mcp_server.pyConfiguring 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:
{
"mcpServers": {
"alpaca": {
"command": "python",
"args": [
"/path/to/alpaca_mcp_server.py"
],
"env": {
"API_KEY_ID": "your_alpaca_api_key",
"API_SECRET_KEY": "your_alpaca_secret_key"
}
}
}
}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
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceA server that implements the Model Context Protocol for Schwab API, allowing access to account information, positions, stock quotes, and order/transaction history designed for integration with Large Language Models.Last updated57MIT
- Alicense-qualityDmaintenanceA 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.Last updated3MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that interfaces with Alpaca trading API, allowing users to manage portfolios, place trades, and access market data through natural language interactions.Last updated836MIT
- Flicense-qualityFmaintenanceA Model Context Protocol server that enables AI assistants like Claude to securely interact with Charles Schwab accounts and market data through the official Schwab API.Last updated68
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Alpaca MCP — real-time US stock market data via the Alpaca Market Data API
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tedlikeskix/alpaca-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server