A Model Context Protocol (MCP) server for holiday data, built with FastMCP and the MCP framework. This server provides holiday-related tools that can be used by AI assistants to retrieve public holidays for different countries and years using the Calendarific API.
- Global Holiday Data: Access public holidays for 230+ countries and regions
- Multi-Year Support: Retrieve holidays for any year (past, present, or future)
- Detailed Information: Get holiday names, dates, and additional metadata
- MCP Protocol: Native Model Context Protocol support for AI assistants
- FastMCP Framework: Built on modern, high-performance MCP implementation
- Cross-Platform: Works on Windows, macOS, and Linux
- ISO Standard: Uses ISO 3166-1 alpha-2 country codes (US, GB, IL, etc.)
- Real-Time API: Always up-to-date holiday information via Calendarific API
- Error Handling: Robust error management for API issues and invalid inputs
- Python 3.13+
- uv package manager
- Calendarific API key
-
Clone this repository:
git clone https://github.com/yourusername/calendarific-mcp-server.git cd calendarific-mcp-server -
Install dependencies using uv:
uv venv uv pip install -e . -
Create a
.envfile in the project root with your Calendarific API key:CALENDARIFIC_API_KEY=your_api_key_here
Run the server:
python main.pyThe server will start and connect via stdio transport for MCP communication.
Get a list of public holidays for a specific country and year.
Parameters:
country(str): ISO 3166-1 alpha-2 country code (e.g., "US", "GB", "IL")year(int): Year to get holidays for
Returns:
- List of holidays in format: "YYYY-MM-DD: Holiday Name"
Example:
# Get US holidays for 2024
holidays = await get_public_holidays("US", 2024)
# Returns: ["2024-01-01: New Year's Day", "2024-07-04: Independence Day", ...]- Sign up for a free account at Calendarific
- Get your API key from the dashboard
- Add it to your
.envfile asCALENDARIFIC_API_KEY
The server supports all countries available in the Calendarific API. Use ISO 3166-1 alpha-2 country codes:
- US (United States)
- GB (United Kingdom)
- IL (Israel)
- CA (Canada)
- AU (Australia)
- And many more...
The server includes comprehensive error handling:
- Invalid API key errors
- Network connectivity issues
- Invalid country codes
- API rate limiting
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Check the Calendarific API documentation
- Open an issue on GitHub
- Review the MCP documentation