A Model Context Protocol (MCP) server that provides an interface to the Alpaca trading API, allowing you to manage your stock and crypto portfolio, place trades, and access market data. - Account Management: View account details, balances, and portfolio status - Trading: Place market, limit, stop, and stop-limit orders - Portfolio Management: View positions, calculate performance, and close positi
Add this skill
npx mdskills install laukikk/alpaca-mcpWell-documented trading API server with comprehensive tools and clear setup instructions
1# Alpaca Trading MCP Server23[](https://smithery.ai/server/@laukikk/alpaca-mcp)45A Model Context Protocol (MCP) server that provides an interface to the Alpaca trading API, allowing you to manage your stock and crypto portfolio, place trades, and access market data.67## Features89- **Account Management**: View account details, balances, and portfolio status10- **Trading**: Place market, limit, stop, and stop-limit orders11- **Portfolio Management**: View positions, calculate performance, and close positions12- **Market Data**: Access real-time quotes and historical price data13- **Asset Information**: Get details about tradable assets1415## Installation1617### Installing via Smithery1819To install Alpaca Trading MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@laukikk/alpaca-mcp):2021```bash22npx -y @smithery/cli install @laukikk/alpaca-mcp --client claude23```2425### Manual Installation261. Clone this repository272. Install dependencies:2829```bash30pip install -e .31```3233Or using uv:3435```bash36uv pip install -e .37```3839## Configuration40411. Copy the `.env.example` file to `.env`:4243```bash44cp .env.example .env45```46472. Add your Alpaca Paper Trading API credentials to the `.env` file:4849```50ALPACA_PAPER_API_KEY = "your-api-key"51ALPACA_PAPER_API_SECRET = "your-api-secret"52```5354You can obtain these credentials by creating an account at [Alpaca](https://app.alpaca.markets/signup).5556## Usage5758Run the MCP server:5960```bash61python src/server.py62```6364The server will start and be available for MCP clients to connect to.6566## Testing with Claude for Desktop6768### Configuration:6970Open your Claude for Desktop App configuration in a text editor. Create the file if it doesn't exist.7172- Windows: `%APPDATA%\Claude\claude_desktop_config.json`73- Mac: `~/Library/Application\ Support/Claude/claude_desktop_config.json`747576Add the Alpaca MCP server configuration:7778```json79{80 "mcpServers": {81 "alpaca": {82 "command": "uv",83 "args": [84 "--directory",85 "/ABSOLUTE/PATH/TO/PARENT/FOLDER/alpaca-mcp-server",86 "run",87 "src/server.py"88 ]89 }90 }91}92```93[MCP For Server Developers: Quickstart](https://modelcontextprotocol.io/quickstart/server)9495## Available Resources9697The server provides the following resources:9899- `account://info` - Get current account information100- `positions://all` - Get all current positions101- `positions://{symbol}` - Get position details for a specific symbol102- `orders://recent/{limit}` - Get most recent orders with specified limit103- `market://{symbol}/quote` - Get current market quote for a specific symbol104- `market://{symbol}/bars/{timeframe}` - Get historical price bars for a symbol with specified timeframe105- `assets://list` - List tradable assets available on Alpaca106- `assets://{symbol}` - Get detailed asset information by symbol107108## Available Tools109110The server provides the following tools:111112- `get_account_info_tool` - Get current account information113- `place_market_order` - Place a market order to buy or sell a stock114- `place_limit_order` - Place a limit order to buy or sell a stock at a specified price115- `place_stop_order` - Place a stop order to buy or sell a stock when it reaches a specified price116- `place_stop_limit_order` - Place a stop-limit order combining stop and limit order features117- `cancel_order` - Cancel an open order by its ID118- `close_position` - Close an open position for a specific symbol119- `get_portfolio_summary` - Get a comprehensive summary of the portfolio120
Full transparency — inspect the skill content before installing.