Weather MCP Server

Weather MCP Server

Provides real-time weather information for any location worldwide using the wttr.in service, enabling AI assistants to fetch current weather conditions and temperatures through natural language queries.

Category
Visit Server

README

Weather MCP Server

A Model Context Protocol (MCP) server that provides real-time weather information for any location worldwide using the wttr.in service.

Overview

This MCP server exposes a fetch_weather tool that allows AI assistants like Claude to retrieve current weather information for any city or location. It's built using FastMCP and provides a simple, reliable interface for weather data.

Features

  • šŸŒ¤ļø Real-time weather information for any location
  • šŸŒ Worldwide coverage
  • ⚔ Fast and lightweight
  • šŸ”Œ Easy integration with MCP-compatible clients (Claude Desktop, etc.)
  • šŸ“¦ Simple setup with minimal dependencies

Prerequisites

  • Python 3.12 or higher
  • uv package manager (recommended) or pip

Installation

  1. Clone this repository:
git clone <your-repo-url>
cd weather-mcp
  1. Install dependencies using uv:
uv pip install -e .

Or using pip:

pip install -e .

Configuration

Claude Desktop

To use this server with Claude Desktop, add the following configuration to your Claude Desktop config file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "weather-bot": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/weather-mcp",
        "run",
        "main.py"
      ]
    }
  }
}

Replace /absolute/path/to/weather-mcp with the actual path to this project directory.

Usage

Once configured, the weather tool will be available to your AI assistant. You can ask questions like:

  • "What's the weather in London?"
  • "Tell me the current weather in New York"
  • "How's the weather in Tokyo?"

Running Standalone

You can also run the server directly for testing:

python main.py

Or test the weather function directly:

python tools/weather.py

Available Tools

fetch_weather

Retrieves current weather information for a specified location.

Parameters:

  • location (string): The city or location name (e.g., "London", "New York", "Tokyo")

Returns:

  • A string containing the weather information including temperature and conditions

Example Response:

London: ā›…ļø +12°C

Project Structure

weather-mcp/
ā”œā”€ā”€ main.py              # MCP server entry point
ā”œā”€ā”€ tools/
│   ā”œā”€ā”€ __init__.py
│   └── weather.py       # Weather fetching logic
ā”œā”€ā”€ pyproject.toml       # Project configuration
ā”œā”€ā”€ README.md            # This file
└── uv.lock             # Dependency lock file

Technical Details

  • MCP Framework: FastMCP
  • Weather API: wttr.in - a console-oriented weather service
  • Transport: stdio (standard input/output)
  • Python Version: 3.12+

How It Works

  1. The server exposes a fetch_weather tool via the Model Context Protocol
  2. When called, it makes an HTTP request to wttr.in's API
  3. The weather data is formatted and returned to the MCP client
  4. The AI assistant can then present this information naturally to the user

Troubleshooting

Server not appearing in Claude Desktop

  1. Verify the path in your config file is absolute and correct
  2. Restart Claude Desktop completely
  3. Check the Claude Desktop logs for any error messages

Weather data not loading

  • Ensure you have an active internet connection
  • The wttr.in service must be accessible from your network
  • Some corporate networks may block access to external weather services

Acknowledgments


Made with ā¤ļø for the MCP community

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured