✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more

Weather MCP Server

A Model Context Protocol (MCP) server that provides weather information for different regions around the world.

Overview

This MCP server uses the wttr.in API to fetch weather data and serves it through a standardized MCP interface. It allows AI models and other clients to request weather information for any region by name.

Features

  • Fetch weather information for any city or region worldwide
  • Uses the free wttr.in API (no API key required)
  • Implemented as a FastMCP server for easy integration with AI models
  • Docker support for easy deployment

Requirements

  • Python 3.10+
  • Required packages (see requirements.txt):
    • requests
    • beautifulsoup4
    • fastapi
    • uvicorn
    • pydantic
    • fastmcp

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd weather_mcp
    
  2. Install dependencies:

    pip install -r requirements.txt
    

Usage

Running the server locally

python server.py

The MCP server will start on port 8000 by default (as specified in smithery.yaml).

Using Docker

Build the Docker image:

docker build -t weather-mcp-server .

Run the container:

docker run -p 8000:8000 weather-mcp-server

API Usage

The server exposes a single MCP handler:

get_weather

Fetches weather information for the specified region.

Parameters:

  • region_name (string, required): The name of the city or region to get weather for.

Returns:

  • JSON object with weather information from wttr.in

Example:

# Example client code
from mcp.client import MCPClient

async with MCPClient("http://localhost:8000") as client:
    weather_data = await client.get_weather(region_name="London")
    print(weather_data)

Testing

You can test the weather functionality directly by running:

python weather_fetcher.py

This will fetch and display weather information for Suzhou (default city).

License

See the LICENSE file for details.

Featured Templates

View More
Verified Icon
AI Assistants
Speech to Text
137 1882
Verified Icon
AI Agents
AI Chatbot Starter Kit
1336 8300 5.0
Customer service
AI-Powered Product List Manager
153 868
AI Assistants
AI Chatbot Starter Kit v0.1
140 913
AI Assistants
Image to text with Claude 3
152 1366
AI Agents
AI Video Generator
252 2007 5.0

Start your free trial

Build your solution today. No credit card required.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.