Skip to main content
Glama
bluedragonDC

MEDAS MCP

by bluedragonDC

MEDAS MCP(まだ開発中!)

TÜİK MEDAS(Turkish Statistical Institute indicators)用のMCPサーバー

特徴

  • 92のトピック — すべてのTÜİK統計カテゴリ

  • 400以上の指標 — 即座にキャッシュ、ライブへのフォールバックも可能

  • 動的検出 — ハードコードされたウィジェットIDは0、UI変更に適応

  • キャッシュファースト — list_topics/get_indicators/download はすべてキャッシュから50ms未満

  • バイナリXLS — xlwt CDFV2 Excel出力(MEDAS pivot.xlsと同じ形式)

  • スマートカスケード — 必須の内訳(COICOP、SITCなど)を自動選択

  • ZK Widget API — zk.Widget.$().fire() による堅牢なkırılım処理

Related MCP server: turkiye-veri-mcp

インストール

pip install playwright xlwt httpx
playwright install chromium

またはuvを使用:

uv pip install -e .
playwright install chromium

使用方法

MCPサーバーとして(stdio)

python server.py

Pi統合

~/.pi/config.json に追加:

{
  "extensions": {
    "medas": {
      "command": "python",
      "args": ["/path/to/medas_mcp/server.py"],
      "cwd": "/path/to/medas_mcp"
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "medas": {
      "command": "python",
      "args": ["/path/to/medas_mcp/server.py"]
    }
  }
}

ツール

ツール

説明

速度

list_topics(search?)

92のTÜİKトピックを一覧表示

<50ms (キャッシュ)

get_indicators(topic_index)

指標とカスケードブランチを取得

<50ms (キャッシュ)

download(topic_index, indicators?, format?, save_path?, live?)

XLS/CSVレポートをダウンロード

<50ms キャッシュ / ~12s ライブ

フロー例

1. list_topics("fiyat") → [{index:78, label:"Tüketici Fiyat Endeksi"}]
2. get_indicators(78) → {count:12, indicators:[...]}
3. download(78, format="xls") → /tmp/MEDAS_Tüketici_Fiyat_Endeksi_20260820.xls

アーキテクチャ

AI Agent  ⇄  MCP (stdio)  ⇄  server.py  ⇄  medas_client.py
                                            ├─ cache (data/*.json) → instant
                                            └─ Playwright (live=true) → ZK AU protocol

キャッシュとライブ

モード

ソース

速度

データ

live=false (デフォルト)

data/*.json キャッシュ

<50ms

指標名 + モック値

live=true

POST /medas/zkau → GET /pivot.xls

~12s

実際のMEDASピボットテーブル

ファイル

medas_mcp/
├── server.py              # MCP server (3 tools)
├── medas_client.py        # Hybrid client (cache + live Playwright)
├── KNOWHOW.md             # ZK AU protocol traffic notes
├── AGENTS.md              # AI agent instructions
├── README.md              # This file
├── pyproject.toml         # Package metadata
├── .gitignore
└── data/
    ├── topic_mapping.json  # 92 topics with URLs
    ├── topic_gosterge.json # Indicators + cascading branches
    └── medas_unified.json  # Unified dataset

ZK AUプロトコル

  • POST /medas/zkau;jsessionid=XXX を dtid + バッチ処理された cmd_n=onSelect/onClick と共に送信

  • ウィジェットIDはセッションごとに変更 — DOMを介して動的に検出

  • カスケード: zk.Widget.$('#selectId').fire('onSelect', {items:[itemId], reference:itemId})

ライセンス

MIT

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Enables querying Turkish economic data (inflation, FX rates, policy rates, etc.) from TCMB EVDS via curated tools, preventing LLM hallucination.
    6
    -
  • A
    license
    A
    quality
    B
    maintenance
    Provides unified access to Turkish official data from TÜİK (statistics via SDMX) and TCMB EVDS (financial series), enabling search, query, and tidy CSV export with full frequency, aggregation, and formula support.
    16
    1
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    MCP server that unifies official Turkish open data sources into a single interface, letting AI agents query and compare normalized indicators like population, inflation, and GDP through natural language.
    10
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI assistants to query Turkey's public data, including central-bank FX rates, earthquake catalog, weather forecasts, public holidays, and offline validation of Turkish ID, tax, and IBAN numbers, with sourced and timestamped responses.
    44
    93 npm
    1
    MIT