plainfold-calendars-mcp
An MCP (Model Context Protocol) server that answers business-day questions for AI assistants: is a date a trading day, what is the next business day, how many business days between two dates, which holidays fall in a year, and what is the T+2 FX spot date of a currency pair. It runs on your machine over stdio, needs no network and no API key, and is MIT licensed.
It adds no calendar data of its own. It is a thin layer over three verified, dependency-free Plainfold packages, pinned to exact versions:
usbizdays1.0.1: US federal, NYSE and Federal Reserve calendars.exchange-trading-days0.1.1: 9 stock exchanges, with early closes.fx-spot-dates0.1.1: settlement calendars for 6 currencies and T+2 spot dates.
Install
pip install plainfold-calendars-mcp
# or run it without installing:
uvx plainfold-calendars-mcp
Python 3.10 or newer. The server speaks stdio; the console script is plainfold-calendars-mcp (also python -m plainfold_calendars_mcp).
Claude Code
claude mcp add plainfold-calendars -- uvx plainfold-calendars-mcp
Claude Desktop
Add this to claude_desktop_config.json:
{
"mcpServers": {
"plainfold-calendars": {
"command": "uvx",
"args": ["plainfold-calendars-mcp"]
}
}
}
Any other MCP client
Run uvx plainfold-calendars-mcp (or plainfold-calendars-mcp after pip install) as a stdio server. The config shape is the same as above: command plus args.
Calendar ids
One scheme, case-insensitive:
| Id | What | Covered years |
|---|---|---|
us-federal |
US federal holidays (5 U.S.C. 6103), observed dates | 1971-2050 |
nyse |
NYSE trading days incl. early closes and past unscheduled closures (rule-based) | 2000-2050 |
fed |
Federal Reserve Banks (Saturday holidays are not moved) | 2000-2050 |
XNYS XLON XTSE XETR XPAR XTKS XHKG XASX XSWX |
NYSE, London, Toronto, Xetra, Euronext Paris, Tokyo, Hong Kong, ASX, SIX Swiss (ISO 10383 MIC) | 2026-2028 |
USD EUR GBP JPY NZD |
Settlement business days (Fedwire, TARGET2, England and Wales, Japan, New Zealand) | 2026-2028 |
AUD |
New South Wales bank holidays | 2028 only (2026 and 2027 are withheld because the sources disagree on one day each) |
nyse and XNYS are two independent NYSE calendars; use nyse outside 2026-2028. list_calendars returns the live list.
Outside the covered years the tools return an error, never a guess. The error states the covered years and points to the full 2000-2050 data (https://plainfoldhq.github.io/business-days/, /stock-market-holidays/ or /fx-settlement-holidays/).
Tools
All dates are ISO YYYY-MM-DD. Results are plain JSON.
| Tool | Arguments | Returns |
|---|---|---|
list_calendars |
none | every id with name and covered years |
is_business_day |
calendar, date |
business_day, holiday name or null, early_close ("HH:MM", NYSE and exchanges) or null |
add_business_days |
calendar, date, n (|n| <= 10000) |
result, convention |
business_days_between |
calendar, start, end |
count, convention |
next_business_day |
calendar, date |
first business day strictly after date |
previous_business_day |
calendar, date |
last business day strictly before date |
holidays |
calendar, year |
[{date, name}], plus early_closes for nyse and exchanges |
fx_spot_date |
pair (EURUSD or EUR/USD), trade_date |
spot_date, convention |
Counting conventions
These follow the underlying packages and each result repeats its own convention:
add_business_days: the start date is never counted.n = 0returns the date if it is a business day, otherwise the next one. For currencies withn < 0the server steps back one business day at a time (the fx package only moves forward).business_days_betweenonus-federal,nyse,fedand currencies: start included, end excluded (start <= d < end); if end is before start the result is minus the count forend <= d < start.business_days_betweenon exchanges (MICs): both ends included (start <= d <= end), and 0 if start is after end. This is howexchange-trading-dayscounts, and it differs from the US calendars on purpose.- FX spot (T+2): for pairs with USD, day 1 is the next business day of the non-USD currency and day 2 the next day that is a business day in both. For crosses: two business days of both currencies, then forward to the first day that is also a USD business day. Some banks use other rules; confirm with your counterparty.
How it was checked
The test suite (pytest) drives the real server through the MCP SDK client (in memory and over stdio) and checks every tool, every error path and the coverage errors. It also compares answers with implementations that share no code or data with the packages:
- US calendars, 2000-2050 (federal from 1971): every day against the
holidayspackage (US,XNYS,XFED), plus randomadd_business_daysandbusiness_days_betweencases against NumPybusday_offset/busday_count. - Exchanges, 2026-2028: every day and thousands of random cases against
exchange_calendarssessions, closing times and early closes. One known difference is pinned in the tests: when Dec 24 or Dec 31 falls on a weekend,exchange_calendarsmoves ASX's 14:10 early close to the Friday before (2028-12-22 and 2028-12-29);exchange-trading-dayskeeps normal hours on those Fridays, following ASX's 2022 notice that normal hours apply from 2022 on. Check the ASX notice for those dates. - Currencies, 2026-2028: every day against the
holidayspackage and QuantLib, and random add, count and spot-date cases against QuantLib calendars.
The independent checks need Python 3.11 or newer; on 3.10 they are skipped and the server tests still run. Test dependencies are pinned in requirements-test.txt.
Full data (paid)
The server covers what the free packages cover. The full 2000-2050 datasets, as CSV, JSON, SQLite and .ics files, are sold separately. Polar is the merchant of record.
- US federal, NYSE and Fed calendar 1971/2000-2050 ($15)
- World stock exchange holidays and trading hours, 24 exchanges 2000-2050 ($15)
- Currency settlement holidays and FX spot dates 2000-2050 ($19)
- All-Access: every Plainfold data pack, yearly ($49/year)
Limits
Not financial or legal advice. Exchanges can add unscheduled closures and change hours, and future dates follow standing rules. Check the exchange or central bank notice before trading or settlement use. The server never touches the network.
Not affiliated with Anthropic or the MCP project. Plainfold is an AI-run business; this package was written and tested by AI agents.
License
MIT, Copyright (c) 2026 Plainfold. Issues: https://github.com/plainfoldhq/plainfold-calendars-mcp/issues
Metadata
Release files for plainfold-calendars-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plainfold_calendars_mcp-0.1.0.tar.gz | 20.5 kB | Without provenance | Details for plainfold_calendars_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plainfold_calendars_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for plainfold_calendars_mcp-0.1.0-py3-none-any.whl |
Total release size: 33.0 kB
Release files / plainfold_calendars_mcp-0.1.0.tar.gz
| Download URL | plainfold_calendars_mcp-0.1.0.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dce8a7cc9049951d423b4bea3f29787b638720a944af7543034dfec6e1d67d2d
|
|
BLAKE2b-256 checksum How to use checksums |
b79d47c81bc813be1b54a52088db49fee5cee3597e0a9f3b9832308c770d63f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.16
|
Release files / plainfold_calendars_mcp-0.1.0-py3-none-any.whl
| Download URL | plainfold_calendars_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ebb2eb3b1d1f494c7f8963e0ae2695f874ca00b7d10a9113119c2febe8fa7d4
|
|
BLAKE2b-256 checksum How to use checksums |
4648b4f0736cf7bf8ae296404fe83f5a67de428e496b716bae371367e124ee27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.16
|
Security for plainfold-calendars-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.