Catalog npm
Back to packageRELEASE DETAILS

1.4.5

npm

@0xrelogic/mt5-analysis-mcp

MCP server for MT5 market analysis and trading data

forexmcpmetatrader5mt5technical-analysistrading
Published23 Nov 2025
Direct dependencies1
Transitive dependenciesNot calculated

README

Current package documentation

MT5 Analysis MCP Server

Model Context Protocol server untuk analisis teknikal MetaTrader 5 dengan AI context tools.

Features

📊 Pattern Detection (v1.3.0) 🔥 NEW

  • 🎯 13+ Chart Patterns - Double Top/Bottom, Head & Shoulders, Inverse H&S, Rising/Falling Wedge, Ascending/Descending/Symmetrical Triangle, Ascending/Descending/Horizontal Channel, Bull/Bear Flag
  • 🕯️ Candlestick Signals - Bullish/Bearish Engulfing, Hammer, Shooting Star, Doji, Morning/Evening Star
  • ⭐ Quality Scoring - 0-100 score based on completion %, confidence %, and volume confirmation
  • 📊 Volume Validation - Patterns marked with ✓/✗ based on volume spike confirmation
  • 🎚️ Smart Support/Resistance - Strength 1-10 calculated from touches, age (bars), and volume
  • 📐 Fibonacci Retracement - Auto-detect trend + 7 key levels (0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%)
  • 🔍 False Positive Reduction - Minimum quality threshold + strict validation rules

Core Analysis Tools

  • ✅ Comprehensive Market Analysis - Multi-timeframe analysis (M1, M5, M15, H1, H4, D1) with 15+ technical indicators including EMA20 for scalping
  • ✅ Live Price Feed - Real-time Bid/Ask/Last prices
  • ✅ Account Summary - Balance, Equity, Margin, Profit tracking
  • ✅ Batch Analysis - Compare up to 10 symbols simultaneously (summary mode)
  • ✅ Historical Data - OHLCV data on any timeframe (M1 to MN1)

AI Context Tools (v1.2.0)

  • 🧠 Market Condition Detector - Identifies trending/ranging/volatile states using ADX + ATR
  • 🧠 Higher Timeframe Bias - Shows alignment across timeframes to avoid counter-trend trades
  • 🧠 Volatility Rank - ATR percentile ranking (current vs historical)
  • 🧠 Session Info - Detects Asian/London/NY sessions and volume expectations

� Scalp ing Tools (v1.7.0) 🔥 NEW

  • ⚡ M1/M5 Timeframes - Ultra-fast scalping timeframes with full indicator suite
  • 📊 EMA20 - Critical for scalping trend identification
  • 📍 Swing High/Low - Last 30 bars for local support/resistance
  • 💰 Spread Monitoring - Real-time spread in points & pips
  • 🎯 Scalping Screener - Multi-symbol quick overview for rapid pair selection
  • 🔍 Market Condition M1/M5 - Trending/ranging/volatile detection on scalping timeframes

🔔 Alert System (v1.8.0) 🔥 UPDATED

  • 🎯 15 Condition Types - RSI, MACD, Price, Pattern, ADX, Stochastic, Price Level, Price Breaks, HTF Bias, Volatility, Session, Volume, Spread, Candle Patterns, Momentum, Time Filter
  • ⚡ Scalping Conditions (NEW) - Spread check (<2 pips), Candle patterns (6 types), Momentum (price velocity), Time filter (avoid low-volume hours)
  • ⏰ Background Monitor - Auto-checks rules every 5 minutes
  • 📊 Quality Scoring - Each alert shows quality score based on conditions met
  • 🔕 Cooldown System - Prevents spam with configurable cooldown hours
  • 📱 Telegram Ready - Built-in Telegram notification support
  • ✅ Acknowledge System - Mark alerts as reviewed to keep track

Technical Indicators

RSI, MACD, Bollinger Bands, Ichimoku Cloud, ADX, Parabolic SAR, Stochastic, CCI, Williams %R, ATR, Keltner Channels, OBV, MFI


Setup untuk Server (VM/Tailscale Host)

1. Install Dependencies

cd "d:/Project Utama/Metatrade5"
pip install fastapi uvicorn pandas ta MetaTrader5 pytz

2. Jalankan API Server

cd "d:/Project Utama/Metatrade5/analysis_service"
python main.py

Server akan jalan di http://0.0.0.0:8000

3. Cek IP Tailscale

tailscale ip -4

Contoh output: 100.67.151.83


Setup untuk Client (Keluarga/Tim)

1. Pastikan Tailscale Aktif

2. Install MCP Server via NPM

Edit file mcp_config.json (lokasi tergantung IDE):

Cursor/VS Code:

  • Windows: C:\Users\{username}\.cursor\mcp_config.json atau .vscode\mcp_config.json
  • Mac/Linux: ~/.cursor/mcp_config.json

Claude Desktop:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

Tambahkan konfigurasi ini:

{
  "mcpServers": {
    "mt5-analysis": {
      "command": "npx",
      "args": ["-y", "@0xrelogic/mt5-analysis-mcp"],
      "env": {
        "MT5_API_URL": "http://100.67.151.83:8000"
      }
    }
  }
}

Ganti 100.67.151.83 dengan IP Tailscale server kamu!

3. Restart IDE

  • Cursor/VS Code: Tutup dan buka lagi (Ctrl+Q → Re-open)
  • Claude Desktop: Restart aplikasi

Tools yang Tersedia

🔥 Pattern Detection (NEW in v1.3.0)

detect_patterns - Deteksi Pattern + Fibonacci

Input: symbol (string), timeframe (string, default: "H4")
Contoh: "BTCUSD", "H4"

Output:
- 13+ chart patterns (sorted by quality score)
- Candlestick signals (Engulfing, Hammer, Doji, etc.)
- Support/Resistance levels with strength 1-10
- Fibonacci retracement levels
- Volume confirmation (✓/✗)
- Quality scores (0-100)

Example Output:
=== PATTERNS FOUND (sorted by quality) ===
Double Top (bearish_reversal)
  Quality: 85% | Confidence: 92% | Volume: ✓
  Target: 83271.33

=== FIBONACCI RETRACEMENT ===
Trend: DOWNTREND
Current at: 23.6% level ← Current

Support: 83422.93 - Strength: 8/10 (7 touches, 10 bars)

Core Analysis Tools

1. get_market_analysis - Analisa Lengkap

Input: symbol (string)
Contoh: "XAUUSD"
Output: Analisa M15, H1, H4, D1 dengan semua indikator

2. get_live_price - Cek Harga Cepat

Input: symbol (string)
Contoh: "EURUSD"
Output: Bid, Ask, Last, Time

3. get_account_summary - Info Akun

Input: (none)
Output: Balance, Equity, Margin, Profit

4. get_batch_analysis - Multi Symbol

Input: symbols (comma-separated string)
Contoh: "EURUSD,XAUUSD,GBPUSD"
Output: Analisa semua symbol sekaligus (max 10)

5. get_historical_data - Data OHLCV

Inputs:
  - symbol (string): "EURUSD"
  - timeframe (string): "M1", "M5", "M15", "M30", "H1", "H4", "D1", "W1", "MN1"
  - bars (number): 100 (max 1000)
Output: Data OHLCV historis

AI Context Tools (v1.2.0) 🆕

6. get_market_condition - Market State

Inputs:
  - symbol (string): "EURUSD"
  - timeframe (string): "M15", "H1", "H4", "D1" (default: "H4")
Output: trending/ranging/volatile + ADX + ATR + trend strength

7. get_htf_bias - Timeframe Alignment

Inputs:
  - symbol (string): "EURUSD"
  - timeframe (string): "M15", "H1", "H4", "D1" (default: "H1")
Output: Bias per timeframe + alignment score + recommendation

8. get_volatility_rank - Volatility Percentile

