Content
# TimeCrawler
A .NET application that crawls [time.ir](https://www.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:
```json
"simpletime": {
"command": "dotnet",
"args": [
"/path/to/TimeCrawler/TimeIrCrawler/bin/Debug/net9.0/TimeIrCrawler.dll"
],
"label": "Simple Time Provider",
"description": "Gets simple system time"
}
```
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
Connection Info
You Might Also Like
gpt-image-2-6-mcp-server
Use GPT Image 2.6 from Claude, Cursor and VS Code via MCP.
penthera
Open-source security for the apps and AI systems you ship. Check it before...
lazymark
Lazy markdown notes, tasks and a Kanban board in your terminal. With a sleepy sloth.
Corum-Harness
基于 Deepseek-Harness 核心底座打造的桌面版 Agent.继承底坐全部能力。并补全 IDE 相关功能。
wsl-bridge-mcp
一款让agent可以像操作本地Windows文件一样操作wsl的mcp工具
divar-mcp
MCP server for Divar — search, compare and analyze classified ads....