MCP ExplorerExplorer

Timeircrawler Mcp

@pooya1380mon 9 months ago
2 MIT
FreeCommunity
AI Systems

Overview

What is Timeircrawler Mcp

TimeCrawler is a .NET application that crawls the website time.ir to retrieve current time and date information across Persian (Shamsi), Hijri, and Gregorian calendars, along with events and holidays from the Persian calendar.

Use cases

TimeCrawler can be used to provide accurate time-specific information for applications that require cultural context, support digital assistants in fetching current date details for users, or generate reports based on significant dates and events in the Persian calendar.

How to use

To use TimeCrawler, clone the repository, build the project using the .NET SDK, and run the application. Then, configure the MCP settings in the mcp.json file to integrate with AI assistants. It exposes APIs to get current time data and retrieve events data for the current month.

Key features

Key features of TimeCrawler include the ability to fetch the current time and date in multiple calendar formats, retrieve events and holiday information for the current month, and integrate with AI assistants via a Model Context Protocol (MCP) server, with a fallback mechanism using the system time when web crawling fails.

Where to use

TimeCrawler can be used in applications where multi-calendar date management is essential, such as cultural or regional software, event planners, personal assistants, and educational platforms focusing on Persian culture or history.

Content

TimeCrawler

A .NET application that crawls time.ir to retrieve current time, date information (Shamsi, Hijri, and Gregorian calendars), and events/holidays from the Persian calendar.

Features

  • Retrieves current time data from time.ir:
    • Current time (HH:MM:SS)
    • Current date in Persian/Shamsi calendar
    • Corresponding Hijri date
    • Corresponding Gregorian date
  • Fetches events and holidays for the current month
  • Implements Model Context Protocol (MCP) server for integration with AI assistants
  • Fallback mechanism using system time when web crawling fails

Technology Stack

  • .NET 9.0
  • Selenium WebDriver for web scraping
  • ChromeDriver for headless browser automation
  • Model Context Protocol (MCP) for AI integration
  • Microsoft Extensions for dependency injection and logging

Prerequisites

  • .NET 9.0 SDK
  • Chrome browser (for ChromeDriver)

Getting Started

Installation

  1. Clone the repository:

    git clone [repository-url]
    cd TimeCrawler
    
  2. Build the project:

    dotnet build
    
  3. Run the application:

    dotnet run
    

Configuration

MCP Configuration

To integrate with Model Context Protocol, add the following configuration to your mcp.json file:

Make sure to update the path to the DLL file according to your environment.

API Reference

The application exposes two main API endpoints through the MCP server:

Get Current Time Data

Retrieves the current time and date information in multiple calendar formats.

GetCurrentTimeData()

Returns:

  • CurrentTime: Current time in HH:MM:SS format
  • CurrentDate: Current date in Persian/Shamsi calendar
  • HijriDate: Corresponding date in Hijri calendar
  • GregorianDate: Corresponding date in Gregorian calendar

Get Events Data

Retrieves events and holidays for the current month.

GetEventsDataAsync()

Returns a list of events, each containing:

  • Date: The date of the event
  • Title: The title or description of the event
  • Extra: Additional information (if available)

Architecture

  • Models: Data structures for time and event information
  • Interfaces: Contract for TimeIrCrawler service
  • Services: Implementation of the crawler using Selenium WebDriver
  • Tools: MCP tool definitions for exposing functionality to AI assistants

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers