alpaca-mcp is a Model Context Protocol (MCP) server that provides an interface to the Alpaca trading API, enabling users to manage stock and cryptocurrency portfolios, place trades, and access market data.
In terms of purpose, this server is designed to expose Alpaca's trading capabilities to compatible clients (such as Claude for Desktop) through the MCP protocol, making it convenient for users to query accounts, execute trades, and manage positions in conversations or automated workflows.
Main capabilities include:
- Account management: view account details, balances, and portfolio status.
- Trading: place market orders, limit orders, stop orders, and stop-limit orders.
- Portfolio management: view positions, calculate performance, and close positions.
- Market data: obtain real-time quotes and historical price data.
- Asset information: obtain detailed information about tradable assets.
In terms of usage, users can automatically install the Alpaca Trading MCP Server into Claude Desktop through Smithery, or install it manually: clone the repository, install dependencies, copy .env.example to .env and fill in the Alpaca Paper Trading API credentials (which need to be obtained by creating an account with Alpaca), then run the MCP server. Once the server is started, it can be connected to by MCP clients. To test with Claude for Desktop, edit its configuration file (the Windows path is %APPDATA%\Claude\claude_desktop_config.json, and the Mac path is ~/Library/Application Support/Claude/claude_desktop_config.json), and add the Alpaca MCP server configuration.
The resources provided by this server include:
- account://info: get current account information
- positions://all: get all current positions
- positions://{symbol}: get position details for a specific symbol
- orders://recent/{limit}: get the specified number of recent orders
- market://{symbol}/quote: get the current market quote for a specific symbol
- market://{symbol}/bars/{timeframe}: get historical price bars for a specific symbol and specified timeframe
- assets://list: list tradable assets on Alpaca
- assets://{symbol}: get detailed asset information by symbol
The tools provided include:
- get_account_info_tool: get current account information
- place_market_order: place a market order to buy or sell stocks
- place_limit_order: place a limit order to buy or sell stocks at a specified price
- place_stop_order: place a stop order to buy or sell when a stock reaches a specified price
- place_stop_limit_order: a stop-limit order that combines the functions of a stop order and a limit order
- cancel_order: cancel an open order by ID
- close_position: close an open position for a specific symbol
- get_portfolio_summary: get a comprehensive summary of the portfolio
Applicable scenarios include users who need to query stock and cryptocurrency portfolios, place trades, and obtain market data through an MCP client, especially scenarios using Alpaca Paper Trading for simulated trading.
In terms of limitations, this server depends on Alpaca API credentials, and manual installation requires configuring the environment yourself; the official materials do not provide detailed information about other features, fees, prices, platforms, or effects.