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


您可以用它做什么?

🏠 探索住房市场

分析公共住房数据集,了解单元面积、位置和可用性:

数据集概况 — 公共住房

查看哪些城市在政府住房抽签中的需求量最大:

按城市划分的住房抽签申请人数

了解全国公寓面积的分布情况:

公共住房单元面积分布

跟踪住房单元随时间的可用性:

每次抽签的可用住房单元

🗺️ 绘制公共基础设施地图

可视化以色列各地的教育机构:

教育机构地图

绘制公共交通站点:

公共交通站点


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²

洞察: 像阿什凯隆 (Ashkelon) 和斯代罗特 (Sderot) 这样的城市,每次抽签有 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

分析数据集以了解其结构和质量。

  • 检测到的字段:整数、数字、字符串、坐标

  • 统计信息:最小值、最大值、平均值、空值计数、唯一值

  • 输出:带有搜索/过滤功能的交互式数据表

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

chart_generator

从任何数据集生成交互式图表。

图表类型

用例

histogram

数值分布(例如:公寓面积)

bar

比较类别(例如:每个城市的申请人数)

line

时间趋势(例如:每次抽签的住房单元)

scatter

两个数值字段之间的相关性

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

可视化工具使用带有 prefab-ui 组件的 FastMCPApp 提供程序:

  • 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)

  • 地图弹出内容经过 HTML 转义以防止 XSS

  • 折线图按 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. Fork 本仓库

  2. 创建功能分支

  3. 进行更改并添加测试

  4. 提交 Pull Request


故障排除

与 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