Input: symbol (string): "EURUSD"
Output: ATR percentile + status (low/normal/high/extremely_high)

9. get_session_info - Trading Sessions

Input: (none)
Output: Active sessions (Asian/London/NY) + volume expectations

🔔 Alert System Tools (v1.5.0) 🆕

10. create_alert_rule - Buat Alert Otomatis

Inputs:
  - name (string): "EURUSD Oversold Setup"
  - symbol (string): "EURUSD"
  - timeframe (string): "M15", "H1", "H4", "D1" (default: "H4")
  - conditions (array): Array of condition objects
  - min_conditions_met (number): Minimum conditions to trigger (default: 2)
  - cooldown_hours (number): Hours before re-trigger (default: 4)
  - telegram_enabled (boolean): Send to Telegram (default: true)

Condition Types:
  - RSI: {type: "rsi", operator: "<", value: 30}
  - MACD: {type: "macd", operator: ">", value: 0}
  - Price: {type: "price", operator: "<", value: 1.0500}
  - Pattern: {type: "pattern", pattern_type: "bullish_reversal", min_quality: 80}
  - ADX: {type: "adx", operator: ">", value: 25}
  - Stochastic: {type: "stoch", operator: "<", value: 20}

Example:
{
  "name": "EURUSD Bullish Setup",
  "symbol": "EURUSD",
  "timeframe": "H4",
  "conditions": [
    {"type": "rsi", "operator": "<", "value": 30},
    {"type": "pattern", "pattern_type": "bullish_reversal", "min_quality": 80}
  ],
  "min_conditions_met": 2
}

Output: Rule ID, name, conditions count

11. list_alert_rules - Lihat Semua Alert Rules

Input: enabled_only (boolean, default: true)
Output: List of all alert rules with status, conditions, trigger count

12. get_pending_alerts - Lihat Alert yang Triggered

Input: acknowledged (boolean, default: false)
Output: List of pending alerts with conditions met, quality score, price

13. acknowledge_alert - Tandai Alert Sudah Dibaca

Input: alert_id (number)
Output: Success confirmation

14. delete_alert_rule - Hapus Alert Rule

Input: rule_id (number)
Output: Success confirmation

15. evaluate_alert_rule - Test Alert Rule Manual

Input: rule_id (number)
Output: Current evaluation result (triggered/not triggered), conditions status

🚀 Scalping Tools (v1.7.0) 🆕

16. get_scalping_screener - Multi-Symbol Scalping Overview

Inputs:
  - symbols (string): "EURUSD,GBPUSD,XAUUSD,BTCUSD" (max 10)
  - timeframe (string): "M1", "M5", "M15" (default: "M5")

Output per symbol:
  - price & spread_pips
  - trend_bias: bullish/bearish/neutral
  - market_condition: trending/ranging/volatile
  - volatility_status: low/normal/high/extremely_high
  - rsi, stoch_k, stoch_d
  - distance_to_swing_high_pips
  - distance_to_swing_low_pips
  - swing_high, swing_low
  - adx, atr

Perfect for: Quickly scanning which pairs are good for scalping right now!

Cara Pakai

Setelah setup, langsung chat ke AI:

Analisa Single:

  • "Analisa XAUUSD sekarang"
  • "Berapa harga EURUSD?"

Analisa Batch:

  • "Analisa batch untuk EURUSD, XAUUSD, GBPUSD"
  • "Bandingkan kondisi pasar EURUSD dan GBPUSD"

Data Historis:

  • "Ambil 200 bar data H4 untuk EURUSD"
  • "Tampilkan candle D1 XAUUSD 100 bar terakhir"

AI Context (v1.2.0): 🆕

  • "Apakah EURUSD lagi trending atau ranging?"
  • "Cek timeframe alignment untuk XAUUSD di H1"
  • "Berapa volatility EURUSD sekarang?"
  • "Session apa yang aktif sekarang?"

Alert System (v1.5.0): 🔥

  • "Buatkan alert untuk EURUSD kalau RSI < 30 dan ada bullish pattern di H4"
  • "Lihat semua alert rules yang aktif"
  • "Ada alert pending tidak?"
  • "Test alert rule nomor 1"
  • "Hapus alert rule nomor 2"

Info Akun:

  • "Cek saldo akun MT5 saya"

API Endpoints (Untuk Dev/Testing)

# Core Endpoints
curl http://100.67.151.83:8000/api/analyze/EURUSD
curl http://100.67.151.83:8000/api/price/EURUSD
curl http://100.67.151.83:8000/api/account
curl "http://100.67.151.83:8000/api/analyze/batch?symbols=EURUSD,XAUUSD,GBPUSD"
curl "http://100.67.151.83:8000/api/history/EURUSD?timeframe=H1&bars=100"

# AI Context Endpoints (v1.2.0) 🆕
curl http://100.67.151.83:8000/api/condition/EURUSD/H4
curl http://100.67.151.83:8000/api/htf-bias/EURUSD/H1
curl http://100.67.151.83:8000/api/volatility/EURUSD
curl http://100.67.151.83:8000/api/session

# Alert System Endpoints (v1.5.0) 🔥
curl http://100.67.151.83:8000/api/alerts/rules
curl http://100.67.151.83:8000/api/alerts/pending
curl -X POST http://100.67.151.83:8000/api/alerts/create -H "Content-Type: application/json" -d '{"name":"Test","symbol":"EURUSD","conditions":[{"type":"rsi","operator":"<","value":30}]}'
curl http://100.67.151.83:8000/api/alerts/evaluate/1
curl -X DELETE http://100.67.151.83:8000/api/alerts/rules/1

# API Documentation
http://100.67.151.83:8000/docs

Keamanan

✅ Private Network Only

  • Hanya yang terhubung ke Tailscale yang bisa akses
  • Tidak perlu expose port ke internet public
  • Data trading tetap dalam jaringan private

Troubleshooting

Tools tidak muncul di AI?

  1. Pastikan API server jalan: curl http://IP:8000/
  2. Pastikan MT5 sudah login di server
  3. Restart IDE setelah edit mcp_config.json
  4. Cek log di terminal IDE (Ctrl+Shift+P → "MCP: Show Logs")

Connection refused?

  1. Cek IP Tailscale benar
  2. Pastikan firewall allow port 8000
  3. Pastikan Tailscale aktif di client dan server

Error "429 Too Many Requests" dari NPM?

  • NPM rate limit, tunggu 5-10 menit
  • Atau download package sekali: npm install -g @0xrelogic/mt5-analysis-mcp

Update Log

v1.9.1 (2025-11-25) 🐛 CRITICAL BUG FIX - PIP VALUE CALCULATION

  • 🔧 FIXED: Pip value calculation for XAUUSD, JPY pairs, and other instruments
  • 🔧 FIXED: Trade journal pip calculation (was 10x off for gold)
  • ✅ XAUUSD: Now correctly uses pip_size = 0.01, pip_value = $1/lot
  • ✅ XAGUSD: Now correctly uses pip_size = 0.01, pip_value = $50/lot
  • ✅ USOIL/UKOIL: Now correctly uses pip_size = 0.01, pip_value = $10/lot
  • ✅ JPY Pairs: Now correctly converts pip value from JPY to USD
  • ✅ BTCUSD/ETHUSD: Now correctly uses pip_size = 0.1, pip_value = $0.1/lot
  • 📊 Added pip_info section to position size calculator output
  • 🧪 Added test script test_pip_fix.py for verification

v1.7.0 (2025-11-24) 🚀 SCALPING EDITION

  • 📊 Added M1 & M5 timeframes to get_market_analysis
  • ⚡ Added EMA20 for scalping (in addition to EMA50/200)
  • 📍 Added swing high/low (last 30 bars) for support/resistance
  • 💰 Added spread info (points & pips) to current_price
  • 🔍 Extended get_market_condition to support M1/M5/M15
  • 🎯 NEW TOOL: get_scalping_screener - Multi-symbol quick overview
    • Trend bias (bullish/bearish/neutral)
    • Market condition (trending/ranging/volatile)
    • Volatility status
    • RSI, Stochastic K/D
    • Distance to swing high/low in pips
    • Spread, ADX, ATR
  • 📈 Perfect for scalpers and day traders!

