Skip to main content
Glama
il-opendata-mcp

il-opendata-mcp

by Shtibel1

CI version license TypeScript MCP

Search and query Israeli government open data (data.gov.il) from any MCP client.

A Model Context Protocol server that lets AI agents search the official data.gov.il catalog and query datastore-backed resources through the public CKAN 3 API — datasets, resources and records, without dumping raw CKAN blobs into the context window.

This is the network / open-data counterpart to hebrew-il-mcp, which covers local deterministic validators (ID, phone, VAT, IBAN, plates, postal codes, holidays).

Tools

Tool

What it does

search_datasets

CKAN package_search. Optional free-text q, optional organization slug (validated, sent as fq=organization:<slug>), optional rows (default 10, max 50) and start. Returns the match count plus a compact dataset list (name, title, truncated notes, organization, tags, resource summaries and how many resources have datastore_active).

list_organizations

CKAN organization_list with all_fields. Lists the ~60 publishing ministries and authorities sorted by dataset count. Optional q matches the slug or the Hebrew title (e.g. תחבורה), plus limit (default 25, max 100) and offset. Feed a returned name into search_datasets.organization.

get_dataset

CKAN package_show by package name or UUID. Returns the same compact metadata plus resources (id, name, format, datastore_active, last_modified).

describe_resource

CKAN datastore_search with limit=0 to return field names/types and the total record count. Clear error if the resource has no active datastore.

search_records

CKAN datastore_search. Optional full-text q, exact-match filters (a list means "any of these", numbers and booleans allowed), fields, sort (up to 5 { field, direction } keys), limit (default 10, max 100) and offset. Returns total, fields and records.

count_records

Exact number of matching records without downloading rows (datastore_search with limit=0). Optional group_by: { field, values } counts up to 25 values of one field (4 parallel requests) and returns each count, its share of the total and the other remainder — e.g. 2026 Toyota Japan vs Kia Slovakia registrations.

list_field_values

Sorted distinct values of one field (distinct=true), optionally under q/filters, to discover valid filter values. Returns total_distinct, values, has_null and complete; limit default 100, max 1000. data.gov.il applies the row limit before DISTINCT on large resources, so a partial list is flagged with complete: false and a note.

list_featured_datasets

No network. Optional category: companies, vehicles, education, fuel, government or all (default). Returns a curated starting point of well-known datasets — not a complete index. Use search_datasets for everything else.

Every tool returns both human-readable JSON text and structuredContent. Failures produce an MCP isError result instead of crashing the session.

Related MCP server: data-gov-il-mcp

Resources

Clients that support MCP resources can attach catalog context directly, without a tool call:

URI

What it returns

opendata://featured

The curated featured-dataset shortlist with categories. No network.

opendata://organizations

Every publishing ministry/authority (~60), sorted by dataset count — same shape as list_organizations.

opendata://dataset/{name}

Resource template: compact metadata + resources for one CKAN package, e.g. opendata://dataset/gsa. The featured datasets are listed as concrete resources, and dataset names autocomplete. Names are validated before CKAN is called.

All resources are application/json.

Typical flow:

  1. search_datasets with a query such as "חברות ממשלתיות" (or start from list_featured_datasets).

  2. get_dataset with a package name from the results, e.g. gsa.

  3. describe_resource with a resource id where datastore_active is true.

  4. list_field_values to see which values a field takes (statuses, cities, manufacturers).

  5. count_records for exact totals and breakdowns, and search_records with filters, sort and a small limit for the rows themselves.

Example (live, 2026-11-27, vehicle registry 053cea08-09bc-40ec-8f7a-156f0677aff3, 4.2M rows): count_records with filters: { "shnat_yitzur": 2026 } and group_by: { "field": "tozeret_nm", "values": ["טויוטה יפן", "קיה סלובקיה"] } returns 304,049 vehicles from 2026 — 16,745 Toyota Japan (5.5%) and 5,168 Kia Slovakia (1.7%) — in three small requests instead of paging millions of rows.

Caching

data.gov.il is slow (a full organization_list takes several seconds) and the catalog changes slowly, so successful CKAN GET responses are cached in memory, keyed by the full request URL:

  • Default TTL 5 minutes; --cache-ttl <seconds> or IL_OPENDATA_CACHE_TTL changes it, 0 disables caching.

  • Shared across HTTP requests: the stateless HTTP mode creates a fresh MCP server per request but reuses one CkanClient, so every agent hitting the same instance benefits.

  • Concurrent identical requests share one network call, errors and HTTP failures are never cached, and at most 256 responses are kept (oldest evicted first).

  • list_organizations filters locally, so every q reuses one cached organization_list response.

Live on 2026-11-18: reading opendata://organizations took ~9.3 s cold and the following list_organizations call 4 ms; get_dataset gsa went from ~580 ms to 2 ms.

Why

Agents that work with Israeli companies, vehicles, schools or public registries should query the official catalog instead of guessing URLs or inventing dataset ids. data.gov.il already exposes a documented CKAN API; this server wraps it with pagination caps, truncated notes, compact resource summaries and MCP-safe errors so an agent can search and then drill into datastore rows without flooding its context.

Quick start

Claude Desktop / Cursor / any MCP client

{
  "mcpServers": {
    "il-opendata": {
      "command": "npx",
      "args": ["-y", "github:Shtibel1/il-opendata-mcp"]
    }
  }
}

Or from a local clone:

npm install && npm run build
node dist/cli.js   # speaks MCP over stdio

Hosted: Streamable HTTP

Run it as a network service that any remote MCP client (or several agents at once) can share:

npx -y github:Shtibel1/il-opendata-mcp --http --port 3000
# → il-opendata-mcp listening on http://127.0.0.1:3000/mcp
curl http://127.0.0.1:3000/healthz   # {"status":"ok","name":"il-opendata-mcp","version":"0.6.0"}

Then point a client that supports remote servers at it:

{ "mcpServers": { "il-opendata": { "url": "http://127.0.0.1:3000/mcp" } } }

Flag

Env

Default

Notes

--http

off

Serve Streamable HTTP instead of stdio

--port

PORT

3000

--host

HOST

127.0.0.1

Binds to loopback by default; use 0.0.0.0 inside a container

--allowed-origin

ALLOWED_ORIGINS

none

Repeatable flag, or a comma-separated env var. Browser requests from any other Origin get 403 (DNS-rebinding protection); non-browser clients without Origin are always allowed

--cache-ttl

IL_OPENDATA_CACHE_TTL

300

Seconds to cache CKAN responses in memory (see Caching); 0 disables. Also applies to stdio mode

The HTTP mode is stateless: every POST /mcp gets a fresh server and transport, there are no session ids, and GET/DELETE /mcp return 405. That means instances can sit behind any load balancer with no sticky sessions. Bodies over 1 MB get 413, malformed JSON gets 400.

Docker

The image runs the HTTP mode as the unprivileged node user, binds 0.0.0.0:3000, and ships a HEALTHCHECK against /healthz:

docker build -t il-opendata-mcp .
docker run --rm -p 3000:3000 -e ALLOWED_ORIGINS=https://app.example il-opendata-mcp

CI builds the image on every push and smoke-tests it: health check, a real tools/list call, the origin guard, and the non-root user.

One-click deploy

Deploy to Render

The render.yaml blueprint builds the Dockerfile, wires /healthz as the health check, and prompts for ALLOWED_ORIGINS. Any container host (Fly.io, Railway, Cloud Run, ECS) works the same way: run the image and expose port 3000.

Programmatic use:

import { startHttpServer } from "il-opendata-mcp";

const { url, close } = await startHttpServer({ port: 0, allowedOrigins: ["https://app.example"] });

As a library

import { CkanClient, listFeaturedDatasets } from "il-opendata-mcp";

const ckan = new CkanClient({ cacheTtlMs: 60_000 }); // optional; default 5 min, 0 disables
const { count, datasets } = await ckan.searchDatasets({ q: "חינוך" });
const dataset = await ckan.getDataset("gsa");
const resource = dataset.resources.find((item) => item.datastore_active);
if (resource) {
  const schema = await ckan.describeResource(resource.id);
  const rows = await ckan.searchRecords({ resource_id: resource.id, limit: 5 });
}

listFeaturedDatasets("companies"); // curated names such as ica_companies, gsa, …

Architecture

flowchart LR
  C["MCP client<br/>(Claude Desktop, Cursor, agents)"] -- stdio --> CLI[cli.ts]
  R["Remote agents"] -- "POST /mcp" --> H["http.ts<br/>stateless Streamable HTTP<br/>origin check · /healthz"]
  CLI --> S["server.ts<br/>zod schemas · isError results"]
  CLI -- "--http" --> H
  H -- "new server per request<br/>shared CkanClient" --> S
  S --> CKAN
  S --> CAT
  subgraph L["src/lib — no MCP imports"]
    CKAN["ckan.ts<br/>injectable fetch · CKAN 3 client"]
    CACHE["cache.ts<br/>in-memory TTL cache"]
    CAT["catalog.ts<br/>curated featured list"]
  end
  CKAN --> CACHE
  CKAN -- HTTPS --> GOV["data.gov.il<br/>/api/3/action"]
  APP["Your TS app"] -- import --> L

Layout

src/
  lib/ckan.ts      injectable-fetch CKAN client (no MCP imports)
  lib/catalog.ts   curated featured-dataset list (static, verified names only)
  lib/cache.ts     in-memory TTL cache (promise sharing, no cached errors, bounded size)
  server.ts        MCP tool + resource wiring (zod schemas)
  version.ts       single source of the version (handshake, User-Agent, /healthz)
  http.ts          stateless Streamable HTTP transport (node:http, no framework)
  cli.ts           entry: stdio by default, --http for hosted mode
  index.ts         public exports
test/
  ckan.test.ts     URL building, parsing, errors, pagination caps
  catalog.test.ts  category filters
  cache.test.ts    TTL cache + CkanClient caching (expiry, keys, in-flight sharing, errors, disable)
  server.test.ts   end-to-end tests through a real MCP client (tools, resources, completion; in-memory transport, mocked fetch)
  http.test.ts     real HTTP server on an ephemeral port: client round-trip, statelessness, shared cache, health, 400/403/404/405
  • Pure core, thin adapter. Networking and mapping live in src/lib with no MCP dependency, so the client is reusable as a plain TypeScript library.

  • Compact payloads. Long notes are truncated (~500 characters) and raw CKAN blobs are mapped down to the fields agents actually need.

  • Pagination caps. Dataset search is limited to 50 rows; datastore queries are limited to 100 records.

  • Curated starting point. list_featured_datasets is a verified shortlist (companies, vehicles, education, fuel, government), not a complete catalog.

These CKAN package names were verified against the live catalog on 2026-11-08:

Category

Package name

Title

companies

ica_companies

מאגר חברות - רשם החברות

companies

ica_partnerships

מאגר שותפויות - רשם החברות

companies

ica-changes

פרטי שינויים בחברות ושותפויות

companies / government

gsa

רשימת חברות ממשלתיות ודירקטורים מכהנים

companies

pinkashakablanim

פנקס הקבלנים הרשומים

vehicles

private-and-commercial-vehicles

מספרי רישוי של כלי רכב פרטיים ומסחריים

vehicles

shinui_mivne

היסטוריית כלי רכב פרטיים

education

mosdot_edu

מוסדות חינוך

education

mosdot

מאפייני מוסדות חינוך בפיקוח משרד החינוך

fuel

fuelstationbynumber

מאגר תחנות הדלק

fuel

gas-stations-br7

תחנות דלק

Use search_datasets to discover anything that is not on this list.

Development

npm test          # vitest (mocked fetch — no network required)
npm run typecheck
npm run build

Attribution

This is an unofficial client. Data comes from data.gov.il and its original publishers under their terms. This project does not claim any government affiliation.

Roadmap

  • Publish to npm so npx il-opendata-mcp works without the GitHub shorthand

  • Hosted (Streamable HTTP) transport option (v0.2.0)

  • Dockerfile and one-click deploy for the HTTP mode (v0.3.0)

  • Browse by publisher: list_organizations + search_datasets.organization filter (v0.4.0)

  • In-memory response cache (--cache-ttl) shared across HTTP requests, and MCP resources opendata://featured, opendata://organizations, opendata://dataset/{name} (v0.5.0)

  • count_records (exact totals and group_by breakdowns), list_field_values, search_records.sort and multi-value filters (v0.6.0)

  • Range filters beyond exact match. datastore_search_sql is reachable, but data.gov.il's gateway rejects WHERE clauses and COUNT(*) with an HTML 404, so it is not a reliable base yet

Contributing

Issues and PRs are welcome. Keep CKAN mapping in src/lib with unit tests, and add an end-to-end case in test/server.test.ts for new tools. Please do not invent dataset ids — verify names against the live catalog.

License

MIT © Nadav Shtibel

Available Tools

8 tools
count_recordsCount datastore recordsA

Exact number of records in a data.gov.il datastore resource that match optional q/filters, without downloading rows (datastore_search with limit 0). Optional group_by counts records per value of one field (up to 25 values, e.g. manufacturers or roles from list_field_values) and returns each count, its share of the total and the remainder ("other").

Inputs: resource_id (required), q, filters, group_by.

describe_resourceDescribe a datastore resourceA

Return field names/types and the total record count for a CKAN datastore resource (datastore_search with limit 0). Fails with a clear error if the resource has no active datastore — use get_dataset to find resources where datastore_active is true.

Inputs: resource_id (required).

get_datasetGet a data.gov.il datasetA

Fetch metadata and resources for one dataset by CKAN package name or UUID (package_show). Resource summaries include format, last_modified and whether datastore_active is true (needed before search_records).

Inputs: id (required).

list_field_valuesList distinct values of a fieldA

Distinct values of one field in a data.gov.il datastore resource (datastore_search with distinct=true), sorted, optionally under q/filters. Use it to discover valid filter values (statuses, cities, manufacturers) before search_records or count_records. limit caps the rows CKAN scans (default 100, max 1000); complete=false means the list is partial.

Inputs: field (required), resource_id (required), q, limit, +1 more.

list_organizationsList data.gov.il publishing organizationsA

List the government ministries and authorities that publish on data.gov.il (CKAN organization_list), sorted by number of datasets. Optional q matches the slug or the Hebrew title, e.g. 'תחבורה' or 'transport'. Pass a returned name as search_datasets.organization.

Inputs: q, limit, offset.

search_datasetsSearch data.gov.il datasetsA

Search the Israeli government open-data catalog (data.gov.il CKAN package_search). Returns a compact list of matching datasets with titles, truncated notes, organizations, tags and resource summaries, including how many resources have an active datastore. Optionally restrict to one publishing organization (slug from list_organizations). Use list_featured_datasets for a curated starting point.

Inputs: q, rows, start, organization.

search_recordsSearch datastore recordsA

Query rows in a data.gov.il datastore resource (CKAN datastore_search). Supports full-text q, exact-match filters (a list means any of these), field selection, sort, limit (default 10, max 100) and offset. The resource must have an active datastore.

Inputs: resource_id (required), q, sort, limit, +3 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools target distinct resource+action pairs, and descriptions actively steer agents (e.g. list_featured_datasets says it is not a complete index, use search_datasets). The main soft spots are describe_resource vs count_records, both of which issue datastore_search with limit 0 and report a record count, though the schema-vs-filtered-count distinction is explained.

    Naming Consistency5/5

    Uniform verb_noun snake_case throughout: get_dataset, list_organizations, search_datasets, describe_resource, search_records, count_records, list_field_values. Verbs (get/list/search/describe/count) map predictably to intent.

    Tool Count5/5

    Eight tools cleanly cover the CKAN discovery and datastore querying surface without padding. Each tool has a distinct role in a discover-then-query workflow, which is a well-scoped size for this domain.

    Completeness4/5

    Covers catalog discovery (search, organizations, featured, dataset detail), resource introspection, and row querying/counting/field values — a solid lifecycle. Minor gaps: no tool to surface download URLs or fetch non-datastore resources, and no organization-level dataset listing beyond search_datasets.organization.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      C
      maintenance
      Enables AI assistants to search, discover, and analyze thousands of datasets from Israel's national open data portal. It provides tools for querying government ministries, municipalities, and public bodies using the CKAN API.
      9
      141 npm
      111
      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 through the official CKAN API, including datasets, resources, tags, organizations, and tabular records. Supports catalog search, metadata resources, domain prompts, and structured tool responses over local stdio or remote Streamable HTTP.
      141 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Provides MCP clients with structured access to Israeli government open data, enabling discovery and querying of datasets, resources, tags, organizations, and tabular records through the official CKAN API.
      141 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible clients to discover and query Israeli Government Open Data from data.gov.il, including datasets, resources, tags, organizations, and tabular records through the official CKAN API. It provides catalog search, metadata retrieval, resource listing, record querying, prompts, and static/templated resources for streamlined exploration.
      141 npm
      MIT