laukikk/alpaca-mcp logo

laukikk/alpaca-mcp

Free

Alpaca 交易 API 的 MCP 服务器,用于管理股票和加密货币投资组合、下单和访问市场数据。

FreeFree tier
Inputs: textOutputs: text
Type
Open Source

About laukikk/alpaca-mcp

alpaca-mcp is an open-source Model Context Protocol (MCP) server that provides a comprehensive interface to the Alpaca trading API. It enables users to manage stock and cryptocurrency portfolios, place various order types (market, limit, stop, stop-limit), access real-time market quotes and historical price data, view account information and positions, and retrieve details about tradable assets. The server exposes both resources (e.g., account://info, positions://all, market://{symbol}/quote) and tools (e.g., get_account_info_tool, place_market_order, get_portfolio_summary) for seamless integration with MCP clients like Claude Desktop. Installation is available via Smithery or manual setup with pip/uv, and it supports paper trading using Alpaca API credentials.

Key Features

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 positions
Market Data: Access real-time quotes and historical price data
Asset Information: Get details about tradable assets
Supports paper trading via Alpaca API credentials
MCP resources and tools for easy integration with clients like Claude Desktop
Installation via Smithery or manual setup with pip/uv

Pros & Cons

Pros
  • Free and open-source (MIT license)
  • Comprehensive coverage of Alpaca trading API features
  • Supports paper trading for safe strategy testing
  • Easy setup via Smithery or local installation
  • Works seamlessly with Claude Desktop and other MCP clients
  • Provides both MCP resources (data access) and tools (action execution)
  • Active community with 36 stars and 15 forks
Cons
  • Requires an Alpaca account and API credentials (paper trading only)
  • No built-in support for live trading (must use Alpaca live API separately)
  • Limited to the Alpaca brokerage platform; no multi-exchange support
  • Setup requires manual configuration of .env file for API keys

Best For

Managing stock and cryptocurrency portfolios through natural language or MCP clientsExecuting automated trading strategies with market, limit, stop, and stop-limit ordersRetrieving real-time and historical market data for analysisMonitoring account balances, positions, and portfolio performanceTesting trading strategies with Alpaca paper trading environment

FAQ

What is alpaca-mcp?
alpaca-mcp is an open-source Model Context Protocol (MCP) server that provides an interface to the Alpaca trading API, enabling users to manage stock and crypto portfolios, place trades, and access market data.
How do I install alpaca-mcp?
You can install it automatically via Smithery (npx -y @smithery/cli install @laukikk/alpaca-mcp --client claude) or manually by cloning the repository and running pip install -e . or uv pip install -e ..
What kind of orders can I place?
The server supports market, limit, stop, and stop-limit orders for stocks and cryptocurrencies.
Does alpaca-mcp support real trading?
The current setup is configured for Alpaca paper trading only. You would need to modify the API endpoints and use live API keys for real trading, but this is not officially documented.
What MCP resources and tools are available?
Resources include account info, positions, orders, market quotes/bars, and asset info. Tools include get_account_info, place_market_order, place_limit_order, place_stop_order, place_stop_limit_order, cancel_order, close_position, and get_portfolio_summary.