PKG-INFO•9.01 kB
Metadata-Version: 2.4
Name: malaysia-prayer-time
Version: 0.2.0
Summary: Malaysia Prayer Time MCP Server for Claude Desktop
Author-email: Your Name <your-email@example.com>
Project-URL: Homepage, https://github.com/yourusername/mcp-server-malaysia-prayer-time
Project-URL: Bug Tracker, https://github.com/yourusername/mcp-server-malaysia-prayer-time/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic<3.0.0,>=2.0.0
Requires-Dist: PyYAML<7.0,>=6.0
Requires-Dist: mcp>=1.2.0
Requires-Dist: mcp[cli]>=1.2.0
Dynamic: license-file
<div align="center">
<img src="public/images/banner.svg" alt="Malaysia Prayer Time MCP Server" width="800">
</div>
# Malaysia Prayer Time MCP Server
An MCP (Model Context Protocol) server that provides access to Malaysia Prayer Time data using the API from [github.com/mptwaktusolat/api-waktusolat](https://github.com/mptwaktusolat/api-waktusolat).
## Features
- Get prayer times for specific zones in Malaysia
- List all available prayer time zones
- Get current prayer time status for a zone
## Prerequisites
1. Install Python 3.8 or higher
2. Create and activate a virtual environment:
```bash
# Create virtual environment
python3 -m venv .venv
# Activate it
source .venv/bin/activate
```
3. Install UVX v1 (required for macOS compatibility):
```bash
# Upgrade pip first
python3 -m pip install --upgrade pip
# Install uvx version 1.x specifically
python3 -m pip install "uvx<2.0.0"
# Verify installation path
which uvx
# Should show path in your virtual environment like: .venv/bin/uvx
```
4. If `which uvx` doesn't show the correct path or you get "command not found":
```bash
# Try installing again with these flags
python3 -m pip install --force-reinstall --no-cache-dir "uvx<2.0.0"
# If still not working, try installing in the user directory
python3 -m pip install --user "uvx<2.0.0"
```
## Installation
### Option 1: Install as UVX Plugin (Recommended for Claude Desktop)
1. Make sure you're in your virtual environment:
```bash
# Should show (.venv) at the start of your prompt
# If not, activate it:
source .venv/bin/activate
```
2. Install the plugin:
```bash
python3 -m pip install git+https://github.com/amanasmuei/mcp-server-malaysia-prayer-time.git
```
3. Configure Claude Desktop:
```bash
# Create the Claude config directory
mkdir -p ~/Library/Application\ Support/Claude
# Get the full path to uvx
UVX_PATH=$(which uvx)
if [ -z "$UVX_PATH" ]; then
echo "Error: uvx not found in PATH"
exit 1
fi
# Create or edit the config file with the full path
cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json << EOF
{
"mcpServers": {
"waktu-solat": {
"command": "${UVX_PATH}",
"args": ["run", "malaysia-prayer-time"],
"env": {
"PYTHONPATH": "$(pwd)",
"PATH": "${PATH}:${HOME}/.venv/bin:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
EOF
```
4. Verify the configuration:
```bash
# Check if config file exists and is valid JSON
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | python3 -m json.tool
# Verify uvx is accessible
$UVX_PATH --version
```
5. Restart Claude Desktop to load the plugin.
Note: If you still get the ENOENT error, try these troubleshooting steps:
1. Verify UVX installation in your virtual environment:
```bash
# Make sure you're in your virtual environment
source .venv/bin/activate
# Reinstall UVX
pip uninstall uvx -y
pip install --no-cache-dir "uvx<2.0.0"
# Verify installation
which uvx
uvx --version
```
2. If UVX is still not found, try installing it globally:
```bash
deactivate # Exit virtual environment
python3 -m pip install --user "uvx<2.0.0"
```
3. Update the Claude Desktop config with the correct path:
```bash
# Find all uvx executables
find ~ -name uvx 2>/dev/null
# Use the full path in the config
```
Note: While the plugin is automatically registered with UVX after installation, Claude Desktop currently requires manual configuration to use UVX plugins.
If you don't see the process running:
1. Check Claude Desktop logs for any errors
2. Verify that the configuration in `~/Library/Application Support/Claude/claude_desktop_config.json` is correct and properly formatted
3. Try restarting Claude Desktop
4. Ensure the plugin is properly installed by running the verification commands above
5. If you see "spawn uvx ENOENT" error:
- Make sure UVX is installed correctly (see Prerequisites section)
- If not using a virtual environment:
- Run `which uvx` to verify it's in your PATH
- If not found, add Python user bin to PATH as described in Prerequisites
- If using a virtual environment:
- Make sure your virtual environment is activated
- Run `which uvx` to verify it's available
- Restart your terminal and Claude Desktop
### Option 2: Install as MCP Server
1. Create a virtual environment and install dependencies using uv:
```bash
uv venv
source .venv/bin/activate
uv pip install -e .
```
2. Make the server executable:
```bash
chmod +x bin/mcp-server-waktu-solat
```
### Verifying Installation
To check if the plugin is properly installed:
1. Check if the plugin is installed in your Python environment:
```bash
pip list | grep malaysia-prayer-time
```
2. Check if the UVX plugin is registered:
```bash
uvx list-plugins
```
3. Check if the server process is running:
```bash
# For UVX Plugin
ps aux | grep waktu_solat.mcp_server
```
You should see a process running with `python -m waktu_solat.mcp_server`
4. For MCP Server:
```bash
ps aux | grep mcp-server-waktu-solat
```
You should see a process running with the server script path
If you don't see the process running:
1. Check Claude Desktop logs for any errors
2. Verify that the configuration in `~/Library/Application Support/Claude/claude_desktop_config.json` is correct and properly formatted
3. Try restarting Claude Desktop
4. Ensure the plugin is properly installed by running the verification commands above
### Stopping the Server
To stop the server process:
1. Find the process ID (PID):
```bash
# For UVX Plugin
ps aux | grep waktu_solat.mcp_server | grep -v grep | awk '{print $2}'
# For MCP Server
ps aux | grep mcp-server-waktu-solat | grep -v grep | awk '{print $2}'
```
2. Stop the process:
```bash
# Replace <PID> with the process ID from step 1
kill <PID>
```
Alternatively, you can use a single command:
```bash
# For UVX Plugin
pkill -f waktu_solat.mcp_server
# For MCP Server
pkill -f mcp-server-waktu-solat
```
Note: The server will automatically restart when you open Claude Desktop again unless you remove the configuration from `claude_desktop_config.json`.
## Usage
### Running with Claude Desktop as UVX Plugin
After installing the plugin and configuring Claude Desktop as described in the installation section, you can access the tools directly through Claude.
Example prompts:
- "What are the prayer times for KUL01 zone in Malaysia?"
- "List all available prayer time zones in Malaysia"
- "What is the current prayer time for SGR01 zone?"
### Running in Claude Desktop as MCP Server
1. Add the following configuration to `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"waktu-solat": {
"command": "uvx",
"args": ["run", "/absolute/path/to/bin/mcp-server-waktu-solat"],
"env": {}
}
}
}
```
Replace `/absolute/path/to/` with the actual path where you cloned this repository.
2. Restart Claude Desktop to load the new MCP server.
### Available Tools
The server implements the following tools:
### get_prayer_times
Get prayer times for a specific zone in Malaysia
- Input: `zone` (string) - The zone code (e.g., 'SGR01', 'KUL01')
### list_zones
List all available prayer time zones in Malaysia
- No input required
### get_current_prayer
Get the current prayer time status for a specific zone
- Input: `zone` (string) - The zone code (e.g., 'SGR01', 'KUL01')
## Development
1. Clone the repository
2. Install development dependencies:
```bash
uv venv
source .venv/bin/activate
uv pip install -e .
```
3. Run the server:
```bash
./bin/mcp-server-waktu-solat
```
4. To test the UVX plugin during development:
```bash
# The plugin is located in src/uvx_plugin.py
uvx run src/uvx_plugin.py
```
Note: The UVX plugin implementation is in `src/uvx_plugin.py`. This is the main implementation with full API integration, caching, and proper error handling.
## License
See [LICENSE](LICENSE) file.