Skip to main content
Glama

MARKET_AI_HUB

A local, research-only financial market analysis backend for AI clients. It exposes market data, forecasting, validation, and research evidence through a standard MCP stdio server, so an AI client or agent can run a local Python research pipeline instead of guessing.

This is a research system, not an automated trading system. It does not log into brokers, place orders, or hold positions. See DISCLAIMER.md and SECURITY.md.

Release: v2.0.0-rc1 (research release candidate). See CHANGELOG.md.


Scope

MARKET_AI_HUB treats three markets as first-class research targets:

Target family

Primary target

Execution instrument

Maturity

OSAKA_MICRO

OSE Nikkei 225 Micro Futures (OSE_NIKKEI225_MICRO_FUTURES)

the Micro futures itself

most complete historical pipeline

TAIWAN_STOCK

individual Taiwan equities (e.g. 3706.TW)

the equity itself

runtime analysis available; historical OOS NOT_YET_VALIDATED

TAIWAN_INDEX

TAIEX cash index (forecast/reference)

TX / MTX / TMF

semantics + registry exist; direct pipeline PARTIAL

Forecast target and execution instrument are deliberately separated. TAIEX index points are not executable futures prices. See config/primary_market_mission.yaml and config/primary_targets.yaml.

Related MCP server: TdxQuant MCP Server

Current research status

Layer

Conclusion

Proxy (^N225) OOS

NO_EVIDENCE

Direct Micro historical OOS

STATISTICAL_FORECAST_EVIDENCE (VAR(1), non-executable)

Causal / executability

NON_EXECUTABLE_FORECAST_EDGE

Economic (cost-aware)

NO_ECONOMIC_EDGE

Forward evidence

NONE_YET (accumulating)

Strategy / production candidate

NONE

Trading readiness

RESEARCH_ONLY

Historical statistical signal is not trading edge. The authoritative frozen conclusion lives in research/phase2/freeze/PHASE2_RESEARCH_FREEZE.yaml. Live status: docs/reference/current-status.md.

What it provides

  • Market data — official and proxy sources with provenance and data-grade labels.

  • Forecasting — price (Chronos-2, TimesFM) and direction (XGBoost, LightGBM) models, with a research ensemble.

  • Validation — chronological walk-forward, out-of-sample holdout, leakage guards, baselines, and honest metric semantics.

  • MCP — 27 tools (health_check, get_analysis_packet, analyze_jnu, analyze_osaka_nikkei, analyze_taiwan_stock, get_forward_test_status, …).

  • Skills — 4 packaged agent skills (osaka-micro-analysis, taiwan-stock-v28, model-validation-audit, financial-analyst-agent).

Quick start

# 1. Create the environment
scripts\setup_windows.ps1

# 2. Download required model weights (manual, licensed)
python scripts\download_models.py --required

# 3. Verify
pytest tests/

# 4. Start the MCP server
.venv\Scripts\market-ai-mcp.exe

Configure your MCP client to launch that executable over stdio. Cherry Studio is one supported example — see docs/getting-started/cherry-studio.md.

Validation philosophy

Evidence is layered and never mixed across layers or markets:

DATA → HISTORICAL → CAUSAL → ECONOMIC → FORWARD → RISK → PRODUCTION

Passing one layer does not imply the next. Historical statistical evidence is never presented as a trading signal. See docs/concepts/validation.md and research/phase2/protocols/OUT_OF_SAMPLE_VALIDATION_STANDARD.md.

Documentation

Start here: docs/README.md (documentation index).

Key entry points:

Safety and limitations

  • RESEARCH_ONLY. No live trading, no order tool, no broker credentials.

  • Compute is governed by a resource governor (default DESKTOP_SAFE); AUTO_TRAIN, AUTO_FINE_TUNE, and AUTO_PROMOTE are all false.

  • 225LABO and other licensed raw data are LOCAL_ONLY and never committed to this repository.

License

See LICENSE and THIRD_PARTY_NOTICES.md.

Available Tools

21 tools
analyze_osaka_nikkeiB

大阪日經 PROXY 分析(^N225 index + 跨市場;非 OSE micro 即時)。

requested_dates(可選):"YYYY-MM-DD..YYYY-MM-DD"。^N225 依 TSE 日曆交易;
若窗口含 TSE 休市日(OSE futures 可能 Holiday Trading)→ CALENDAR_TARGET_MISMATCH。

Inputs: horizon, requested_dates.

analyze_taiwan_stockA

台股分析(如 2330 / 3706.TW / 華邦電)。只回傳 structured evidence。

Inputs: stock (required), horizon.

backtestA

walk-forward backtest(yfinance 資料 + baseline 分類器)。

輸出含分類指標(accuracy/balanced_accuracy/macro_f1/mcc)與 baselines
(uniform_random=1/3、majority_class_baseline、naive direction baseline)。

Inputs: model, period, symbol, n_splits.

get_analysis_archive_statusB

Analysis Archive 狀態(不可變分析 / append-only outcome / reanalysis)。

Inputs: no named parameters.

get_analysis_packetC

正式分析封包(backend 先完成大部分工作)。

market: osaka | taiwan。target 例:OSE_NIKKEI225_MICRO_FUTURES / 3706.TW。
horizon: 1d/2d/5d/10d。detail_level: compact | normal | audit。
^N225 只能是 PROXY/REFERENCE,不得當 execution target。

Inputs: market, target, horizon, detail_level, +1 more.

