Post

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.

From Home Assistant to AI Agents: The eSolat MCP Story πŸ•Œ

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.

mcp


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:

ToolWhat it does
get_monthly_prayer_timesFull 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_mosquesUp 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_eventsMajor 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 πŸŒ™

This post is licensed under CC BY 4.0 by the author.