Skip to main content

MCP server for technical analysis with Alpaca market data - Bollinger Bands, Moving Averages, Stochastics, and 11 trading strategies

Project description

alpaca-market-mcp

MCP server for technical analysis with Alpaca market data. Computes Bollinger Bands, Moving Averages, Stochastics, candlestick patterns, and evaluates 11 trading strategies - all server-side, no Python execution needed on the client.

Installation

# Via uvx (recommended)
uvx alpaca-market-mcp

# Via pip
pip install alpaca-market-mcp

Configuration

Claude Desktop / Claude.ai

Add to your MCP config:

{
  "mcpServers": {
    "alpaca-market": {
      "command": "uvx",
      "args": ["alpaca-market-mcp"],
      "env": {
        "ALPACA_API_KEY": "your-api-key",
        "ALPACA_SECRET_KEY": "your-secret-key"
      }
    }
  }
}

Claude Code

Add to .mcp.json:

{
  "mcpServers": {
    "alpaca-market": {
      "command": "uvx",
      "args": ["alpaca-market-mcp", "--feed", "iex"],
      "env": {
        "ALPACA_API_KEY": "your-api-key",
        "ALPACA_SECRET_KEY": "your-secret-key"
      }
    }
  }
}

Environment Variables

Variable Required Description
ALPACA_API_KEY Yes Alpaca API key
ALPACA_SECRET_KEY Yes Alpaca secret key

CLI Options

alpaca-market-mcp [OPTIONS]

Options:
  --transport [stdio|streamable-http|sse]  Transport protocol (default: stdio)
  --host TEXT                               Host to bind (HTTP only)
  --port INTEGER                            Port to bind (HTTP only)
  --feed [iex|sip|otc]                      Data feed (default: iex)
  --env-file PATH                           Load env vars from file

Tools

analyze_ticker

Full multi-timeframe technical analysis (15min, 1h, 1d). Returns Bollinger Bands, Moving Averages (SMA 20/40/100/200), candlestick patterns, volume, and Stochastics.

check_strategy

Evaluate the 11 trading strategies from the options course. Returns condition-by-condition pass/fail with CUMPLIDA/PARCIAL/NO CUMPLIDA status.

get_indicators

Get a specific indicator's values for a single timeframe. Supports: bb, sma, ema, stoch, rsi, macd, atr, volume, candles.

scan_tickers

Scan multiple tickers for trading signals and active strategies.

get_stock_bars_with_indicators

Historical OHLCV bars with indicator columns attached.

Indicators

Indicator Weight Parameters
Bollinger Bands 50% Period 20, Std 2.0
Moving Averages 25% SMA 20, 40, 100, 200
Candlestick Patterns 15% Body ratio classification
Volume 5% SMA(20) ratio
Worden Stochastics 5% K=14, D=3, Smooth=3

11 Trading Strategies

# Strategy Action
1 Cambio tendencia al alza (BB Hora) CALL
2 Cambio tendencia a la baja (BB Hora) PUT
3 Rebote punto medio bajista (BB Dia) PUT
4 Rebote punto medio alcista (BB Dia) CALL
5 Salido BB sin volatilidad al alza (15 Min) PUT
6 Efecto iman bajista (MA Hora + BB 15 Min) CALL
7 Efecto iman alcista (MA Hora + BB 15 Min) PUT
8 Cambio tendencia al alza (BB 15 Min) CALL
9 Cambio tendencia a la baja (BB 15 Min) PUT
10 Lateral a alcista mediano plazo (MAs) CALL
11 Lateral a bajista mediano plazo (MAs) PUT

Development

# Install dev dependencies
uv pip install -e ".[dev]"

# Run tests
uv run pytest

# Lint
uv run ruff check src/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alpaca_market_mcp-0.1.1.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alpaca_market_mcp-0.1.1-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file alpaca_market_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: alpaca_market_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for alpaca_market_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 69d37c251834953b8e4c4c98d545ed31caae9cbe2545801d4ba302feddfb043a
MD5 039e57572c8490afd3de4b1ec48c715c
BLAKE2b-256 370f8fda6bdc8fc90a6c526edd9fcea47e3cd15bb02eb4e1dbed4b3ddbfc3a23

See more details on using hashes here.

File details

Details for the file alpaca_market_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: alpaca_market_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for alpaca_market_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5298567f897db0732839f69701ed66c6b759e81699d4775c4fd31e64673de33
MD5 7bdafcfdf0d00d33c33a8a54ec7fb6fc
BLAKE2b-256 8276cb4f8b4819f71b00a06f38c4be3a1c6e8490c5ba7e65b7e2325f52dc8394

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page