Skip to main content
Glama
plainfold-calendars-mcp

plainfold-calendars-mcp

Official
by plainfoldhq

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:

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.

Related MCP server: marketcal

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 = 0 returns the date if it is a business day, otherwise the next one. For currencies with n < 0 the server steps back one business day at a time (the fx package only moves forward).

  • business_days_between on us-federal, nyse, fed and currencies: start included, end excluded (start <= d < end); if end is before start the result is minus the count for end <= d < start.

  • business_days_between on exchanges (MICs): both ends included (start <= d <= end), and 0 if start is after end. This is how exchange-trading-days counts, 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 holidays package (US, XNYS, XFED), plus random add_business_days and business_days_between cases against NumPy busday_offset / busday_count.

  • Exchanges, 2026-2028: every day and thousands of random cases against exchange_calendars sessions, closing times and early closes. One known difference is pinned in the tests: when Dec 24 or Dec 31 falls on a weekend, exchange_calendars moves ASX's 14:10 early close to the Friday before (2028-12-22 and 2028-12-29); exchange-trading-days keeps 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 holidays package 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.

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

Available Tools

8 tools
add_business_daysB
Read-onlyIdempotent

Move date forward (n > 0) or back (n < 0) by n business days (|n| <= 10000). The start date is not counted; n = 0 rolls a non-business day forward.

Inputs: n (required), date (required), calendar (required). Returns: object

business_days_betweenB
Read-onlyIdempotent

Count business days between two dates. Counting convention differs by calendar and is stated in the result (US calendars and currencies: start included, end excluded; exchanges: both included).

Inputs: end (required), start (required), calendar (required). Returns: object

fx_spot_dateB
Read-onlyIdempotent

T+2 spot value date for a currency pair such as EURUSD or USD/JPY (USD, EUR, GBP, JPY, AUD, NZD) and a weekday trade date (YYYY-MM-DD). The result states the convention.

Inputs: pair (required), trade_date (required). Returns: object

holidaysA
Read-onlyIdempotent

List the weekday holidays of calendar in year as {date, name}, plus early closes for NYSE and exchanges.

Inputs: year (required), calendar (required). Returns: object

is_business_dayA
Read-onlyIdempotent

Is date (YYYY-MM-DD) a business/trading day on calendar? Returns the holiday name if closed and the early-close time (HH:MM) for NYSE and exchanges.

Inputs: date (required), calendar (required). Returns: object

list_calendarsA
Read-onlyIdempotent

List every calendar id with its name and covered years: us-federal, nyse, fed, 9 exchange MICs (XNYS, XLON, ...) and 6 currencies (USD, EUR, ...).

Inputs: no named parameters. Returns: object

next_business_dayB
Read-onlyIdempotent

The first business day strictly after date (YYYY-MM-DD) on calendar.

Inputs: date (required), calendar (required). Returns: object

previous_business_dayB
Read-onlyIdempotent

The last business day strictly before date (YYYY-MM-DD) on calendar.

Inputs: date (required), calendar (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools target clearly distinct operations: directional helpers (previous/next_business_day), range math (add_business_days, business_days_between), lookups (is_business_day, holidays, list_calendars), and the specialized fx_spot_date. The only mild overlap is that add_business_days with n=±1 approximates next/previous_business_day, and both counting tools involve date arithmetic, but the descriptions make the boundaries readable.

    Naming Consistency4/5

    All names are snake_case and readable, with a largely predictable verb/noun shape (list_calendars, add_business_days, is_business_day, business_days_between). Minor deviations: `holidays` is a bare noun with no verb prefix (cf. list_holidays), and fx_spot_date is noun-only, but overall style is coherent.

    Tool Count5/5

    Eight tools is well within the ideal range and each one earns its place covering a distinct piece of calendar/business-day logic. There is no obvious redundancy or filler.

    Completeness4/5

    The surface covers checks, forward/backward rolls, counting, holiday enumeration, calendar discovery, and FX spot dating, so core workflows are closed. Gaps: no date-rolling convention tool (following / modified following / preceding), no business-day sequence generation, and settlement conventions are limited to T+2 spot.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Provides deterministic business-day calculations for AI agents, correctly handling country-specific weekends and public holidays.
      6
      65 npm
      1
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Provides correct trading day and settlement date calculations for multiple exchanges, with no external API calls.
      6
      7 npm
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to perform Japanese business calendar calculations including holiday detection, business day arithmetic, payment date settlement, and deadline management using local data.
      6
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to calculate business days and public holidays for 29 countries, including adding business days, counting business days between dates, checking whether a date is a business day, and listing holidays and supported countries.
      MIT