Skip to main content
Glama
bluedragonDC

MEDAS MCP

by bluedragonDC

MEDAS MCP (아직 개발 중!)

TÜİK MEDAS(터키 통계청 지표)용 MCP 서버입니다.

기능

  • 92개 주제 — 모든 TÜİK 통계 카테고리

  • 400개 이상의 지표 — 즉시 캐시, 라이브 폴백 지원

  • 동적 탐색 — 하드코딩된 위젯 ID 0개, UI 변경에 적응

  • 캐시 우선 — list_topics/get_indicators/download 모두 캐시에서 <50ms

  • 바이너리 XLS — xlwt CDFV2 Excel 출력(MEDAS pivot.xls와 동일 형식)

  • 스마트 캐스케이딩 — 필수 분류(COICOP, SITC 등) 자동 선택

  • ZK 위젯 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

캐시 vs 라이브

모드

소스

속도

데이터

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 프로토콜

  • dtid + 배치된 cmd_n=onSelect/onClick과 함께 POST /medas/zkau;jsessionid=XXX

  • 위젯 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