Malaysian Weather

Provides real-time Malaysian weather data from MET Malaysia and two MCP tools for weather queries.
  • python

0

GitHub Stars

python

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "zhenkai-dev-weather-by-met": {
      "command": "python",
      "args": [
        "/path/to/weather-by-met/server.py"
      ],
      "env": {
        "DB_HOST": "localhost",
        "DB_NAME": "weather_by_met",
        "DB_USER": "root",
        "DB_PASSWORD": "your_mysql_password",
        "TELEGRAM_CHAT_ID": "123456789",
        "TELEGRAM_BOT_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}

You run a local MCP server that fetches Malaysian weather data from MET Malaysia and exposes it to any MCP-compatible client. This lets your AI assistant answer weather questions with real-time forecasts for locations across Malaysia, all without relying on external cloud services.

How to use

Start by running the local weather MCP server on your machine and connecting your MCP client (such as Claude Desktop, Cursor IDE, or Cline) through a local configuration. The server fetches fresh MET Malaysia forecasts every 15 minutes, stores them in a MySQL database, and exposes two tools your AI can call to retrieve today’s weather and a 7-day forecast for Malaysian locations.

How to install

Prerequisites: install Python 3.8 or newer and MySQL 8.0 or newer. You also need an MCP client and Git.

Steps to get up and running locally.

# Step 1: Clone the project
git clone https://github.com/zhenkai-dev/weather-by-met.git
cd weather-by-met

# Step 2: Install Python dependencies
pip install -r requirements.txt

# Step 3: Set up the MySQL database
cp .env.example .env
# Edit .env to set DB_HOST, DB_USER, DB_PASSWORD, DB_NAME

# Step 4: Initialize the database
python init_db.py

# Step 5: Start the scheduler (keep this running in a terminal)
python scheduler.py

# The scheduler will fetch data immediately and then every 15 minutes

Configuration and usage notes

You configure a local MCP client to run the server script with the proper environment variables. The examples below show how to connect Claude Desktop, Cursor IDE, and Cline VSCode extension to the local MCP server.

{
  "mcpServers": {
    "weather_met": {
      "command": "python",
      "args": ["/path/to/weather-by-met/server.py"],
      "env": {
        "DB_HOST": "localhost",
        "DB_USER": "root",
        "DB_PASSWORD": "your_mysql_password",
        "DB_NAME": "weather_by_met"
      }
    }
  }
}

Service and data flow notes

  • The server updates MET Malaysia forecasts every 15 minutes via the internal scheduler. - Forecast data is stored in a local MySQL database with automatic cleanup of old records. - You can request today’s weather or a 7-day forecast for any Malaysian location. - The server provides data in Malay, suitable for direct presentation by your AI assistant.

Testing and validation

Verify the setup by validating that the scheduler and server run without errors and that your MCP client can query the two tools.

# Optional: re-check database setup
python init_db.py

# Run server directly for quick test
python server.py

# In separate terminal, run the scheduler to fetch data
python scheduler.py

Available tools

check_weather_today

Fetches today’s weather forecast for a specified location and returns Malay forecasts for morning, afternoon, and night, including today’s day of the week.

check_7day_forecast

Returns a forecast for a custom timeframe or a specific day for Malaysian locations, with two modes: timeframe-based (1–7 days starting today) or specific-day-based (only the requested day).

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational