miguelyad26_alpaca-mcp-server

miguelyad26_alpaca-mcp-server

3.5

This is a Model Context Protocol (MCP) server for Alpaca, allowing LLMs like Claude to interact with the Alpaca trading API.

The Alpaca MCP Server is designed to facilitate seamless interaction between large language models (LLMs) and the Alpaca trading API. It enables users to perform various trading-related tasks such as trading stocks, checking positions, fetching market data, and managing accounts through natural language commands. This server is particularly useful for those who want to leverage the power of LLMs to automate and simplify their trading activities. By integrating with the Alpaca API, users can access real-time market data, manage their trading accounts, and execute trades efficiently. The server supports both paper and real money trading, providing flexibility for users to test strategies or engage in live trading.

Features

  • {'name': 'Market Data', 'description': 'Get real-time stock quotes and historical price data.'}
  • {'name': 'Account Information', 'description': 'Check your balances, buying power, and status.'}
  • {'name': 'Position Management', 'description': 'View current positions and their performance.'}
  • {'name': 'Order Placement', 'description': 'Place market and limit orders through natural language.'}
  • {'name': 'Order Management', 'description': 'List, track, and cancel orders.'}

MCP Tools

  • get_account_info(): Get account balances and status.
  • get_positions(): List all current positions in the portfolio.
  • get_stock_quote(symbol): Get the latest quote for a stock.
  • get_stock_bars(symbol, days): Get historical price bars for a stock.
  • get_orders(status, limit): List orders with specified status.
  • place_market_order(symbol, side, quantity): Place a market order.
  • place_limit_order(symbol, side, quantity, limit_price): Place a limit order.
  • cancel_all_orders(): Cancel all open orders.
  • close_all_positions(cancel_orders): Close all open positions.

Usage with Different Platforms

Running the server

bash
python alpaca_mcp_server.py

Configuring Claude for Desktop


{
  "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"
      }
    }
  }
}

Related MCP Servers

View all finance servers →