knesset-mcp
by Shtibel1
README.md
<div align="center">
<img src=".github/banner.svg" alt="knesset-mcp" width="100%"/>
[](https://github.com/Shtibel1/knesset-mcp/actions/workflows/ci.yml)
[](package.json)
[](LICENSE)

[](https://modelcontextprotocol.io)

**The Israeli Knesset for any MCP client: members and factions, bills and where they stand, committee agendas, laws and parliamentary questions.**
</div>
<p align="center"><a href="#quick-start">Quick start</a> · <a href="#tools">Tools</a> · <a href="#live-example">Live example</a> · <a href="#architecture">Architecture</a> · <a href="#roadmap">Roadmap</a></p>
A [Model Context Protocol](https://modelcontextprotocol.io) server that gives AI agents the official, live parliamentary data of the **Israeli Knesset** (הכנסת): who sits in the current Knesset and for which faction, every bill (הצעת חוק) with its legislative status and initiators, what the committees are discussing this week, the register of Israeli laws including the Basic Laws, and the parliamentary questions (שאילתות) put to ministers.
It talks directly to the Knesset's free, public OData service (`knesset.gov.il/OdataV4/ParliamentInfo`): no API key, no scraping. The server hides its quirks (100-row pages, undocumented query-length limits, an HTTP 473 for perfectly valid filters), joins the lookup tables (statuses, ministries, positions, committees, people) for you and returns clean, named JSON.
Part of a small family of Israeli MCP servers: [cbs-mcp](https://github.com/Shtibel1/cbs-mcp) (Central Bureau of Statistics price indices), [boi-mcp](https://github.com/Shtibel1/boi-mcp) (Bank of Israel exchange rates and interest rate), [il-opendata-mcp](https://github.com/Shtibel1/il-opendata-mcp) (data.gov.il datasets) and [hebrew-il-mcp](https://github.com/Shtibel1/hebrew-il-mcp) (ID, phone, VAT, IBAN validators and the Hebrew calendar).
## Tools
| Tool | What it does |
| --- | --- |
| `get_knesset_overview` | One-call snapshot of the current Knesset: term number and start date, seats per faction, bill counts (total, private members' bills, passed their third reading), active committees, committee sessions in the next 7 days and the latest plenum session. |
| `list_factions` | Factions (סיעות) of any Knesset term. For the current Knesset each faction includes its number of members, sorted by seats. `include_former` adds factions that no longer exist. |
| `search_members` | Find members and ministers by Hebrew name — first name, last name or both in any order (`נתניהו`, `בנימין נתניהו`, `נתניהו בנימין`). Returns `person_id`, current faction and current roles (minister, committee chair/member, speaker...). |
| `get_member` | A person's profile: current faction and roles with ministry and committee, every faction and Knesset term served, number of bills initiated and parliamentary questions asked, the five most recently updated bills they initiated and earlier roles. |
| `search_bills` | Bills by Hebrew words in the title, Knesset term, `kind` (`government` / `private` / `committee`), status text (`קריאה ראשונה`), `passed_only` (became law) or `initiator_person_id`. Newest activity first, with status, handling committee and law number. |
| `get_bill` | One bill in full: kind, status, committee, law number, publication details (Reshumot), initiators and co-signers **with names**, and links to the documents. |
| `list_bill_statuses` | Every legislative status a bill can have and its ids, for the `status` filter. |
| `list_committees` | Committees of a Knesset term (standing, special, joint, sub-committees) with type, parent committee and contact email. |
| `get_committee_sessions` | Committee sessions in a date range (default: the next 7 days), earliest first, with committee name, time, location, status and links. `include_items` adds each session's agenda (the bills and topics). Optional `committee_id`. |
| `get_plenum_sessions` | Plenum (מליאה) sessions in a date range, latest first (default: the last 30 days). |
| `search_laws` | The register of Israeli laws by Hebrew words in the name; filter to Basic Laws (חוקי יסוד) or laws in force. Publication date, latest amendment and validity. |
| `search_queries` | Parliamentary questions by subject words, asking member, ministry name (`משרד הבריאות`), status (`נענתה`) and Knesset term. Who asked which ministry, when, and whether and when it was answered. |
### Resources
| URI | Content |
| --- | --- |
| `knesset://overview` | The current Knesset snapshot (same as `get_knesset_overview`) |
| `knesset://factions` | Factions of the current Knesset with seat counts |
| `knesset://committees` | Active committees of the current Knesset |
| `knesset://bill-statuses` | Every legislative status a bill can have |
| `knesset://member/{id}` | Profile of a person by id (same as `get_member`) |
| `knesset://bill/{id}` | Full record of a bill by id (same as `get_bill`) |
Every tool returns human-readable JSON text and `structuredContent`. Bad input (unknown id, malformed date, a status that matches nothing, a range over 62 days) produces an MCP `isError` result with a clear message instead of crashing the session.
## Quick start
### Claude Desktop / Cursor / any MCP client
```json
{
"mcpServers": {
"knesset": {
"command": "npx",
"args": ["-y", "github:Shtibel1/knesset-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:
```bash
npm install && npm run build
node dist/cli.js # speaks MCP over stdio
```
Then ask your agent things like:
- "Which committees meet this week and what bills are on their agenda?"
- "How many seats does each faction have in the current Knesset?"
- "אילו הצעות חוק פרטיות אושרו בוועדה לקריאה ראשונה בכנסת ה-26?"
- "מי יזם את הצעת חוק-יסוד: הממשלה (סייגים לכהונת ראש ממשלה)?"
- "Show the latest parliamentary questions to the Ministry of Health that were answered."
### Hosted: Streamable HTTP
```bash
npx -y github:Shtibel1/knesset-mcp --http --port 3000
# → knesset-mcp listening on http://127.0.0.1:3000/mcp
curl http://127.0.0.1:3000/healthz # {"status":"ok","name":"knesset-mcp","version":"0.1.0"}
```
```json
{ "mcpServers": { "knesset": { "url": "http://127.0.0.1:3000/mcp" } } }
```
| Flag | Env | Default | Notes |
| --- | --- | --- | --- |
| `--http` | | off | Serve [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#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` | `KNESSET_CACHE_TTL` | `300` | Seconds to cache API responses; lookup tables (statuses, ministries, positions, terms) are 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
```bash
docker build -t knesset-mcp .
docker run --rm -p 3000:3000 -e ALLOWED_ORIGINS=https://app.example knesset-mcp
```
The image runs as the unprivileged `node` user and has a `/healthz` health check.
### As a library
```ts
import { KnessetClient } from "knesset-mcp";
const knesset = new KnessetClient({ cacheTtlMs: 60_000 });
const overview = await knesset.getOverview();
const bills = await knesset.searchBills({ query: "חינוך", kind: "private", status: "קריאה ראשונה" });
```
## Live example
Real output from the built server against the live Knesset API, run on **2026-11-29** (Asia/Jerusalem), the 26th Knesset's third week:
| Call | Result |
| --- | --- |
| `get_knesset_overview` | 26th Knesset (since 2026-11-10), **120 members in 11 factions**: Likud 27, Yashar! (Eisenkot) 21, Together (Bennett) 12, Joint List 11 …; 287 bills so far; 15 active committees; **23 committee sessions** in the next 7 days; last plenum session 25 Nov (#8) |
| `search_members { "נתניהו בנימין" }` | `965` בנימין נתניהו — Likud; Prime Minister and Member of Knesset, Prime Minister's Office |
| `get_member { 965 }` | 15 Knessets served (12–26), 18 faction entries, 111 earlier roles |
| `search_bills { kind: private, status: "קריאה ראשונה", knesset_num: 26 }` | 3 bills in the first-reading stage, newest first (e.g. the bill repealing the Attorney-General law amendment, in committee) |
| `get_bill { 2247079 }` | Basic Law: The Government (amendment — limits on a Prime Minister's tenure): private bill #286, status "with the House Committee to assign a committee", 4 initiators named, 2 documents |
| `search_bills { passed_only: true, knesset_num: 25 }` | **573** bills of the 25th Knesset reached a third reading |
| `get_committee_sessions { from_date: "2026-11-29", to_date: "2026-11-29", include_items: true }` | 3 sessions today, with their agendas, e.g. the special committee on the Attorney-General bill (09:00, Interior Committee hall) |
| `search_laws { basic_only: true }` | 19 Basic Laws, newest: חוק-יסוד: לימוד תורה (published 2026-07-15) |
| `search_queries { ministry: "משרד הבריאות", status: "נענתה", knesset_num: 25 }` | 108 answered questions to the Ministry of Health, e.g. on the doctor-to-population ratio (asked 2026-05-13, answered 2026-06-23) |
<details>
<summary>Raw <code>get_bill</code> response (shortened)</summary>
```json
{
"bill_id": 2247079,
"name": "הצעת חוק-יסוד: הממשלה (תיקון - סייגים לכהונת ראש ממשלה)",
"knesset_num": 26,
"kind": "פרטית",
"private_number": 286,
"status_id": 106,
"status": "בוועדת הכנסת לקביעת הוועדה המטפלת",
"passed": false,
"initiators": [{ "person_id": 30121, "name": "עודד פורר" }, "…"],
"documents": [{ "type": "הצעת חוק לדיון מוקדם", "format": "DOC", "url": "https://fs.knesset.gov.il/26/law/…" }]
}
```
</details>
## Architecture
```mermaid
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/>12 tools · 4 resources + 2 templates<br/>zod schemas · isError results"]
CLI -- "--http" --> H
H -- "new server per request<br/>shared KnessetClient" --> S
S --> K
subgraph L["src/lib — no MCP imports"]
K["knesset.ts<br/>injectable fetch · retries · $skip paging<br/>joins lookup tables"]
CACHE["cache.ts<br/>TTL · in-flight dedupe"]
OD["odata.ts<br/>filter builder · in-lists · query-length safe"]
DT["dates.ts<br/>Asia/Jerusalem days · DST offsets"]
K --> CACHE
K --> OD
K --> DT
end
K -- "HTTPS · OData v4 JSON" --> API["knesset.gov.il/OdataV4/ParliamentInfo<br/>KNS_Person · KNS_Bill · KNS_Committee ·<br/>KNS_CommitteeSession · KNS_IsraelLaw · KNS_Query …"]
APP["Your TS app"] -- import --> L
```
### How the data is fetched
| Need | OData entities |
| --- | --- |
| Overview | `KNS_KnessetDates`, `KNS_Faction`, `KNS_PersonToPosition` (faction-member records → seats), `KNS_Bill`, `KNS_Committee`, `KNS_CommitteeSession`, `KNS_PlenumSession` — counts via `$count` |
| Members | `KNS_Person` narrowed by the longest name word, other words matched locally; `KNS_PersonToPosition` + `KNS_Position` for roles; `KNS_BillInitiator` and `KNS_Query` for activity counts |
| Bills | `KNS_Bill` with `contains(Name, …)`, `SubTypeID`, `StatusID in (…)`; `KNS_Status`, `KNS_Committee`, `KNS_BillInitiator`, `KNS_Person`, `KNS_DocumentBill` joined for `get_bill` |
| Sessions | `KNS_CommitteeSession` / `KNS_PlenumSession` with Israeli day boundaries (`+02:00` / `+03:00`), `KNS_CmtSessionItem` for agendas |
| Laws and questions | `KNS_IsraelLaw`; `KNS_Query` with `KNS_GovMinistry`, `KNS_Status` and `KNS_Person` joins |
### Server quirks handled
- Responses are capped at **100 rows**; larger reads follow `$skip`.
- A parenthesised `(contains(...))` is answered with **HTTP 473**, so the filter builder only adds parentheses around `or` expressions.
- Placeholder ids such as `-1` (a bill with no committee) inside an `in (...)` list also give **HTTP 473** and are dropped.
- Query strings over roughly 2 KB give **HTTP 404**, so `in` lists keep commas unescaped and initiator searches are limited to the person's 150 newest bills.
- `+` is not accepted for spaces (`%20` is used), and Israeli day boundaries use the correct UTC offset on either side of daylight-saving time.
### Layout
```
src/
lib/knesset.ts injectable-fetch client: retries, paging, lookup joins, every tool's logic
lib/odata.ts OData filter/query builder (in-lists, contains per word, safe parentheses)
lib/dates.ts Israel "today", DST-aware day boundaries, date validation
lib/cache.ts promise-based TTL cache with in-flight de-duplication
server.ts MCP tools, resources and resource templates (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 each result
test/
scenarios.mjs the live calls whose responses are recorded (shared by the recorder and the tests)
fixtures/ real Knesset API responses recorded on 2026-11-29
*.test.ts 68 vitest tests; fetch replays the fixtures, so CI never hits the network
```
## Development
```bash
npm test # vitest, replaying recorded Knesset 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 data comes from the [Knesset](https://main.knesset.gov.il) open-data service and is subject to its terms of use; the Knesset publishes it as-is, and recent changes may appear with a delay. Bill and law information is informational only; rely on the official Knesset publications (Reshumot) for legal purposes. This project has no affiliation with the Knesset.
## Roadmap
- [ ] Publish to npm so `npx knesset-mcp` works without the GitHub shorthand
- [ ] Plenum votes and attendance
- [ ] Bill history timeline (readings, committee decisions) from the bill-history tables
- [ ] Committee members and chairs per committee
- [x] Members, factions, bills, committees, sessions, laws and questions with Streamable HTTP and Docker (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](LICENSE) © Nadav Shtibel
This server cannot be deployed
Maintenance
ActivityNo data
ResponsivenessNo recent community issues