Skip to main content
Glama

CI version license TypeScript MCP Data

Israel's Consumer Price Index, housing and construction-input indices — and a correct הצמדה למדד calculator — for any MCP client.

A Model Context Protocol server that gives AI agents the official price indices of the Israel Central Bureau of Statistics (הלשכה המרכזית לסטטיסטיקה): the CPI (מדד המחירים לצרכן) and its ~350 components, dwelling prices, residential/commercial building inputs (מדד תשומות הבנייה), road construction, agriculture, producer prices and more — about 1,350 indices with bilingual search, chain-linked history across base changes, multi-index comparison, year-by-year inflation tables, a one-call CPI summary, an index-linkage calculator that matches the official CBS calculator to the agora and linked payment schedules (rent, contractor instalments) with linkage differentials per payment.

It talks directly to the CBS's free, public price-index API (published by the CBS) at api.cbs.gov.il: no API key, no scraping.

Part of a small family of Israeli MCP servers: boi-mcp (Bank of Israel exchange rates and interest rate), il-opendata-mcp (data.gov.il datasets) and hebrew-il-mcp (ID, phone, VAT, IBAN validators and the Hebrew calendar).

Tools

Tool

What it does

list_chapters

The catalog's chapters (consumer prices, housing, producer prices, building/road/agriculture/bus inputs...) in English and Hebrew, each with its main index code and subjects with index counts.

search_indices

Search ~1,350 indices by English or Hebrew text (rent, שכר דירה, electricity, תשומות בנייה, cpi) or by code. Returns code, both names, chapter/subject, frequency, available_from and active. Optional chapter, limit, include_inactive.

get_latest_index

Latest value of an index (default: headline CPI 120010) with its base, the published monthly and 12-month change, published_on and the last N observations. change_over_window_pct is chain-linked.

get_index_history

History between start_month and end_month: every observation as published plus rebased_value on the latest base, the chain-linked change_pct, annualized_pct, min/max and the base_changes (with coefficients) inside the range.

compare_indices

Rank up to 12 indices by their chain-linked change between two months (default: the CPI and its main groups), with annualized rates and a missing list explaining any gaps. One API request.

get_cpi_summary

The latest CPI in one call: headline value, monthly and 12-month inflation, four core measures (ex. fruit/vegetables/housing, ex. energy...) and the 10 main consumption groups, plus the fastest_rising_yoy and falling_yoy groups. One API request.

get_annual_changes

Annual inflation by year. For each year between start_year and end_year (default: the last 10 years): the December-over-December change (Q4-over-Q4 for quarterly series; year-to-date for the current year), the 12-month rate exactly as CBS published it and the change of the annual average. Summary: cumulative and average annual change, highest and lowest year. For the CPI every year is checked against the Bank of Israel 1%–3% target (since 2003). Works for any index (home prices, building inputs...) back to 1951.

calculate_linked_amount

הצמדה למדד. Adjust an amount by any monthly index, either by index months (from_month/to_month, the actual index — מדד בגין — computed locally, both directions) or by dates (from_date/to_date, the index known on each date — המדד הידוע — via the official CBS calculator). no_decrease applies a contract-style index floor.

calculate_linked_schedule

לוח תשלומים צמוד מדד. A whole schedule of payments payments of amount every interval_months (monthly rent, quarterly or bi-monthly instalments) from start_date, each linked from one base index — base_month, or the index known on base_date such as the signing date — to the index known on its payment date, chain-linked across base changes. Per payment: index month and value, factor, linked amount and linkage differential (הפרשי הצמדה); totals for the whole schedule, for payments whose index is already published and for future payments (estimated, at the latest index). no_decrease floors every payment at the base amount. One API request; cross-checked against the official calculator.

Resources

URI

Content

cbs://chapters

Catalog chapters and subjects (same as list_chapters)

cbs://featured

Hand-picked indices (CPI, core CPI, housing, construction inputs...) and what each is used for — no network

cbs://cpi/latest

The latest CPI summary

cbs://cpi/annual

Annual CPI inflation for the last 10 years against the BOI target

cbs://index/{code}

Latest value and last 13 observations of any index; the template lists and auto-completes the featured codes

Every tool returns human-readable JSON text and structuredContent. Bad input (unknown code, malformed month, a month that isn't published yet, a future date) produces an MCP isError result with a clear message instead of crashing the session.

Related MCP server: Data.gov.il MCP Server

Index linkage, done right

Index-linked amounts are everywhere in Israel — rent, alimony, salaries, apartment purchase contracts (linked to the building-inputs index), tenders and loans — and they are easy to get subtly wrong:

  • Base changes. The CBS moves indices to a new base every few years (CPI: "Average 2022" → "Average 2024" in January 2025, coefficient 1.074). Dividing a 2019 value (100.8, base 2018) by a 2025 value (103.6, base 2024) gives +2.8% instead of the real +17.25%. cbs-mcp requests the API's chaining data (coef=true), which carries each observation's value on every older base, and always compares on a common base.

  • Known index vs. index month. Contracts usually link to the index known on the payment date. CBS publishes month M on the 15th of M+1 at 18:30, so on 1–15 of a month the known index is two months back and from the 16th it is last month's. The from_date/to_date mode delegates to the official CBS calculator, which applies this rule; from_month/to_month uses exactly the months you name.

  • Both agree. 100 ₪ from the November 2019 CPI to the November 2025 CPI computed locally (chaining coefficient 1.140778) gives 117.25 ₪ — the same result the official calculator returns for 2020-01-01 → 2026-01-01. This exact case is a regression test.

  • The 1985 rescale. In January 1985 the CBS divided the CPI by 100 without changing its base label ("Average 1980": 10,754.8 in December 1984, 113.2 in January 1985), and the coefficient into "Average 1985" is on the old scale. A naive link from December 1984 to December 1985 says −97%; cbs-mcp detects steps that contradict the published monthly change, rescales by the power of ten and gets CBS's +185.2%. Every year from 1952 to today matches the published annual rate.

  • Calculator quirks handled. The CBS calculator parses dates as MM-DD-YYYY (so 01-06-2023 is 6 January), answers HTTP 500 for future dates or reversed ranges, and the API drops a share of connections. cbs-mcp sends US-ordered dates, validates input up front, retries transient failures with backoff and turns validation errors into readable messages.

Quick start

Claude Desktop / Cursor / any MCP client

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

Claude Desktop: put this in claude_desktop_config.json. Cursor: ~/.cursor/mcp.json (or .cursor/mcp.json in a project).

Or from a local clone:

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

Then ask your agent things like:

  • "My rent is 4,500 ₪ linked to the CPI from March 2025. What should I pay now?"

  • "What was inflation last month, and which CPI groups rose the most over the past year?"

  • "חוזה דירה מקבלן צמוד למדד תשומות הבנייה מיוני 2023 — בכמה עלה הסכום של מיליון ש״ח?"

  • "Chart the CPI since 2015 on a single base."

Hosted: Streamable HTTP

npx -y github:Shtibel1/cbs-mcp --http --port 3000
# → cbs-mcp listening on http://127.0.0.1:3000/mcp
curl http://127.0.0.1:3000/healthz   # {"status":"ok","name":"cbs-mcp","version":"0.3.0"}
{ "mcpServers": { "cbs": { "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

CBS_CACHE_TTL

300

Seconds to cache index data; the catalog is kept 12 hours. 0 disables caching

--version

Print the version and exit

The HTTP mode is stateless: every POST /mcp gets a fresh server and transport (sharing one cached client), there are no session ids, and GET/DELETE /mcp return 405, so instances can sit behind any load balancer. Bodies over 1 MB get 413, malformed JSON gets 400.

Docker

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

The image runs the HTTP mode as the unprivileged node user on 0.0.0.0:3000 with a HEALTHCHECK against /healthz. CI builds it on every push and smoke-tests the health check, a real tools/list call, the origin guard and the non-root user.

As a library

import { CbsClient } from "cbs-mcp";

const cbs = new CbsClient();
const cpi = await cbs.getLatestIndex(120010);            // latest CPI, base, monthly / 12-month change
const hits = await cbs.searchIndices("שכר דירה");          // → 120460 Rent
const history = await cbs.getHistory(120010, "2015-01");  // chain-linked, rebased to the latest base
const rent = await cbs.calculateLinkedAmount({ amount: 4500, from_date: "2025-03-10" });
const contract = await cbs.calculateLinkedAmount({ amount: 1_000_000, code: 200010, from_month: "2023-04", no_decrease: true });

Live example

Real output from the built server against the live CBS API, run on 2026-11-22 (Asia/Jerusalem; the latest CPI is October 2026, published 2026-11-15):

Call

Result

get_cpi_summary

CPI October 2026: 105.2 (Average 2024 = 100), −0.1% on the month, +1.1% year over year; core ex. fruit/vegetables/housing −0.2%; housing +4.2% YoY leads, clothing & footwear −4.7% and furniture −4.2% fall

get_index_history { 120010, 2023-01 → 2026-10 }

46 months, one base change (2025-01, ×1.074), chain-linked +10.44% (2.68%/yr) — a naive comparison of published values would show +2.8%

compare_indices { 8 CPI groups, 2025-10 → 2026-10 }

Housing +4.19% · CPI +1.06% · Health +1.06% · ex-energy +0.96% · Food −0.10% · Transport & communication −1.64% · Clothing & footwear −4.70%

calculate_linked_amount { 100, from_month 2019-11, to_month 2025-11 }

117.25 ₪ (100.8 on base 2018 → 103.6 on base 2024, chaining coefficient 1.140778)

calculate_linked_amount { 100, from_date 2020-01-01, to_date 2026-01-01 }

117.25 ₪ from the official calculator (known indices 2019-11 → 2025-11)

calculate_linked_amount { 1,000,000, code 200010, from_date 2023-06-01, to_date 2026-11-01 }

1,115,607.12 ₪ — residential building inputs, known index 2023-04 → 2026-09, coefficient 1.387

calculate_linked_amount { 5000, from_month 2026-08, to_month 2026-10, no_decrease }

CPI fell 0.57% → floor applied, 5,000 ₪

calculate_linked_schedule { 6000, base_date 2025-06-10, start_date 2025-07-01, payments 24 }

Rent signed 10 June 2025 (known index April 2025, 103.1): payment 1 is 5,982.54 ₪ (index fell), Dec 2026 6,122.21 ₪; 18 payments known (+1,134.83 ₪ linkage differentials) and 6 estimated at the October 2026 index — 145,868.09 ₪ for 144,000 ₪ nominal (run 2026-11-28)

calculate_linked_schedule { 250,000, code 200010, base_month 2025-12, every 2 months × 6, no_decrease }

Residential building inputs instalments: last payment (30 Nov 2026, known index 2026-10) 257,905.14 ₪ — identical to the official CBS calculator; +25,197.63 ₪ in total (run 2026-11-28)

get_annual_changes { 120010 }

2017–2026: 0.4 · 0.8 · 0.6 · −0.7 · 2.8 · 5.3 · 3.0 · 3.2 · 2.6 (%, Dec/Dec) and +1.54% in 2026 through October; 3 of 9 years inside the 1–3% target (2 above, 4 below), +19.36% cumulative

get_annual_changes { 120010, 1983 → 1987 }

190.7% · 444.9% · 185.2% · 19.7% · 16.1% — hyperinflation and the 1985 stabilization plan, across the 1985 rescale

get_annual_changes { 40010, 2020 → 2025 }

Home prices +4.0% · +13.1% · +14.7% · −1.0% · +7.7% · −1.0%

search_indices { "שכר דירה" }

120460 Rent (שכר דירה פרטי, ציבורי ושכירות ארוכת טווח בפיקוח ממשלתי)

The first call loads the bilingual catalog (~1.4 s); later searches are served from memory in ~20 ms.

{
  "amount": 100,
  "code": 120010,
  "name": "Consumer Price Index - General",
  "method": "index_months",
  "from": { "period": "2019-11", "value": 100.8, "base": "Average 2018" },
  "to": { "period": "2025-11", "value": 103.6, "base": "Average 2024" },
  "chaining_coefficient": 1.140778,
  "factor": 1.172466,
  "change_pct": 17.247,
  "linked_amount": 117.25,
  "difference": 17.25,
  "no_decrease": false,
  "floor_applied": false,
  "computed_by": "cbs-mcp (published index values linked with CBS chaining coefficients)",
  "source": "Israel Central Bureau of Statistics (הלשכה המרכזית לסטטיסטיקה), api.cbs.gov.il"
}

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/>9 tools · 5 resources<br/>zod schemas · isError results"]
  CLI -- "--http" --> H
  H -- "new server per request<br/>shared CbsClient" --> S
  S --> CBS
  subgraph L["src/lib — no MCP imports"]
    CBS["cbs.ts<br/>injectable fetch · retries · paging<br/>history · compare · calculator"]
    CACHE["cache.ts<br/>TTL · in-flight dedupe"]
    LINK["linkage.ts<br/>chain-linking · rebasing · index floor"]
    CAT["catalog.ts<br/>EN+HE tree merge · search"]
    MON["months.ts<br/>known index · MM-DD-YYYY · Asia/Jerusalem"]
    CBS --> CACHE
    CBS --> LINK
    CBS --> CAT
    CBS --> MON
  end
  CBS -- "HTTPS · JSON" --> API["api.cbs.gov.il/index<br/>catalog/tree · data/price · data/calculator"]
  APP["Your TS app"] -- import --> L

How the data is fetched

Need

CBS API request

Catalog (chapters → subjects → codes)

catalog/tree?lang=en + lang=he, cached 12 h

Latest values

data/price?id=120010&last=13&coef=true

History / comparison

data/price?id=120010,120450,…&startPeriod=01-2023&endPeriod=10-2026&coef=true&PageSize=1000 (paging followed)

CPI summary

data/price?id=<15 codes>&last=1 — one request

Known-index linkage

data/calculator/120010?value=100&date=01-01-2020&toDate=01-01-2026 (dates are MM-DD-YYYY)

Payment schedule

data/price?id=120010&startPeriod=04-2025&coef=true&PageSize=1000 — one request from the base month to the latest index; every payment is linked locally

Layout

src/
  lib/cbs.ts       injectable-fetch client: retries, paging, series parsing, history, compare, CPI summary, calculator
  lib/linkage.ts   chain-linking across base changes, rebasing to the latest base, base-change and scale-break detection, index floor
  lib/annual.ts    year-by-year tables: Dec/Dec, annual average, year-to-date, inflation-target check
  lib/schedule.ts  linked payment schedules: payment dates (month-end safe), known index per payment, floor, totals
  lib/catalog.ts   merges the English and Hebrew catalog trees; bilingual search with aliases and niqqud-insensitive matching
  lib/months.ts    YYYY-MM / MM-YYYY / MM-DD-YYYY formats, known-index rule, publication dates, Israeli "today"
  lib/featured.ts  hand-picked index codes and the CPI summary basket
  lib/cache.ts     promise-based TTL cache with in-flight de-duplication
  server.ts        MCP tools, resources and the resource template (zod schemas)
  http.ts          stateless Streamable HTTP transport (node:http, no framework)
  cli.ts           entry: stdio by default, --http for hosted mode
  version.ts       single source of the version
scripts/
  record-fixtures.mjs  re-records every fixture from the live API and prints a live check of each tool
test/
  scenarios.mjs    the live calls whose responses are recorded (shared by the recorder and the tests)
  fixtures/        real CBS API responses recorded on 2026-11-22, 2026-11-23 and 2026-11-28
  *.test.ts        106 vitest tests; fetch replays the fixtures, so CI never hits the network

Development

npm test                  # vitest, replaying recorded CBS responses (no network)
npm run typecheck
npm run build
npm run record-fixtures   # refresh fixtures from the live API (then update expected numbers)

Attribution

This is an unofficial client. All index data comes from the Israel Central Bureau of Statistics and is subject to its terms of use. Linkage results are informational; for legal or financial disputes rely on the official CBS publications and calculator. This project has no affiliation with the CBS.

Roadmap

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

  • Average dwelling prices by district and number of rooms

  • Quarterly producer-price and services indices in compare_indices

  • Exact publication calendar for the known-index rule when the 15th falls on a weekend or holiday

  • Linked payment schedules with known-index linkage, totals and estimates for future payments (v0.3.0)

  • Year-by-year inflation tables with the BOI target check; 1985 rescale repaired (v0.2.0)

  • Chain-linked history and comparison across base changes (v0.1.0)

  • Official-calculator cross-check for known-index linkage (v0.1.0)

Contributing

Issues and PRs are welcome. Keep API logic in src/lib with unit tests and add an end-to-end case in test/server.test.ts for new tools. New fixtures must be real recorded responses (npm run record-fixtures) — never hand-written API data.

License

MIT © Nadav Shtibel

Available Tools

9 tools
calculate_linked_amountIndex-linkage calculator (הצמדה למדד)A

Adjust an amount by a CBS index between two points in time, e.g. rent, alimony, a contractor payment or a loan balance linked to the CPI or to the residential building inputs index (200010). Two methods: (1) from_month/to_month — the actual index of those months (מדד בגין), computed from published values and CBS chaining coefficients, in either direction; (2) from_date/to_date — the index known on each date (המדד הידוע: month M is known from the 16th of M+1), via the official CBS calculator. no_decrease keeps the original amount when the index fell (a common contract floor). Returns the linked amount, factor, change_pct, both index values with bases and the chaining coefficient.

Inputs: amount (required), code, to_date, to_month, +3 more.

calculate_linked_scheduleLinked payment schedule (לוח תשלומים צמוד מדד)A

Build an index-linked payment schedule: payments payments of amount every interval_months from start_date — monthly rent, quarterly instalments to a contractor linked to the residential building inputs index (200010), alimony, a linked loan — each adjusted from one base index to the index known on its payment date (המדד הידוע: month M is known from the 16th of M+1), chain-linked across CBS base changes. The base is either base_month (the base index month written in the contract) or base_date (e.g. the signing date: the index known on it). Returns every payment with its index month and value, factor, linked amount and linkage differential (הפרשי הצמדה), plus totals; payments whose index is not published yet are marked estimated and use the latest published index. no_decrease applies a contract-style floor at the base amount. One API request.

Inputs: amount (required), payments (required), start_date (required), code, +4 more.

compare_indicesCompare CBS indices over a periodA

Compare how up to 12 monthly CBS indices changed between two months (chain-linked, so base changes are handled), ranked from fastest to slowest rising, with annualized rates for periods of a year or more. Defaults to the CPI and its 10 main consumption groups. Codes without data for both months are listed under missing.

Inputs: start_month (required), codes, end_month.

get_annual_changesAnnual inflation by year (שיעור אינפלציה שנתי)A

Year-by-year change of a CBS index, e.g. Israel's annual inflation rate for each of the last 10 years. For every year: December-over-December change (Q4-over-Q4 for quarterly series; year-to-date through the latest month for the current year), the 12-month change exactly as published by CBS, and the change of the annual average. Chain-linked across base changes. Summary: cumulative and average annual change, highest and lowest year. For the headline CPI (120010) each year is also checked against the Bank of Israel 1%-3% target range. Works for any index, e.g. 40010 home prices or 200010 residential building inputs.

Inputs: code, end_year, start_year.

get_cpi_summaryIsraeli CPI summary (latest month)A

One-call snapshot of the latest Israeli Consumer Price Index (מדד המחירים לצרכן): headline value, monthly and 12-month inflation, core measures (excluding fruit/vegetables/housing, excluding energy) and the main consumption groups (food, housing, transport, health...), with the fastest-rising and falling groups year over year.

Inputs: no named parameters.

get_index_historyCBS index history (chain-linked)A

Monthly (or quarterly) history of a CBS index between two months. Every observation is returned as published plus a rebased_value on the latest base, giving one continuous series across CBS base changes. Also returns the chain-linked change_pct, annualized_pct, min/max and the base changes (with chaining coefficients) inside the range. Up to 360 observations are listed; statistics always cover the full range.

Inputs: start_month (required), code, end_month.

get_latest_indexLatest value of a CBS indexA

Get the latest published value of a CBS price index with its base (e.g. 'Average 2024'), the monthly and 12-month percent change as published, the approximate publication date (CBS publishes month M on the 15th of M+1 at 18:30) and the most recent observations. change_over_window_pct is chain-linked, so it stays correct across base changes.

Inputs: code, periods.

list_chaptersList CBS price-index chaptersA

List the chapters of the Israel Central Bureau of Statistics price-index catalog (consumer prices, housing, producer prices, construction/road/agriculture/bus input prices...) with English and Hebrew names, each chapter's main index code and its subjects with index counts.

Inputs: no named parameters.

search_indicesSearch CBS price indicesA

Search ~1,350 CBS price indices by English or Hebrew text (e.g. 'rent', 'שכר דירה', 'electricity', 'תשומות בנייה', 'cpi') or by numeric code. Returns codes with English/Hebrew names, chapter and subject, frequency (monthly/quarterly), first month with data and whether the series is still published. Discontinued series are hidden unless include_inactive is true.

Inputs: query (required), limit, chapter, include_inactive.

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 9 tools

    Disambiguation4/5

    Most tools target clearly distinct operations: catalog browsing (list_chapters, search_indices), single-index retrieval (get_latest_index, get_index_history, get_annual_changes), cross-index comparison (compare_indices), and linkage math (calculate_linked_amount, calculate_linked_schedule). There is some overlap between get_cpi_summary and get_latest_index/compare_indices when the headline CPI is the subject, but descriptions steer the agent adequately.

    Naming Consistency5/5

    Every tool follows a consistent snake_case verb_noun pattern (get_*, list_*, search_*, compare_*, calculate_*). The verb choices are semantically meaningful and uniform across the set, with no style mixing.

    Tool Count5/5

    Nine tools is well-scoped for a price-index API: browsing, retrieval, comparison, and two calculation helpers. Each tool covers a distinct capability and none feels redundant or padding.

    Completeness4/5

    The surface covers discovery, history, latest values, annual/comparative views, and index-linked payment calculations, including CBS base-change chaining — a strong lifecycle for the domain. Minor gaps exist: there is no direct 'get metadata for a specific code' tool (search_indices must be used), and no explicit seasonal-adjustment or weights/exclusions view beyond the fixed CPI summary measures.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    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
      C
      maintenance
      Enables access to Israel Central Bureau of Statistics (CBS) data through natural language queries via the Pipeworx MCP gateway.
      54 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to query official Brazilian Central Bank economic data, including Selic, CDI, IPCA, IGP-M, INCC, exchange rates, and Focus projections, and to correct values for inflation or calculate returns by CDI/Selic percentages.
      MIT