Skip to main content
Glama
Datagov Israel MCP

Datagov Israel MCP

by aviveldan

DataGov Israel MCP サーバー

イスラエル政府のオープンデータ (data.gov.il) を探索するための MCP サーバーです。MCP Apps によるインタラクティブな可視化機能が組み込まれています。

数千の公開データセットの検索、構造のプロファイリング、チャートの生成、地図上への地理データのプロットなどを、すべて AI アシスタントから実行できます。

Tests Python 3.10+ License: MIT


何ができるのか?

🏠 住宅市場の探索

公営住宅のデータセットをプロファイルし、ユニットサイズ、場所、空き状況を把握します:

Dataset Profile — Public Housing

政府の住宅抽選において、どの都市の需要が最も高いかを確認します:

Housing Lottery Subscribers by City

全国の住宅サイズの分布を理解します:

Distribution of Public Housing Unit Sizes

抽選ごとの住宅供給数の推移を追跡します:

Housing Units Available per Lottery

🗺️ 公共インフラの地図化

イスラエル全土の教育機関を可視化します:

Education Institutions Map

公共交通機関の駅をプロットします:

Public Transport Stations


Related MCP server: data-gov-il-mcp

クイックスタート

インストール

git clone https://github.com/aviveldan/datagov-mcp.git
cd datagov-mcp

# Create virtual environment and install (requires uv)
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"

Claude Desktop での使用

fastmcp install claude-desktop server.py

Claude Desktop を再起動すると、DataGovIL ツールがすぐに利用可能になります。

MCP Inspector で試す

fastmcp dev inspector server.py

これにより Web UI が開き、ツールを閲覧したり、インタラクティブにテストしたり、Apps タブで MCP App の可視化をプレビューしたりできます。

fastmcp dev apps での使用

インタラクティブな可視化アプリをローカルでプレビューします:

fastmcp dev apps server.py

例:不動産機会の発見

イスラエルの住宅市場を探索する際の実際のワークフロー例です:

You: "Search for discounted housing lottery datasets"

→ package_search(q="דירה בהנחה")
  Found: "נתונים תקופתיים - תכנית דירה בהנחה" (Discounted Housing Program)
  Resource ID: 7c8255d0-49ef-49db-8904-4cf917586031

You: "Profile this dataset so I can understand what fields are available"

→ dataset_profile(resource_id="7c8255d0-49ef-49db-8904-4cf917586031")
  Shows: LamasName (city), Subscribers, Winners, PriceForMeter,
         LotteryHousingUnits, ProjectName, Neighborhood...

You: "Show me which cities have the most subscribers competing for units"

→ chart_generator(
    resource_id="7c8255d0-49ef-49db-8904-4cf917586031",
    chart_type="bar",
    x_field="LamasName",
    y_field="Subscribers",
    title="Housing Lottery Subscribers by City"
  )
  → Interactive bar chart rendered in MCP Apps UI

You: "Now show the public housing units — map them and show me sizes"

→ dataset_profile(resource_id="c3a68837-9b7a-4ee7-bd92-130678dc8ae3")
  Shows: CityLmsName, NumOfRooms (avg 2.4), Floor, TotalArea (21-110 m²)...

→ chart_generator(
    resource_id="c3a68837-9b7a-4ee7-bd92-130678dc8ae3",
    chart_type="histogram",
    x_field="TotalArea",
    title="Distribution of Housing Unit Sizes (m²)"
  )
  → Most units are 48-57 m², with a long tail up to 110 m²

洞察: アシュケロンやスデロットのような都市では、抽選ごとに 25,000〜35,000 人の応募者がおり、競争が激しいことがわかります。周辺部の小さな都市(ウム・アル=ファーム、ナザレなど)では応募者ははるかに少なくなります。場所を柔軟に選べるのであれば、当選確率は劇的に向上します。


利用可能なツール

コアデータツール

ツール

説明

status_show

CKAN バージョンとサイト情報を取得

license_list

利用可能なデータセットライセンスを一覧表示

package_list

すべてのデータセット ID を取得

package_search

フィルターと並べ替えを使用してデータセットを検索

package_show

特定のデータセットの詳細メタデータを取得

organization_list

すべての組織を一覧表示

organization_show

特定の組織の詳細を取得

resource_search

データセット内のリソースを検索

datastore_search

特定のリソース内のデータをクエリ

fetch_data

便利ツール — 名前でデータセットを検索し、データを取得

可視化ツール (MCP Apps) 📊

これらのツールは、MCP 対応クライアントで直接インタラクティブな UI をレンダリングします。

dataset_profile

データセットをプロファイルし、その構造と品質を把握します。

  • 検出されたフィールド: integer, number, string, coordinate

  • 統計: 最小値, 最大値, 平均値, null 数, ユニーク値

  • 出力: 検索/フィルター機能付きのインタラクティブな DataTable

dataset_profile(resource_id="c3a68837-9b7a-4ee7-bd92-130678dc8ae3", sample_size=200)

chart_generator

任意のデータセットからインタラクティブなチャートを生成します。

チャートタイプ

ユースケース

histogram

数値の分布(例:住宅サイズ)

bar

カテゴリの比較(例:都市ごとの応募者数)

line

時系列の傾向(例:抽選ごとの住宅数)

scatter

2 つの数値フィールド間の相関

chart_generator(
  resource_id="7c8255d0-49ef-49db-8904-4cf917586031",
  chart_type="bar",
  x_field="LamasName",
  y_field="Subscribers",
  title="Housing Lottery Subscribers by City",
  limit=50
)

map_generator

インタラクティブな Leaflet マップ上に地理データをプロットします。

map_generator(
  resource_id="e873e6a2-66c1-494f-a677-f5e77348edb0",
  lat_field="Lat",
  lon_field="Long",
  limit=500
)

便利なリソース ID

開始に役立つ興味深いデータセットをいくつか紹介します:

データセット

リソース ID

用途

✈️ フライト (טיסות)

e83f763b-b7d7-479e-b172-ae981ddc6de5

航空会社別の棒グラフ

🏠 公営住宅 (דיור ציבורי)

c3a68837-9b7a-4ee7-bd92-130678dc8ae3

ヒストグラム、プロファイリング

🎰 住宅抽選 (דירה בהנחה)

7c8255d0-49ef-49db-8904-4cf917586031

棒グラフ/折れ線グラフ

🚌 交通機関の駅 (תחנות)

e873e6a2-66c1-494f-a677-f5e77348edb0

地図(緯度/経度あり)

🏫 学校 (מוסדות חינוך)

5c5d6bb0-755d-470d-84b6-d7dd3135ba9c

地図(UTM_X/UTM_Y)


アーキテクチャ

MCP Apps

可視化ツールは FastMCPApp プロバイダーと prefab-ui コンポーネントを使用しています:

  • DataProfile アプリ → DataTable, Metric コンポーネント

  • Charts アプリ → BarChart, LineChart, ScatterChart, Histogram

  • Maps アプリ → Leaflet HTML を含む Embed

@app.ui() を介して登録されたツールは、自動的に適切な MCP Apps メタデータを取得し、互換性のあるクライアントでレンダリングされます。

非同期 HTTP レイヤー

すべての API 呼び出しは httpx.AsyncClient を使用し、以下を設定しています:

  • 30 秒のタイムアウト

  • 5xx エラーに対する自動リトライ

  • コネクションプーリング

データ安全性

  • CKAN からの数値は強制変換されます("25" → 25.0 を処理)

  • マップのポップアップコンテンツは XSS を防ぐために HTML エスケープされます

  • 折れ線グラフは正しくレンダリングされるよう X 軸でソートされます


開発

テストの実行

pytest tests/ -v          # 39 tests
pytest tests/ --cov=datagov_mcp  # With coverage

コードスタイル

ruff check .   # Lint
ruff format .  # Format

プロジェクト構造

datagov-mcp/
├── datagov_mcp/
│   ├── server.py          # Core CKAN tools + provider registration
│   ├── apps.py            # FastMCPApp definitions (DataProfile, Charts, Maps)
│   ├── visualization.py   # Visualization tools (@app.ui entry points)
│   ├── api.py             # CKAN API helper
│   └── client.py          # HTTP client
├── tests/                 # 39 tests with HTTP mocking
│   ├── test_api.py
│   ├── test_contracts.py
│   ├── test_tools.py
│   └── test_visualization.py
├── screenshots/           # Auto-generated demo screenshots
├── server.py              # Entrypoint
└── pyproject.toml

貢献

貢献を歓迎します!ガイドラインについては CONTRIBUTING.md を参照してください。

  1. リポジトリをフォークする

  2. フィーチャーブランチを作成する

  3. テストを含めて変更を加える

  4. プルリクエストを送信する


トラブルシューティング

MCP Inspector とのポート競合

pip install nano-dev-utils
python -c "from nano_dev_utils import release_ports; release_ports.PortsRelease().release_all()"

Windows + OneDrive

OneDrive で同期されたフォルダー内でのインストール実行は避けてください。uv#7906 を参照してください。

インポートエラー

uv pip install -e ".[dev]"

ライセンス

MIT — LICENSE を参照してください。

謝辞

Available Tools

10 tools
fetch_dataC

Fetch data from public API based on a dataset name query

Inputs: dataset_name (required), limit, offset.

license_listB

Get the list of licenses available for datasets on the site.

Inputs: no named parameters.

organization_listB

Get names of all organizations.

Inputs: no named parameters.

organization_showB

Get details of a specific organization.

Inputs: id (required).

package_listB

Get a list of all package IDs (datasets).

Inputs: no named parameters.

package_showC

Get metadata about one specific package (dataset).

Inputs: id (required).

status_showA

Get the CKAN version and a list of installed extensions.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools have distinct purposes, such as searching datastores vs. fetching data from APIs, but 'datastore_search' and 'resource_search' could be confused as both involve searching within datasets. The descriptions help clarify, but some overlap exists.

    Naming Consistency4/5

    Tools follow a consistent snake_case pattern with clear verb_noun structures like 'package_search' and 'organization_show', but 'fetch_data' deviates slightly with a less specific verb. Overall, the naming is predictable and readable.

    Tool Count5/5

    With 10 tools, the server is well-scoped for interacting with a data catalog, covering operations like listing, searching, and showing details for datasets, organizations, and resources. Each tool earns its place without being overwhelming.

    Completeness4/5

    The toolset provides good coverage for browsing and querying a CKAN-based data catalog, including CRUD-like operations for packages and organizations. Minor gaps exist, such as no tools for creating or updating datasets, but agents can work around this for read-only access.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible clients to discover, inspect, and query Israeli government open datasets, resources, organizations, tags, and tabular records through the official data.gov.il CKAN API.
      146 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible clients to discover, inspect, and query Israeli Government Open Data from data.gov.il, including datasets, resources, tags, organizations, and tabular records through the official CKAN API.
      146 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP-compatible clients to discover, inspect, and query Israeli government datasets, resources, organizations, tags, and tabular records through the official data.gov.il CKAN API.
      146 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible clients to discover, inspect, and query Israeli Government Open Data from data.gov.il, including datasets, organizations, tags, resources, and tabular records through the CKAN API.
      146 npm
      MIT