Skip to main content

Weather Union MCP Server

A Model Context Protocol (MCP) server that provides weather data and air quality information using the Weather Union API.

This server offers real-time weather data for specific coordinates or predefined Indian cities.

Usage with MCP Clients

Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "weather-union": {
      "command": "uvx",
      "args": ["weatherunion-mcp"],
      "env": {
        "WEATHER_UNION_API_KEY": "your-api-key-here"
      }
    }
  }
}

Other MCP Clients

The server follows standard MCP protocol and works with any compliant MCP client.

Quick Start

  1. Set up your API key:

    export WEATHER_UNION_API_KEY='your-api-key-here'
    
  2. Run the server:

    # For MCP clients (default - uses stdin)
    python weatherunion_mcp/server.py
    
    # For testing with HTTP
    python weatherunion_mcp/server.py --http --port 8000
    

Available Tools

The MCP server provides two powerful weather tools:

1. get_current_weather

Get current weather data for any geographic location using latitude and longitude coordinates.

Parameters:

  • latitude (float): Latitude coordinate (-90 to 90 degrees)
  • longitude (float): Longitude coordinate (-180 to 180 degrees)

Returns: Comprehensive weather information including temperature, humidity, wind conditions, precipitation, and air quality data.

Example:

get_current_weather(12.933756, 77.625825)  # Bangalore coordinates

2. get_weather_for_city

Get weather data for major Indian cities using predefined city names.

Parameters:

  • city_name (str): Name of the city (case-insensitive)
  • country_code (str, optional): Country code (default: "IN")

Supported Cities:

  • Bangalore, Mumbai, Delhi, Hyderabad, Chennai
  • Kolkata, Pune, Ahmedabad, Jaipur, Lucknow

Example:

get_weather_for_city("bangalore")
get_weather_for_city("Mumbai")

Weather Data Format

The server returns comprehensive weather information in a formatted string:

Weather Information (Lat: 12.933756, Lon: 77.625825):

Temperature: 25.68°C
Humidity: 25.81%
Wind Speed: 1.15 km/h
Wind Direction: 331.2°
Rain Intensity: 0 mm/h
Rain Accumulation: 0.4 mm
Air Quality Index (PM 2.5): 84
Air Quality Index (PM 10): 75

API Key

You need a Weather Union API key (X-Zomato-Api-Key) to use this server. You can generate this for free by signing up at Weather Union.

  • The server validates your API key on startup
  • API key must be set as an environment variable
  • The server will show clear error messages if the API key is missing or invalid

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for weatherunion-mcp 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for weatherunion-mcp 1.0.2
File Size Uploaded Provenance
weatherunion_mcp-1.0.2.tar.gz 31.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for weatherunion-mcp 1.0.2
File Interpreter ABI Platform
weatherunion_mcp-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 38.6 kB

Release files / weatherunion_mcp-1.0.2.tar.gz

Download URL weatherunion_mcp-1.0.2.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2063645aff8d31df3b4ea148d887e4f6990c178461668042a2845e7c381a3b64
BLAKE2b-256 checksum
How to use checksums
50a5edcd0e4b7af8f31bf2f108a0a3306a1f36eeb763991b190593014e9e7288
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release files / weatherunion_mcp-1.0.2-py3-none-any.whl

Download URL weatherunion_mcp-1.0.2-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06d720548d85ebe8c9f08fa02f6556269bd33e32a13c4ed3026517bf2b664035
BLAKE2b-256 checksum
How to use checksums
33701db559db0d4f2493347b28e741658137774f52c31967a1eb7a87fdab89ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Security for weatherunion-mcp 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page