Skip to content
Back to search

datagov-mcp

MCP server for Israel Government Data

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/aviveldan--datagov-mcp/badge.svg)](/listings/aviveldan--datagov-mcp)

HTML

<a href="/listings/aviveldan--datagov-mcp"><img src="/api/listings/aviveldan--datagov-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installation

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]"

Using with Claude Desktop

fastmcp install claude-desktop server.py

Restart Claude Desktop — you'll see the DataGovIL tools available immediately.

Try It with the MCP Inspector

fastmcp dev inspector server.py

This opens a web UI where you can browse tools, test them interactively, and preview MCP App visualizations in the **Apps** tab.

Using with `fastmcp dev apps`

Preview the interactive visualization apps locally:

fastmcp dev apps server.py

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 321 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # DataGov Israel MCP Server
  2. An MCP server for exploring Israeli government open data ([data.gov.il](https://data.gov.il)) — with built-in interactive visualizations powered by [MCP Apps](https://gofastmcp.com).
  3. Search thousands of public datasets, profile their structure, generate charts, and plot geographic data on maps — all from your AI assistant.
  4. [![Tests](https://github.com/aviveldan/datagov-mcp/actions/workflows/test.yml/badge.svg)](https://github.com/aviveldan/datagov-mcp/actions/workflows/test.yml)
  5. [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
  6. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  7. ---
  8. ## What Can You Do With This?
  9. ### 🏠 Explore the Housing Market
  10. Profile public housing datasets to understand unit sizes, locations, and availability:
  11. ![Dataset Profile — Public Housing](screenshots/demo-profile.png)
  12. See which cities have the most demand in government housing lotteries:
  13. ![Housing Lottery Subscribers by City](screenshots/demo-bar-chart.png)
  14. Understand the distribution of apartment sizes across the country:
  15. ![Distribution of Public Housing Unit Sizes](screenshots/demo-histogram.png)
  16. Track housing unit availability over time:
  17. ![Housing Units Available per Lottery](screenshots/demo-line-chart.png)
  18. ### 🗺️ Map Public Infrastructure
  19. Visualize education institutions across Israel:
  20. ![Education Institutions Map](screenshots/demo-edu-map.png)
  21. Plot public transport stations:
  22. ![Public Transport Stations](screenshots/demo-map.png)
  23. ---
  24. ## Quick Start
  25. ### Installation
  26. ```bash
  27. git clone https://github.com/aviveldan/datagov-mcp.git
  28. cd datagov-mcp
  29. # Create virtual environment and install (requires uv)
  30. uv venv
  31. source .venv/bin/activate # On Windows: .venv\Scripts\activate
  32. uv pip install -e ".[dev]"
  33. ```
  34. ### Using with Claude Desktop
  35. ```bash
  36. fastmcp install claude-desktop server.py
  37. ```
  38. Restart Claude Desktop — you'll see the DataGovIL tools available immediately.
  39. ### Try It with the MCP Inspector
  40. ```bash
  41. fastmcp dev inspector server.py
  42. ```
  43. This opens a web UI where you can browse tools, test them interactively, and preview MCP App visualizations in the **Apps** tab.
  44. ### Using with `fastmcp dev apps`
  45. Preview the interactive visualization apps locally:
  46. ```bash
  47. fastmcp dev apps server.py
  48. ```
  49. ---
  50. ## Example: Finding Real Estate Opportunities
  51. Here's a real workflow for someone exploring the Israeli housing market:
  52. ```
  53. You: "Search for discounted housing lottery datasets"
  54. → package_search(q="דירה בהנחה")
  55. Found: "נתונים תקופתיים - תכנית דירה בהנחה" (Discounted Housing Program)
  56. Resource ID: 7c8255d0-49ef-49db-8904-4cf917586031
  57. You: "Profile this dataset so I can understand what fields are available"
  58. → dataset_profile(resource_id="7c8255d0-49ef-49db-8904-4cf917586031")
  59. Shows: LamasName (city), Subscribers, Winners, PriceForMeter,
  60. LotteryHousingUnits, ProjectName, Neighborhood...
  61. You: "Show me which cities have the most subscribers competing for units"
  62. → chart_generator(
  63. resource_id="7c8255d0-49ef-49db-8904-4cf917586031",
  64. chart_type="bar",
  65. x_field="LamasName",
  66. y_field="Subscribers",
  67. title="Housing Lottery Subscribers by City"
  68. )
  69. → Interactive bar chart rendered in MCP Apps UI
  70. You: "Now show the public housing units — map them and show me sizes"
  71. → dataset_profile(resource_id="c3a68837-9b7a-4ee7-bd92-130678dc8ae3")
  72. Shows: CityLmsName, NumOfRooms (avg 2.4), Floor, TotalArea (21-110 m²)...
  73. → chart_generator(
  74. resource_id="c3a68837-9b7a-4ee7-bd92-130678dc8ae3",
  75. chart_type="histogram",
  76. x_field="TotalArea",
  77. title="Distribution of Housing Unit Sizes (m²)"
  78. )
  79. → Most units are 48-57 m², with a long tail up to 110 m²
  80. ```
  81. **Insight:** Cities like Ashkelon and Sderot show 25,000-35,000 subscribers per lottery — that's intense competition. Smaller cities in the periphery (Umm al-Fahm, Nazareth) have far fewer. If you're flexible on location, your odds improve dramatically.
  82. ---
  83. ## Available Tools
  84. ### Core Data Tools
  85. | Tool | Description |
  86. |------|-------------|
  87. | `status_show` | Get CKAN version and site info |
  88. | `license_list` | List available dataset licenses |
  89. | `package_list` | Get all dataset IDs |
  90. | `package_search` | Search datasets with filters and sorting |
  91. | `package_show` | Get detailed metadata for a specific dataset |
  92. | `organization_list` | List all organizations |
  93. | `organization_show` | Get details of a specific organization |
  94. | `resource_search` | Search for resources within datasets |
  95. | `datastore_search` | Query data within a specific resource |
  96. | `fetch_data` | Convenience tool — find dataset by name and fetch its data |
  97. ### Visualization Tools (MCP Apps) 📊
  98. These tools render interactive UI directly in MCP-compatible clients.
  99. #### `dataset_profile`
  100. Profile a dataset to understand its structure and quality.
  101. - **Fields detected**: integer, number, string, coordinate
  102. - **Statistics**: min, max, mean, null count, unique values
  103. - **Output**: Interactive DataTable with search/filter
  104. ```
  105. dataset_profile(resource_id="c3a68837-9b7a-4ee7-bd92-130678dc8ae3", sample_size=200)
  106. ```
  107. #### `chart_generator`
  108. Generate interactive charts from any dataset.
  109. | Chart Type | Use Case |
  110. |------------|----------|
  111. | `histogram` | Distribution of numeric values (e.g., apartment sizes) |
  112. | `bar` | Compare categories (e.g., subscribers per city) |
  113. | `line` | Trends over time (e.g., housing units per lottery) |
  114. | `scatter` | Correlations between two numeric fields |
  115. ```
  116. chart_generator(
  117. resource_id="7c8255d0-49ef-49db-8904-4cf917586031",
  118. chart_type="bar",
  119. x_field="LamasName",
  120. y_field="Subscribers",
  121. title="Housing Lottery Subscribers by City",
  122. limit=50
  123. )
  124. ```
  125. #### `map_generator`
  126. Plot geographic data on interactive Leaflet maps.
  127. ```
  128. map_generator(
  129. resource_id="e873e6a2-66c1-494f-a677-f5e77348edb0",
  130. lat_field="Lat",
  131. lon_field="Long",
  132. limit=500
  133. )
  134. ```
  135. ---
  136. ## Useful Resource IDs
  137. Here are some interesting datasets to get started with:
  138. | Dataset | Resource ID | Good For |
  139. |---------|-------------|----------|
  140. | ✈️ Flights (טיסות) | `e83f763b-b7d7-479e-b172-ae981ddc6de5` | Bar charts by airline |
  141. | 🏠 Public Housing (דיור ציבורי) | `c3a68837-9b7a-4ee7-bd92-130678dc8ae3` | Histograms, profiling |
  142. | 🎰 Housing Lotteries (דירה בהנחה) | `7c8255d0-49ef-49db-8904-4cf917586031` | Bar/line charts |
  143. | 🚌 Transport Stations (תחנות) | `e873e6a2-66c1-494f-a677-f5e77348edb0` | Maps (has Lat/Long) |
  144. | 🏫 Schools (מוסדות חינוך) | `5c5d6bb0-755d-470d-84b6-d7dd3135ba9c` | Maps (UTM_X/UTM_Y) |
  145. ---
  146. ## Architecture
  147. ### MCP Apps
  148. Visualization tools use [FastMCPApp](https://gofastmcp.com) providers with [prefab-ui](https://github.com/PrefectHQ/prefab-ui) components:
  149. - **`DataProfile` app** → `DataTable`, `Metric` components
  150. - **`Charts` app** → `BarChart`, `LineChart`, `ScatterChart`, `Histogram`
  151. - **`Maps` app** → `Embed` with Leaflet HTML
  152. Tools registered via `@app.ui()` automatically get proper MCP Apps metadata and render in compatible clients.
  153. ### Async HTTP Layer
  154. All API calls use `httpx.AsyncClient` with:
  155. - 30-second timeout
  156. - Automatic retries for 5xx errors
  157. - Connection pooling
  158. ### Data Safety
  159. - Numeric values from CKAN are coerced (handles `"25"` → `25.0`)
  160. - Map popup content is HTML-escaped to prevent XSS
  161. - Line charts are sorted by x-axis for correct rendering
  162. ---
  163. ## Development
  164. ### Running Tests
  165. ```bash
  166. pytest tests/ -v # 39 tests
  167. pytest tests/ --cov=datagov_mcp # With coverage
  168. ```
  169. ### Code Style
  170. ```bash
  171. ruff check . # Lint
  172. ruff format . # Format
  173. ```
  174. ### Project Structure
  175. ```
  176. datagov-mcp/
  177. ├── datagov_mcp/
  178. │ ├── server.py # Core CKAN tools + provider registration
  179. │ ├── apps.py # FastMCPApp definitions (DataProfile, Charts, Maps)
  180. │ ├── visualization.py # Visualization tools (@app.ui entry points)
  181. │ ├── api.py # CKAN API helper
  182. │ └── client.py # HTTP client
  183. ├── tests/ # 39 tests with HTTP mocking
  184. │ ├── test_api.py
  185. │ ├── test_contracts.py
  186. │ ├── test_tools.py
  187. │ └── test_visualization.py
  188. ├── screenshots/ # Auto-generated demo screenshots
  189. ├── server.py # Entrypoint
  190. └── pyproject.toml
  191. ```
  192. ---
  193. ## Contributing
  194. We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
  195. 1. Fork the repository
  196. 2. Create a feature branch
  197. 3. Make changes with tests
  198. 4. Submit a pull request
  199. ---
  200. ## Troubleshooting
  201. ### Port Conflicts with MCP Inspector
  202. ```bash
  203. pip install nano-dev-utils
  204. python -c "from nano_dev_utils import release_ports; release_ports.PortsRelease().release_all()"
  205. ```
  206. ### Windows + OneDrive
  207. Avoid running installation in OneDrive-synced folders. See [uv#7906](https://github.com/astral-sh/uv/issues/7906).
  208. ### Import Errors
  209. ```bash
  210. uv pip install -e ".[dev]"
  211. ```
  212. ---
  213. ## License
  214. MIT — see [LICENSE](./LICENSE).
  215. ## Acknowledgments
  216. - Built with [FastMCP](https://gofastmcp.com) and [prefab-ui](https://github.com/PrefectHQ/prefab-ui)
  217. - Data from [Israel Open Data Portal](https://data.gov.il)
  218. - Maps powered by [Leaflet](https://leafletjs.com/) + [CARTO](https://carto.com/)
  219. - Charts powered by [Recharts](https://recharts.org/) (via prefab-ui)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.