From Home Assistant to AI Agents: The eSolat MCP Story π
How I turned my Home Assistant prayer time integrations into an MCP server for AI agents β with JAKIM data, mosque finder, and three deployment options.
Assalamualaikum
If youβve been following this blog, you know Iβve been building Islamic tools for Home Assistant for a while now. It started with a simple problem: I wanted my smart home to know when Maghrib is.
The eSolat Journey
That first attempt was HomeAssistantAdzan β a YAML-based automation template that pulled prayer times from JAKIMβs eSolat API and triggered azan on Google Nest speakers. It worked, but it was fragile. One wrong indentation and the whole thing breaks. Classic early HA days.
Over time, this evolved into proper HACS integrations:
- π eSolat Takwim β Islamic calendar and prayer times by state code, sourced directly from JAKIM.
- π eSolat GPS β Prayer times based on your deviceβs GPS location. No need to manually select zone codes.
These tools were built for one ecosystem: Home Assistant. They serve the HA community well and will continue to. But the world has shifted.
AI Agents Are Here
2025-2026 has been the inflection point for AI agents. Not chatbots β agents. Systems that donβt just answer questions, but take actions, call tools, and chain operations together.
Claude can now browse files, run code, and call external APIs. M365 Copilot can execute tasks across your entire Microsoft ecosystem. ChatGPT has plugins and tool use. Cursor and VS Code have AI coding agents that read your codebase and make changes.
The common thread? They all need context. An AI model is only as useful as the data it can access. And the way they access that data is increasingly through MCP.
This is where it clicked for me: the same data Iβve been serving to Home Assistant dashboards β prayer times, mosque locations, Islamic events β is exactly the kind of context AI agents need. The difference is the delivery mechanism.
Home Assistant speaks REST APIs and HACS integrations. AI agents speak MCP.
What is MCP?
Model Context Protocol (MCP) is an open standard introduced by Anthropic in November 2024. The simplest way to explain it: MCP is USB-C for AI.
Before USB-C, every device had a different connector. Before MCP, every AI app needed custom integration code for every tool or data source it wanted to talk to. MCP solves this by providing a single, standardised protocol that lets any AI client β Claude, ChatGPT, M365 Copilot, Cursor β connect to any MCP server and use its tools immediately.
An MCP server exposes tools (functions the AI can call), resources (data it can read), and prompts (templates for workflows). The AI discovers whatβs available and uses them as needed. No custom code on the client side. No vendor lock-in.
As of mid-2026, MCP has surpassed 97 million monthly SDK downloads, over 81,000 GitHub stars, and is supported by every major AI vendor β Anthropic, OpenAI, Google, Microsoft, and AWS. Itβs not hype. Itβs infrastructure.
eSolat MCP
So I built esolat-mcp β an MCP server that gives any AI assistant access to Malaysian prayer times, nearest mosques, and Islamic calendar events.
It exposes three tools:
| Tool | What it does |
|---|---|
get_monthly_prayer_times | Full monthly schedule (Fajr, Syuruk, Dhuha, Dhuhr, Asr, Maghrib, Isha). Accepts place name or coordinates. JAKIM data for Malaysia, Aladhan globally. Dhuha auto-calculated. |
find_nearest_mosques | Up to 15 nearest masjid/surau within configurable radius. Returns distance, coordinates, Google Maps & Waze deep links. Uses JAKIM data for Malaysia, OpenStreetMap globally. |
get_yearly_islamic_events | Major Islamic dates and public holidays for a given year. Malaysia-aware routing with JAKIM data, Aladhan fallback. |
The goal: when someone asks an AI βwhen is Maghrib?β or βfind me the nearest surauβ β it should answer with real, official JAKIM data, not hallucinated guesses.
How to Run It
Option 1: Local (stdio) β One line. Thatβs it.
1
uvx esolat-mcp
Plug it into Claude Desktop or Claude Code:
1
2
3
4
5
6
7
8
{
"mcpServers": {
"esolat": {
"command": "uvx",
"args": ["esolat-mcp"]
}
}
}
Option 2: Docker + Streamable HTTP β Self-hosted, multi-client, token-authenticated.
1
2
3
4
5
git clone https://github.com/zubir2k/esolat-mcp.git
cd esolat-mcp
cp .env.example .env
# Generate and set your MCP_WEBHOOK_TOKEN
docker compose up -d
This mode also makes it compatible with M365 Copilot agents β point your Copilot Studio connector to the Streamable HTTP endpoint and it just works.
Option 3: Cloudflare Workers β No server. No Docker. Runs on the edge, free tier eligible.
1
2
3
4
5
git clone https://github.com/zubir2k/esolat-cfworker.git
cd esolat-cfworker
npm install
wrangler secret put MCP_WEBHOOK_TOKEN
npm run deploy
Three deployment models. Same three tools. Pick whichever suits your setup.
Whatβs Next
eSolat MCP is open source, MIT licensed, and available on PyPI. The HA integrations arenβt going anywhere β they still serve a different audience and a different purpose. But for the AI agent era, MCP is the right delivery mechanism.
If you build something with it β an agent, a workflow, a Copilot extension β Iβd love to hear about it.
π esolat-mcp on GitHub π esolat-cfworker on GitHub π¦ esolat-mcp on PyPI
Selamat Menyambut Maal Hijrah 1448H π