- Home
- MCP servers
- Weather Union
Weather Union
- python
0
GitHub Stars
python
Language
6 months ago
First Indexed
3 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": {
"junaidrahim-weatherunion-mcp": {
"command": "python",
"args": [
"weatherunion_mcp/server.py"
],
"env": {
"WEATHER_UNION_API_KEY": "your-api-key-here"
}
}
}
}Weather Union MCP Server provides real-time weather and air quality data via the Weather Union API. It exposes two practical tools you can call from any MCP client to fetch current weather by coordinates or by major Indian city names, enabling you to build weather-aware assistants, dashboards, or automation flows.
How to use
You run the Weather Union MCP Server locally and connect your MCP client to it. Start by providing your Weather Union API key as an environment variable. Then launch the server so your MCP client can request weather data through the two available tools.
How to install
Prerequisites: you need Python installed on your system.
Set your API key in the environment and start the server using the standard runtime command shown in the example.
export WEATHER_UNION_API_KEY='your-api-key-here'
python weatherunion_mcp/server.py
Optional: to test with HTTP (for development or diagnostics), you can run:
python weatherunion_mcp/server.py --http --port 8000
Additional notes
The server requires a Weather Union API key to authenticate requests. Provide the key as WEATHER_UNION_API_KEY in your environment before starting the server. If the key is missing or invalid, you will see clear errors on startup.
Configuration and tools overview
This MCP server exposes two tools for weather data retrieval.
Tools available
get_current_weather: Retrieve current weather data for a geographic location using latitude and longitude. Returns temperature, humidity, wind, precipitation, and air quality data.
get_weather_for_city: Retrieve weather data for major Indian cities using predefined city names. Accepts city_name (case-insensitive) and an optional country_code (default IN).
Weather data format example
The server returns a formatted block of weather information that includes coordinates, temperature, humidity, wind details, rain, and air quality indices.
Security and keys
Keep your API key private. Do not share your environment variable value publicly. Rotate keys if you suspect any compromise.
Examples of usage (conceptual)
Call get_current_weather with latitude and longitude to obtain current conditions for a specific location.
Call get_weather_for_city with a city name like Bangalore or Mumbai to obtain city-wide weather data.
Available tools
get_current_weather
Fetch current weather data for a given geographic location using latitude and longitude, returning metrics like temperature, humidity, wind, precipitation, and air quality.
get_weather_for_city
Fetch weather data for major Indian cities using predefined city names, with optional country code.