get_data_coverageA

大阪微型日經各 factor 資料覆蓋摘要(LIVE_VERIFIED/CONTRACT_ONLY/NEEDS_CONFIG/...)。不得隱藏缺口。

Inputs: no named parameters.

get_data_source_statusB

各資料來源狀態(TWSE/FinMind/FRED/yfinance/JQuants/TradingView/Broker)。

Inputs: no named parameters.

get_event_calendarA

近期重要官方事件日曆(BOJ/Fed/CPI/NFP/PCE/GDP/MOF),只回 Top-N。

Inputs: days, top_n.

get_forward_test_statusB

Forward test 註冊狀態(Prediction Registry 中 joint/scenario/ensemble 預測是否已結算)。

Inputs: no named parameters.

get_market_dataC

取市場資料(yfinance symbols,或數字代碼走台股流程)。僅回傳結構化資料。

Inputs: symbol (required), period, interval.

get_model_leaderboardD

模型 leaderboard(tournament PerformanceStore,含 BEST_BASELINE)。

Inputs: target, horizon.

get_model_performanceB

讀取歷史 backtest 績效(model 空白 = 全部)。

分類指標不再硬用 50% 門檻:baseline_threshold = max(majority_class_baseline, uniform_random_baseline)。
沒有資料的欄位回 null(不是 0)。

Inputs: limit, model.

get_official_release_snapshotB

官方 macro 來源狀態快照(LIVE_VERIFIED / NEEDS_CONFIG / CONTRACT_ONLY)。

Inputs: no named parameters.

get_research_gatesB

Research validation gates:ENGINEERING_GATE / DATA_GATE / MODEL_PREDICTIVE_GATE / TRADING_EDGE_GATE。

每次評估基於 current runtime(singleton 載入),帶 evaluated_at / build_id / evidence。

Inputs: no named parameters.

get_system_infoB

Python / GPU / CUDA / models(role + task + dual status)/ ensemble / MCP tools / gates / build fingerprint。

Inputs: no named parameters.

get_target_instrument_stateB

真正交易標的狀態(OSE_NIKKEI225_MICRO_FUTURES)+ Micro settlement + 角色標記。

Inputs: no named parameters.

health_checkA

整體健康檢查:models / providers / 環境 / build fingerprint。

Inputs: no named parameters.

predict_chronosB

Chronos-2 多步預測。horizon "Nd" = N trading bars(1d/2d/5d/10d)。含 build fingerprint。

Inputs: symbol (required), period, horizon.

predict_ensembleC

Chronos + TimesFM + XGBoost + LightGBM ensemble。

V1.1 語義:price_ensemble(PRICE_FORECAST 真 quantile)與
direction_ensemble(DIRECTION_CLASSIFICATION)分層;legacy 欄位標 legacy_research_only。

Inputs: symbol (required), period, horizon.

predict_timesfmC

TimesFM-3.0 多步預測(weights 非商業授權)。含 build fingerprint。

Inputs: symbol (required), period, horizon.

run_ts_validationB

時間序列模型 rolling-origin OOS 驗證(V1.1 pipeline)。

- 多 rolling origins、no look-ahead、每 fold 預測下一 bar
- 比較 last-price naive / drift / moving-average baselines(MAE/RMSE/MASE)
- interval coverage:p10-p90 nominal 80% 的實測覆蓋率 + calibration error
- deterministic promotion(services/validation.PROMOTION_RULES),結果持久化

Inputs: model, period, symbol, n_folds.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 21 tools

    Disambiguation3/5

    Most tools target distinct resource/action pairs, but several status/snapshot tools overlap (health_check vs get_system_info, get_data_source_status vs get_official_release_snapshot vs get_data_coverage), and analyze_taiwan_stock/analyze_osaka_nikkei vs get_analysis_packet have unclear boundaries. The detailed descriptions help, but the tool set is not immediately unambiguous.

    Naming Consistency4/5

    The dominant patterns get_<noun>, predict_<model>, and analyze_<market> are consistent and readable. Minor deviations like health_check, backtest, and run_ts_validation break the pattern slightly but do not create serious confusion.

    Tool Count3/5

    21 tools is on the heavy side for an MCP surface, with several status/coverage/snapshot tools that could plausibly be consolidated. The broad hub scope makes the count defensible, but it is borderline and requires agents to absorb a large tool list.

    Completeness4/5

    The surface covers health, data ingestion, prediction, backtesting, time-series validation, market analysis, and monitoring/archive status. Minor gaps exist around triggering forward tests and retrieving raw prediction outputs, but the core workflows are represented without major dead ends.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Provides comprehensive Taiwan stock market data and analysis through MCP tools. Enables querying real-time stock prices, historical data, company information, technical analysis, and market overviews for TWSE and TPEx listed companies.
      8
      16
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides AI clients access to TdxQuant/通达信 financial data and trading capabilities through MCP. Enables retrieval of market data, financial reports, sector information, and trading operations via stdio or HTTP/SSE connections.
      30
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to operate a local financial terminal, including market data, backtesting, paper portfolio management, and news digest, through safe, gated tools over MCP.
      6
      1
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and backends to access standardized financial market data and analysis tools across A-shares, US equities, ETFs, indices, and crypto, including technical indicators, fundamentals, news, filings, and money flow. It exposes these capabilities through MCP tools and HTTP endpoints, with agent-friendly artifacts and CSV/JSON exports.
      -