Alpaca MCP Server

by jwaresolutions

283 downloads Not rated yet MIT

About

# Alpaca MCP Server A Model Context Protocol (MCP) server for Alpaca Trading API that provides seamless integration with AI assistants and development tools. ## ✅ Compatibility **Tested and verified to work on Apple Silicon M1 Pro laptops** running macOS. ## Features - **Account Information**: Get real-time account…

Details

License
MIT

Explore

- Account Information: Get real-time account details, buying power, equity, and status
- Portfolio Management: View current positions with P&L tracking
- Market Data: Retrieve real-time stock quotes with bid/ask spreads
- Order Management: List and monitor recent orders
- Paper Trading Support: Safe testing environment with paper trading API
- Live Trading Ready: Compatible with live trading (use with caution)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Alpaca MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

pip install alpaca-trade-api

1. Sign up at Alpaca Markets
2. Go to the dashboard and navigate to "API Keys"
3. Generate new API keys for paper trading or live trading
4. Copy your API Key ID and Secret Key

Option 1: Environment Variables

export APCA_API_KEY_ID="PK..."
export APCA_API_SECRET_KEY="..."
export APCA_API_BASE_URL="https://paper-api.alpaca.markets"

Option 2: .env file

APCA_API_KEY_ID=PK...
APCA_API_SECRET_KEY=...
APCA_API_BASE_URL=https://paper-api.alpaca.markets

Add to your MCP settings JSON:

{
  "mcpServers": {
    "alpaca": {
      "command": "python",
      "args": ["/path/to/alpaca-mcp-server/alpaca_mcp_server.py"],
      "env": {
        "APCA_API_KEY_ID": "your_api_key_here",
        "APCA_API_SECRET_KEY": "your_secret_key_here",
        "APCA_API_BASE_URL": "https://paper-api.alpaca.markets"
      }
    }
  }
}

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "alpaca mcp server": {
            "alpaca": {
                "command": "node",
                "args": [
                    "/path/to/alpaca-server/build/index.js"
                ],
                "env": {
                    "ALPACA_API_KEY": "",
                    "ALPACA_SECRET_KEY": "",
                    "ALPACA_BASE_URL": ""
                }
            }
        }
    }
}

McpServers

{
    "alpaca": {
        "command": "node",
        "args": [
            "/path/to/alpaca-server/build/index.js"
        ],
        "env": {
            "ALPACA_API_KEY": "",
            "ALPACA_SECRET_KEY": "",
            "ALPACA_BASE_URL": ""
        }
    }
}

A Model Context Protocol (MCP) server for Alpaca Trading API that provides seamless integration with AI assistants and development tools.

✅ Compatibility

Tested and verified to work on Apple Silicon M1 Pro laptops running macOS.

Features

- Account Information: Get real-time account details, buying power, equity, and status
- Portfolio Management: View current positions with P&L tracking
- Market Data: Retrieve real-time stock quotes with bid/ask spreads
- Order Management: List and monitor recent orders
- Paper Trading Support: Safe testing environment with paper trading API
- Live Trading Ready: Compatible with live trading (use with caution)

Installation

Prerequisites

pip install alpaca-trade-api

Quick Start

1. Clone the repository:

git clone https://github.com/jwaresolutions/alpaca-mcp-server.git
cd alpaca-mcp-server

2. Set up your Alpaca API credentials:

Create environment variables or add to your shell profile:
```bash
export APCA_API_KEY_ID="your_api_key_here"
export APCA_API_SECRET_KEY="your_secret_key_here"
export APCA_API_BASE_URL="https://paper-api.alpaca.markets" # Paper trading

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.