v1.5.0 (2025-11-23) 🔥

  • 🔔 Added Alert System:
    • create_alert_rule - Create custom alerts with multiple conditions
    • list_alert_rules - View all alert rules
    • get_pending_alerts - Check triggered alerts
    • acknowledge_alert - Mark alerts as reviewed
    • delete_alert_rule - Remove alert rules
    • evaluate_alert_rule - Test rules manually
  • ⏰ Background monitor checks rules every 5 minutes
  • 📊 Quality scoring for each alert
  • 🔕 Cooldown system to prevent spam
  • 📱 Telegram notification support

v1.3.0 (2025-11-22)

  • 🔥 Added Pattern Detection:
    • detect_patterns - 13+ chart patterns + candlestick signals
    • Quality scoring (0-100) with volume confirmation
    • Support/Resistance levels with strength 1-10
    • Fibonacci retracement levels
    • False positive reduction

v1.2.0 (2025-11-22)

  • 🧠 Added AI Context Tools:
    • get_market_condition - Detect trending/ranging/volatile states
    • get_htf_bias - Check timeframe alignment
    • get_volatility_rank - ATR percentile ranking
    • get_session_info - Trading session detection
  • ✨ Raw data outputs for AI interpretation (no hardcoded suggestions)

v1.1.0 (2025-11-22)

  • ✨ Added get_batch_analysis - analyze multiple symbols at once
  • ✨ Added get_historical_data - fetch OHLCV historical data
  • 📝 Improved README with clearer setup instructions

v1.8.0 (2025-11-24) 🔥 SCALPING CONDITIONS UPDATE

  • ⚡ 4 New Alert Conditions for scalping strategies:
    • spread - Check spread in pips (e.g., {type: 'spread', operator: '<', value: 2})
    • candle - 6 candlestick patterns (bullish_engulfing, bearish_engulfing, hammer, shooting_star, doji, pin_bar)
    • momentum - Price velocity detection (min_pips threshold)
    • time - Time filter to avoid low-volume hours
  • 🎯 15 Total Condition Types - Complete toolset for swing & scalping
  • 📝 Updated MCP docs with detailed syntax examples
  • ✅ All conditions tested with live market data

v1.0.0 (2025-11-22)

  • 🎉 Initial release
  • ✅ Market analysis with 15+ indicators
  • ✅ Live price feed
  • ✅ Account summary

Maintainer: @0xReLogic

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@modelcontextprotocol/sdk
Environment
{
  "local_name": "@modelcontextprotocol/sdk",
  "alias": false,
  "peer_metadata": null
}
^1.0.4runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "a936552a529930ee18b740d92751e4d212555b8e",
  "tarball": "https://registry.npmjs.org/@0xrelogic/mt5-analysis-mcp/-/mt5-analysis-mcp-1.4.5.tgz",
  "fileCount": 3,
  "integrity": "sha512-ZFDRz3+vHh6LIwfvpxOICoMbvdY6+ZE8zyFwkIO2EEKu3zICa1Yzfj7DG87HgMRQJpj0B6iPnpC1tw8sueEjlg==",
  "signatures": [
    {
      "sig": "MEUCIQDjiSWrsCF5YEppiaFbH/pCOVvd59G8cMe6TliQPTJxaQIgGA7rIvsBX8H1EN1gBqjbCUbc0jYASgu00X0+IKJQq4E=",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 43965
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:37 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:5db1b20b0cbe2d488e7f978bb91ebd85138cedf8b00cd9be03416a0a12ddec65

Other collected versions

1.9.125 Nov1.9.024 Nov1.8.324 Nov1.8.224 Nov1.8.124 Nov1.8.024 NovView all collected versions →