Salaah MCP (Muslim Community Prayer Times) is a service that provides Islamic prayer time calculation. It builds a REST API based on FastAPI and also provides a server compliant with the Model Context Protocol (MCP) for AI assistants to call. The project depends on FastAPI, the MCP Python SDK, islamic_times, and Pydantic.
Main capabilities include:
- Calculate prayer times: calculate prayer times based on a given location and date via the POST /prayer_times endpoint.
- Get Qiblah information: get the Qiblah direction and distance from any location to Mecca.
- Get sun information: get detailed sun position and timing information.
- Get moon information: get detailed moon position and moon phase information.
- Calculate new moon visibility: calculate new moon visibility based on the Yallop criterion via the POST /moon/visibility endpoint.
Supported calculation methods (specified via the method parameter): ISNA (Islamic Society of North America), MWL (Muslim World League), Umm al-Qura (Umm al-Qura University in Mecca), Egyptian (Egyptian General Authority of Survey), Karachi (University of Islamic Sciences, Karachi), Tehran (Institute of Geophysics, University of Tehran), Jafari (Shia Ithna-Ashari Research Institute in Qom).
Usage:
- After cloning the repository and installing uv and dependencies, the API is by default available at http://localhost:8000 .
- The MCP server uses Streamable HTTP transport, with the endpoint located at http://localhost:8000/mcp,不支持旧的 SSE transport.
- By default, the MCP endpoint only accepts requests sent to localhost to prevent DNS rebinding attacks. During deployment, public hostnames must be listed in a comma-separated format via the environment variable SALAAH_ALLOWED_HOSTS, for example SALAAH_ALLOWED_HOSTS=salaah-mcp.fly.dev.
- When used with Claude Desktop, a configuration file claude_desktop_config.json needs to be created. Since Claude Desktop starts a local server, mcp-remote is needed to bridge to the HTTP endpoint. Ensure the MCP service is running, then start Claude Desktop, and you can ask about prayer times in natural language, for example "When is Asr today?" "When is Fajr in Johannesburg tomorrow?" "Show all prayer times in London." The AI will use the MCP service to calculate accurate prayer times based on the query.
Applicable scenarios: developers who need to integrate prayer time calculation functionality into applications, or users who want to quickly query prayer times through an AI assistant.
Limitations: The material does not provide specific installation command details, request/response examples, pricing information, or platform compatibility notes; this content is not yet available.