A Model Context Protocol (MCP) server that fetches and parses iCalendar (.ics) files from configured URLs. This server provides easy access to upcoming calendar events through a clean MCP interface.
- 📅 Fetch events from multiple iCal feeds
- ⏰ Get upcoming events within a specified timeframe
- 📆 Functions for weekday scheduling
- 🔄 Real-time calendar updates
- 📝 Detailed event information including location and description
- 🌍 Full timezone support with UTC standardization
- Python 3.7 or higher
- pip (Python package installer)
The server requires the following Python packages:
fastmcp # MCP server framework
httpx # Asynchronous HTTP client
icalendar # iCalendar file parser
python-dateutil # Datetime parsing utilities
pytz # Timezone handling- Clone this repository:
git clone https://github.com/jeromeboivin/iCalReaderMCPServer.git
cd iCalReaderMCPServer- Install the required dependencies:
pip install fastmcp httpx icalendar python-dateutil pytz- Configure your calendars:
cp calendars_config.json.sample calendars_config.json- Edit
calendars_config.jsonwith your calendar URLs:
{
"Personal": "https://calendar.example.com/personal/your-calendar-id.ics",
"Work": "https://calendar.example.com/work/your-work-calendar.ics"
}To run the server in normal mode:
python ical_reader_mcp_server.pyTo run in interactive test mode:
python ical_reader_mcp_server.py --test-
get_calendar_events- Fetches raw event data from specified calendars
- Parameters:
calendar_name(optional): Specific calendar to querydays(optional, default=7): Number of days to look ahead
-
get_formatted_calendar_events- Returns human-readable formatted event listings
- Same parameters as
get_calendar_events
-
get_next_weekday_events- Retrieves events for the next weekday (skipping weekends)
- Parameters:
calendar_name(optional): Specific calendar to query
-
get_week_schedule- Generates a formatted weekly schedule
- Parameters:
calendar_name(optional): Specific calendar to query
-
list_available_calendars- Returns a list of configured calendars and their descriptions
- No parameters required
Each event includes:
- Summary (title)
- Start and end times (in UTC)
- Location (if available)
- Description (if available)
- Calendar source
The server includes an interactive test mode that allows you to test all MCP tools from the command line:
python ical_reader_mcp_server.py --testThis mode provides a menu-driven interface to test each tool with custom parameters.
The server includes robust error handling for:
- Missing configuration files
- Invalid calendar URLs
- Malformed iCal data
- Network connection issues
- Invalid parameter values
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.