us-weather-by-zip-code

us-weather-by-zip-code

3.5

The US Weather By Zip Code MCP server provides real-time weather information for cities across the United States using their zip codes.

The US Weather By Zip Code MCP server offers real-time weather data for cities across the United States, accessible via zip codes. This service is ideal for integration into applications or websites, enhancing user experiences with weather-driven personalization and business processes. It delivers accurate and up-to-date weather data from over three thousand weather stations, including those in Alaska and Hawaii. The server is designed to support consumer and business applications, providing developers with the tools to incorporate weather data into their projects seamlessly.

Features

  • Real-Time Weather Data: Access current weather information including temperature, conditions, wind speed, visibility, air quality, and more.
  • Weather-Driven Personalization: Customize and personalize applications based on local weather conditions.
  • Wide Coverage: Provides data from thousands of locations across the USA.
  • Easy Integration: The server's tools are easy to integrate, providing immediate results.
  • Business Process Enhancement: Enable weather awareness in business operations, especially those impacted by adverse weather conditions.

MCP Tools

  • Get Weather By Zip: Retrieves current US weather information for a given zip code.

Usage with Different Platforms

python

python
import requests

def get_weather_by_zip(zip_code):
    url = f"http://api.weatherbyzip.com/get_weather?zip={zip_code}"
    response = requests.get(url)
    if response.status_code == 200:
        return response.json()
    else:
        return None

weather_data = get_weather_by_zip('90210')
print(weather_data)

javascript

javascript
const fetch = require('node-fetch');

async function getWeatherByZip(zipCode) {
    const response = await fetch(`http://api.weatherbyzip.com/get_weather?zip=${zipCode}`);
    if (response.ok) {
        const data = await response.json();
        return data;
    } else {
        throw new Error('Failed to fetch weather data');
    }
}

getWeatherByZip('90210').then(data => console.log(data)).catch(error => console.error(error));