Skip to main content
Glama

Malaysia Prayer Time MCP Server

mcp.cpython-311.pyc4.77 kB
� ��gK � �^�dZddlmZddlZddlmZed��ZdZdZde d e d e e efdzfd �Z d e d e fd �Z e� �� dde de de d e fd���Ze� �� ddedede d e fd���Zedkre�d���dSdS)z Malaysia Prayer Time UVX Plugin.�)�AnyN)�FastMCPzmalaysia-prayer-timezhttps://api.pray.zone/v2/timeszmalaysia-prayer-time/1.0�url�params�returnc��K�tdd�}tj��4�d{V��} |�|||d����d{V��}|���|���cddd���d{V��S#t $r-}dt|��icYd}~cddd���d{V��Sd}~wwxYw#1�d{V��swxYwYdS)z<Make a request to the Prayer API with proper error handling.zapplication/json)z User-Agent�AcceptNg>@)�headersr�timeout�error)� USER_AGENT�httpx� AsyncClient�get�raise_for_status�json� Exception�str)rrr �client�response�es �>/Users/aman/2) personal/mcp-server-malaysia-prayer-time/mcp.py�make_prayer_requestrs�����'�3E�F�F�G�� �"�"�%�%�%�%�%�%�%�f� %�#�Z�Z��W�V�T�(���������H� � %� %� '� '� '��=�=�?�?� %�%�%�%�%�%�%�%�%�%�%�%�%�%��� %� %� %��S��V�V�$� $� $� $� $� $�%�%�%�%�%�%�%�%�%�%�%�%�%�%����� %����%�%�%�%�%�%�%�%�%�%����%�%�%�%�%�%s;�B;�AB� B8� B3�B8�B;�3B8�8B;�; C�C�datac�,�d|vr d|d��S |dddd}d|d�d |d �d |d �d |d�d|d�d|d�d|d�d|d�d|d��S#ttf$rYdSwxYw)z0Format prayer times data into a readable string.r zError fetching prayer times: �results�datetimer�timeszPrayer Times: Imsak: �Imsakz Fajr: �Fajrz Sunrise: �Sunrisez Dhuhr: �Dhuhrz Asr: �Asrz Sunset: �Sunsetz Maghrib: �Maghribz Isha: �Ishaz Midnight: �Midnightz!Unable to parse prayer times data)�KeyError� IndexError)rrs r�format_prayer_timesr*s���$���>�t�G�}�>�>�>� 3��Y�� �+�A�.�w�7�� !� �g�� !� !� �V�}� !� !� � � � !� !� �g�� !� !�  �E�l� !� !� �x�� !� !� � � � !� !� �V�}� !� !� �� � !� !� !�� �j� !�3�3�3�2�2�2�3���s�A,A>�>B�B� kuala lumpur�malaysia�today�city�country�datec��lK�|||d�}tt�d�|���d{V��}t|��S)z�Get prayer times for a specific city in Malaysia. Args: city: Name of the city (default: kuala lumpur) country: Country name (default: malaysia) date: Date in YYYY-MM-DD format or 'today' (default: today) )r.r/r0� /today.jsonN�r�API_BASEr*)r.r/r0rrs r�get_prayer_timesr52sO�����w�� =� =�F�$��%=�%=�%=�v�F�F� F� F� F� F� F� F�D� �t� $� $�$��latitude� longitudec��lK�|||d�}tt�d�|���d{V��}t|��S)z�Get prayer times for a specific location using coordinates. Args: latitude: Latitude of the location longitude: Longitude of the location date: Date in YYYY-MM-DD format or 'today' (default: today) )r7r8r0r2Nr3)r7r8r0rrs r�get_prayer_times_by_coordinatesr:CsO����#��D� I� I�F�$��%=�%=�%=�v�F�F� F� F� F� F� F� F�D� �t� $� $�$r6�__main__�stdio)� transport)r+r,r-)r-)�__doc__�typingrr�mcp.server.fastmcp.serverr�mcpr4r r�dictrr*�toolr5�floatr:�__name__�run�r6r�<module>rHs}��&�&������� � � � �-�-�-�-�-�-��g�$�%�%�� ,�� '� � %�3� %�� %��c�3�h��$�9N� %� %� %� %�3�d�3�s�3�3�3�3�*�����GN� %� %� � %�),� %�AD� %�� %� %� %� �� %� �����3:� %� %�� %� %� %�-0� %�� %� %� %� �� %�  �z����G�G�g�G�������r6

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amanasmuei/mcp-server-malaysia-prayer-time'

If you have feedback or need assistance with the MCP directory API, please join our Discord server