Skip to content

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MCP Market Data Server

Python Version License: MIT FastMCP Twelve Data

A powerful FastMCP server providing comprehensive financial market data analysis tools for LLM agents and trading applications.


🎯 Overview

The MCP Market Data Server is a production-ready financial analysis server implementing the Model Context Protocol (MCP). It provides four powerful analysis tools that deliver institutional-grade market insights:

  • 🎚️ Volume Profile Analysis - Identify key support/resistance levels based on volume distribution
  • πŸ“ˆ Technical Analysis - Access 15+ standard indicators with multi-timeframe analysis
  • 🎯 Technical Zones - Calculate high-probability price zones for precise entry/exit decisions
  • πŸ“Š ORB Analysis - Opening Range Breakout levels with multi-period analysis for intraday/0DTE trading
  • πŸ” Fair Value Gap Analysis - Detect price imbalances and unfilled gaps for mean reversion trades

Perfect for algorithmic trading, quantitative analysis, and AI-powered trading agents.

✨ Features

πŸ“Š Multi-Timeframe Analysis

  • ⏱️ 1-minute: Scalping and micro-movements
  • ⏱️ 5-minute: Intraday swing trading
  • ⏱️ 1-day: Position trading and trend analysis

πŸ“ˆ Volume Profile Intelligence

  • 🎯 Point of Control (POC) identification
  • πŸ“Š Value Area High/Low (VAH/VAL) calculations
  • πŸ”₯ High/Low Volume Node detection
  • πŸ’Ή Volume dynamics and momentum analysis
  • πŸ“ˆ Upside probability assessment

πŸ”§ Technical Indicators Suite

  • Moving Averages: SMA (20, 50, 200), EMA (20), VWAP
  • Momentum: RSI, MACD, Stochastic Oscillator
  • Volatility: ATR (Average True Range)
  • Volume: OBV, CMF, Volume Rate of Change
  • Advanced: Ichimoku Cloud, Trend Strength Analysis
  • Patterns: Divergence Detection

🎯 Smart Zone Analysis

  • πŸ“ Fibonacci retracement/extension levels
  • πŸ“… Previous day high/low levels
  • πŸ“Š ATR-based volatility zones
  • 🎚️ Volume Profile derived zones
  • 🎨 Zone strength classification

πŸ“Š Opening Range Breakout (ORB)

  • ⏱️ Multi-period analysis (5, 15, 30 minutes)
  • 🎯 Breakout confirmation with volume
  • πŸ“ˆ Extension targets (0.5x, 1x, 1.5x, 2x)
  • πŸ” ORB squeeze detection
  • πŸ“‘ Trading bias analysis

πŸ” Fair Value Gap (FVG) Detection

  • πŸ“Š 3-candle pattern recognition
  • πŸ“ˆ Multi-timeframe gap analysis (1m, 5m, 15m)
  • 🎯 Fill percentage and interaction tracking
  • πŸ’Ή Volume analysis during gap formation
  • πŸ“ Statistical fill probability
  • 🎨 Gap strength classification

πŸš€ Enterprise Features

  • ⚑ Async/await architecture for high performance
  • πŸ”’ Secure API key management
  • πŸ—οΈ Modular, extensible design
  • πŸ“ Comprehensive logging and error handling
  • πŸ§ͺ Full test coverage
  • πŸ“‹ Type hints throughout

πŸ“– API Reference

🎚️ financial_volume_profile

Analyzes volume distribution across price levels to identify key trading zones.

Request:

{
  "tool": "financial_volume_profile", 
  "symbol": "AAPL"
}

Response:

{
  "symbol": "AAPL",
  "status": "success",
  "timeframe_volume_profile": {
    "5m": {
      "volume_profile_structure": {
        "point_of_control": 150.25,
        "value_area_high": 151.80,
        "value_area_low": 149.10,
        "high_volume_nodes": [...],
        "low_volume_nodes": [...]
      },
      "volume_dynamics": {
        "supports_continued_upside": true,
        "volume_supports_upside_probability": 75.5,
        "volume_trend": "increasing",
        "volume_bias": "bullish"
      }
    }
  },
  "consolidated_analysis": {
    "supports_continued_upside": true,
    "confidence": "high"
  }
}

πŸ“ˆ financial_technical_analysis

Provides comprehensive technical indicators across multiple timeframes.

Request:

{
  "tool": "financial_technical_analysis",
  "symbol": "MSFT"
}

Response:

{
  "symbol": "MSFT", 
  "status": "success",
  "timeframe_indicators": {
    "1d": {
      "indicators": {
        "current_price": 380.50,
        "sma_20": 375.20,
        "sma_50": 370.15,
        "rsi": 65.2,
        "macd": {
          "macd": 2.34,
          "signal": 1.98,
          "histogram": 0.36
        },
        "atr": 8.45,
        "vwap": 379.80
      },
      "trend_analysis": {
        "trend": "uptrend",
        "strength": "moderate"
      }
    }
  }
}

🎯 financial_technical_zones

Identifies precise support/resistance zones using multiple methodologies.

Request:

{
  "tool": "financial_technical_zones",
  "symbol": "GOOGL"  
}

Response:

{
  "symbol": "GOOGL",
  "status": "success", 
  "timeframe_zones": {
    "5m": {
      "zones": [
        {
          "type": "SUPPORT",
          "level": 142.50,
          "strength": "strong",
          "source": "Volume Profile POC",
          "confidence": 85
        },
        {
          "type": "RESISTANCE", 
          "level": 145.80,
          "strength": "moderate",
          "source": "Previous Day High",
          "confidence": 70
        }
      ]
    }
  }
}

πŸ“Š analyze_open_interest

Analyzes Opening Range Breakout patterns for intraday and 0DTE trading strategies.

Request:

{
  "tool": "analyze_open_interest",
  "symbol": "SPY"
}

Response:

{
  "symbol": "SPY",
  "status": "success",
  "timestamp": "2024-03-15T14:30:00Z",
  "market_session": "regular_hours",
  "current_price": 425.50,
  "orb_analysis": {
    "5min": {
      "orb_high": 424.75,
      "orb_low": 424.25,
      "orb_range": 0.50,
      "position": "above_range",
      "breakout_confirmed": true,
      "breakout_type": "bullish",
      "volume_analysis": {
        "volume_ratio_vs_day_avg": 1.35,
        "high_volume": true
      },
      "targets": {
        "bull_1x": 425.25,
        "bear_1x": 423.75
      },
      "targets_hit": ["bull_0.5x", "bull_1x"]
    }
  },
  "trading_bias": {
    "bias": "bullish",
    "confidence": "high",
    "strength_factors": [
      "5min bullish breakout confirmed",
      "5min high volume above range"
    ]
  },
  "orb_squeeze": {
    "squeeze_detected": false,
    "compression_ratio": 0.95
  }
}

πŸ” financial_fvg_analysis

Detects and analyzes Fair Value Gaps across multiple timeframes.

Request:

{
  "tool": "financial_fvg_analysis",
  "symbol": "AAPL"
}

Response:

{
  "symbol": "AAPL",
  "status": "success",
  "current_price": 195.50,
  "timeframe_data": {
    "1m": {
      "fvg_count": 3,
      "gaps": [
        {
          "gap_id": "1m_2024-12-01T14:15:00Z",
          "type": "bullish",
          "price_levels": {
            "gap_high": 195.80,
            "gap_low": 195.20,
            "gap_size": 0.60
          },
          "volume_data": {
            "candle_2_volume": 125000,
            "avg_volume_20_periods": 67000
          },
          "filled_percentage": 0.0,
          "age_minutes": 15
        }
      ]
    }
  },
  "nearest_gaps": {
    "above_current_price": [
      {"level": 196.10, "distance": 0.60, "timeframe": "1m"}
    ],
    "below_current_price": [
      {"level": 194.75, "distance": 0.75, "timeframe": "5m"}
    ]
  }
}

🎯 Usage Examples

Basic Analysis

# Query: "Show me AAPL volume profile analysis"
# Response: Complete volume distribution with POC at $150.25

Multi-Tool Analysis

# Query: "Analyze TSLA using all technical tools and provide trading recommendation"
# Response: Comprehensive analysis with volume profile, indicators, and key zones

Specific Scenarios

# Scalping Setup
# Query: "Find 1-minute support levels for SPY for quick trades"

# Swing Trading
# Query: "Identify 5-minute resistance zones for NVDA breakout trading"

# Position Trading  
# Query: "Show daily technical analysis for QQQ trend confirmation"

# Mean Reversion
# Query: "Identify partially filled FVGs in NVDA that could complete filling"

# 0DTE Trading
# Query: "Analyze SPY ORB for 0DTE entry - is breakout confirmed?"

# FVG Trading
# Query: "Find unfilled gaps in TSLA for retracement entries"

About

Standalone server designed to deliver market data insights to AI trading agents. It processes data from external brokers and computes structured information to help LLMs and other AI systems make more informed trading decisions using JSON RPC protocol

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages