Skip to main content
Glama
Sermons MCP Server

Sermons MCP Server

by mailmirza

Sermons MCP Server

Lets an AI assistant browse, search and read Friday khutbas from the UAE General Authority of Islamic Affairs and Endowments (Awqaf), 2015 - to date, through the open JSON API of Sermons by Islamic Network. It is a Model Context Protocol (MCP) server built with FastMCP.

Once connected you can ask things like:

  • "What was the latest khutba about? Give me the main points."

  • "Search the khutbas for anything about Dhul Hijjah, then tell me what the khutba says about the ten days."

  • "List the khutbas from July 2021."

  • "What advice did the khutba on Imam Malik give about seeking knowledge?"

The server has no AI of its own. It fetches the sermon text, and your AI assistant summarizes it and answers your questions from that text.

Answers are generated by an AI from the sermon text. Check the original khutba, and ask a qualified scholar for religious rulings.

Tools

Tool

What it does

get_latest_khutba(language)

Full text of the most recent Friday khutba

list_khutbas(year, month?, khutba_type, source)

Titles, dates and available languages for a year or month. khutba_type is friday or other (Eid, rain prayer and so on)

get_khutba_text(year, month, title, language, khutba_type, source)

Full text of one khutba. title can be a partial match

search_khutbas(keyword, start_year?, end_year?, source)

Searches khutba titles across all years by default

language is en, ar or ur. PDFs are not available in every language for every khutba. When one is missing, the tool says which languages are.

Related MCP server: hadith-mcp

How it works

  1. The API is a set of static JSON files listing each khutba and its files (mp3, doc, pdf) on a CDN.

  2. The server finds the khutba in that index, downloads the PDF, and extracts the text with pypdf.

  3. The text goes back to your AI assistant.

Nothing is stored: no sermon text, PDFs or audio are kept in this repository or on the server.

Quick start

git clone https://github.com/mailmirza/sermons-mcp-server.git
cd sermons-mcp-server
python -m venv venv
source venv/bin/activate         # Windows PowerShell: .\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python server.py                 # stdio mode: it waits for an MCP client

Test it with the MCP Inspector. Let the Inspector launch the server, and do not type into the server's own terminal:

npx @modelcontextprotocol/inspector python server.py

Use it from an MCP client

Local (stdio). For Claude Desktop, add this to claude_desktop_config.json (use full paths; on Windows use venv\\Scripts\\python.exe with double backslashes):

{
  "mcpServers": {
    "sermons": {
      "command": "/full/path/to/venv/bin/python",
      "args": ["/full/path/to/sermons-mcp-server/server.py"]
    }
  }
}

Over the network (HTTP). Run with MCP_TRANSPORT=http. Claude's custom connector dialog expects an https:// URL, so put the server behind a reverse proxy with a certificate. See docs/deployment.md. Please deploy your own copy rather than pointing many people at one.

Configuration

Variable

Meaning

MCP_TRANSPORT

stdio (default) or http

MCP_HOST

Bind address for HTTP, default 127.0.0.1

MCP_PORT

HTTP port, default 8002

Limits

  • search_khutbas matches titles only. Searching inside sermon text would mean downloading every PDF.

  • Each search makes one request per year, so a full-archive search is about a dozen requests.

  • The only source today is UAE Awqaf. The API has no data for 2017.

  • PDF text extraction is imperfect, especially for Arabic with diacritics and mixed Arabic and English text. The English text read cleanly in testing.

Lessons learned

  1. The same API returns different JSON shapes. A month is {"sermons": [...]}, but a year is a list of per-month batches: [{"sermons": [...]}, {"sermons": [...]}, ...]. Parsing it as one flat list silently returned nothing. Look at real responses before writing parsing code.

  2. stdio and print() do not mix. stdout carries the protocol; print to sys.stderr and never type into the terminal of a running stdio server. Inspector shows stderr in its Console panel.

  3. Docstrings are instructions. FastMCP turns them into the schema the model reads.

  4. Isolate bugs with a tiny script. A 20-line standalone script that fetched one year and printed the titles found the parsing bug faster than debugging through the MCP layer.

  5. Windows notes. The command is python, not python3. If Activate.ps1 is blocked, run Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned.

Data attribution

Sermon data comes from the open API of Sermons by Islamic Network, and the PDFs from its CDN. The khutbas are published by the General Authority of Islamic Affairs and Endowments (UAE), and copyright remains with the source.

  • This project is not affiliated with or endorsed by Islamic Network or the UAE Awqaf.

  • Keep attribution if you build on it, check the API's terms, and be considerate with request volume.

License

The code is MIT. The sermons themselves are not covered by it.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides AI assistants with comprehensive access to Islamic resources including Quran verses with translations, Tafsir commentary, Hadith collections, and audio recitations. Enables users to explore Islamic texts, get daily inspiration, and access scholarly interpretations through natural language queries.
      18
      29 npm
      10
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables fetching and searching canonical hadith texts (Arabic and English) with cross-references and citation-safe URLs for assistants, built on FastMCP.
      3
      GPL 3.0
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to retrieve canonical Quran text, translations, scholarly tafsir, full-text search, and word-level morphology from verified Quran data.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables an assistant to retrieve Quranic verses in Uthmani Arabic with any of hundreds of translations, look up and search ten major hadith collections, and compute prayer times offline from the sun's position. Every quotation comes back with its exact reference so answers can be verified rather than paraphrased from memory.
      7
      MIT