Skip to main content
Glama
README.md
# Hebcal-MCP

A small MCP server for the Jewish calendar, wrapping the free [Hebcal REST APIs](https://www.hebcal.com/home/developer-apis)
(no API key). Built for voice assistants: every tool returns compact JSON plus a `say` field, one plain spoken
English sentence with times as `HH:MM`, so a small model can answer without reasoning over the data.

The default location is Jerusalem and the default holiday schedule is Israel's; both are settings, nothing in the
code is tied to a place.

## Tools

All tools are read-only (`readOnlyHint: true`, `openWorldHint: true`). Dates are `YYYY-MM-DD`, `today`,
`tomorrow` or `yesterday`; "today" is decided in `HEBCAL_TZ`. `location` is a city name (resolved with Hebcal's
`/complete` city search, first hit) or a [GeoNames](https://www.geonames.org/) id; omitted means `HEBCAL_GEONAMEID`.
On failure a tool returns `{"error": "...", "say": "Sorry, I couldn't get that from Hebcal."}`.

| Tool | Args | Returns |
| --- | --- | --- |
| `zmanim` | `date?`, `location?` | `{date, location, times: {label: "HH:MM"}, say}`: dawn, misheyakir, sunrise, latest shma (MGA, Gra), latest shacharit, chatzot, mincha gedola/ketana, plag, sunset, tzeit (8.5 degrees, 3 stars), tzeit 72 min, chatzot halayla. Local wall-clock at that location. |
| `shabbat_times` | `date?`, `location?` | `{location, candle_lighting: [{date, day, time, for}], havdalah: [{date, day, time}], parsha: {name, hebrew, hdate, torah, haftarah}, holidays?, say}` for the Shabbat/Yom Tov of the week containing `date`. Two-day Yom Tov gives two candle lighting entries. |
| `hebrew_date` | `date?`, `after_sunset=false` | `{date, hebrew: {day, month, year, text, hebrew_text}, parsha, daf_yomi, events, say}`; `parsha` is this week's, `events` are holidays / Omer / Rosh Chodesh that day. |
| `gregorian_date` | `day`, `month`, `year?` | `{hebrew, date, weekday, events, say}`. `month` takes spoken spellings (Iyar, Tammuz, Shevat, Heshvan, Adar I/II...). No `year` = next occurrence from today (Hebrew birthdays, yahrzeits). |
| `holidays` | `start?`, `end?`, `days=60`, `include_minor=true` | `{start, end, count, items: [{date, weekday, name, hdate, kind, end?}], say}`. Holidays, fasts, Rosh Chodesh, modern Israeli days, special Shabbatot. Multi-day festivals (Chanukah, Pesach, Sukkot, Shavuot, Rosh Hashana) and two-day Rosh Chodesh collapse to one item with `end`. `include_minor=false` keeps major holidays and fasts. `say` names the next three. |

Example (`shabbat_times`, 2026-11-27, Jerusalem):

```json
{"location":"Jerusalem, Israel","candle_lighting":[{"date":"2026-11-27","day":"Friday","time":"15:55","for":"Parashat Vayishlach"}],
 "havdalah":[{"date":"2026-11-28","day":"Saturday","time":"17:14"}],
 "parsha":{"name":"Parashat Vayishlach","hebrew":"פרשת וישלח","hdate":"18 Kislev 5787","torah":"Genesis 32:4-36:43","haftarah":"Obadiah 1:1-21"},
 "say":"Candle lighting in Jerusalem is Friday at 15:55 and havdalah Saturday at 17:14. The parsha is Vayishlach."}
```

## Configuration

| Env | Default | |
| --- | --- | --- |
| `HEBCAL_GEONAMEID` | `281184` (Jerusalem) | Default location, a GeoNames id. Others: Tel Aviv `293397`, Haifa `294801`, New York `5128581`. Look one up: `curl 'https://www.hebcal.com/complete?q=<city>'` (`id` field). |
| `HEBCAL_CANDLE_MINUTES` | unset | Candle lighting minutes before sunset (`b`). Unset = Hebcal's per-city default (see below). |
| `HEBCAL_HAVDALAH_MINUTES` | unset | Havdalah minutes after sunset (`m`); unset = Hebcal's 8.5-degree tzeit (`M=on`). |
| `HEBCAL_TZ` | `TZ`, else `Asia/Jerusalem` | Zone that decides what "today" is. Times themselves are always the location's local time. |
| `HEBCAL_ISRAEL` | `on` | `off` for the Diaspora holiday and parsha schedule (`i=off`) in `holidays` and `hebrew_date`. `shabbat_times` follows the location. |
| `CACHE_SECONDS` | `3600` | In-memory cache per Hebcal URL. Hebcal advertises a rate limit of 150 requests / 10 s (`RateLimit-Policy` header). |
| `HOST` / `PORT` | `0.0.0.0` / `8000` | Streamable HTTP, path `/mcp`, stateless, JSON responses |
| `MCP_TRANSPORT` | `streamable-http` | or `stdio` |

Candle lighting minutes, as observed on 2026-11-22 for Friday 2026-11-27 (`/shabbat`, sunset-based):

| Location | `b` omitted | `b=18` | `b=30` |
| --- | --- | --- | --- |
| Jerusalem 281184 | 15:55 (40 min) | 15:55 | 16:05 |
| Tel Aviv 293397 | 16:16 (20 min) | 16:16 | 16:06 |
| Haifa 294801 | 16:04 (30 min) | 16:04 | 16:04 |
| New York 5128581 | 4:12pm (18 min) | 4:12pm | 4:00pm |

So `b=18` is treated as "use the city default", any other value overrides it, Jerusalem included, and Haifa stayed
at 30 whatever `b` was. For Jerusalem's 40-minute custom, leave `HEBCAL_CANDLE_MINUTES` unset.

## Run

```bash
uv sync
uv run hebcal-mcp                                   # http://0.0.0.0:8000/mcp
MCP_TRANSPORT=stdio uv run hebcal-mcp               # for Claude Desktop / Claude Code stdio
docker compose up -d --build                        # 127.0.0.1:8000/mcp
```

Pinned image from a release tag: `build: https://github.com/danielrosehill/Hebcal-MCP.git#v1.0` in compose (the
Dockerfile builds from the repo root).

Claude Code: `claude mcp add hebcal -e MCP_TRANSPORT=stdio -- uvx --from git+https://github.com/danielrosehill/Hebcal-MCP hebcal-mcp`

## Hebcal endpoints used

| Endpoint | Used by | Params |
| --- | --- | --- |
| `GET /zmanim?cfg=json&geonameid=&date=` | `zmanim` | returns ISO times with the location's offset |
| `GET /shabbat?cfg=json&geonameid=&gy=&gm=&gd=&M=on[&b=][&m=]` | `shabbat_times` | Israel schedule for Israeli locations (Hebcal docs, not separately tested) |
| `GET /converter?cfg=json&gy=&gm=&gd=&g2h=1&i=[&gs=on]` | `hebrew_date`, `gregorian_date` | `events` includes the week's parsha (honours `i`), holidays, Omer |
| `GET /converter?cfg=json&hy=&hm=&hd=&h2g=1` | `gregorian_date` | bad month gives HTTP 400 `{"error":"bad monthName: Foo"}` |
| `GET /hebcal?v=1&cfg=json&F=on&start=&end=` | `hebrew_date` | daf yomi (`category: dafyomi`) |
| `GET /hebcal?v=1&cfg=json&maj&min&mod&nx&mf&ss&i&start&end` | `holidays` | |
| `GET /complete?q=` | location lookup | list of `{id, value, ...}`; unknown city returns `{"error":"Not Found"}` |

## Verified

On 2026-11-22, against the live API (Hebcal v1.27.x), through an MCP client over streamable HTTP, both `uv run` and
the Docker image:

- `zmanim()` Jerusalem 2026-11-22: sunrise 06:13, latest shma (Gra) 08:49, chatzot 11:25, sunset 16:37, tzeit 17:08.
- `shabbat_times(date="2026-11-27")` Jerusalem: candles Fri 15:55, havdalah Sat 17:14, Vayishlach. New York: 16:12 / 17:15.
- `shabbat_times(date="2027-10-01")` Jerusalem (Rosh Hashana on Shabbat): candles Fri 17:44 and Sat 18:59, havdalah Sun 18:58.
- `hebrew_date("2026-11-22")`: 12 Kislev 5787, parsha Vayishlach, daf yomi Arachin 5.
- `gregorian_date(25, "Kislev")`: 2026-12-05 (Chanukah day 1); `(14, "adar ii", 5787)`: 2027-03-23 Purim.
- `holidays()` from 2026-11-22: Chanukah 12-04 to 12-12, Rosh Chodesh Tevet 12-10 to 12-11, Asara B'Tevet 12-20...
- Converter `i=on` vs `i=off` on 2022-04-27 gives Kedoshim vs Achrei Mot, so the Israel/Diaspora split works.

Not verified: Diaspora mode end to end, locations outside Israel and the US, polar latitudes (Hebcal may omit
some zmanim; the tool then leaves them out).

## License

MIT