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
uvpackage manager (recommended) orpip
Installation
Clone this repository:
Install dependencies using
uv:
Or using pip:
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
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:
Or test the weather function directly:
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:
Project Structure
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
The server exposes a
fetch_weathertool via the Model Context ProtocolWhen called, it makes an HTTP request to wttr.in's API
The weather data is formatted and returned to the MCP client
The AI assistant can then present this information naturally to the user
Troubleshooting
Server not appearing in Claude Desktop
Verify the path in your config file is absolute and correct
Restart Claude Desktop completely
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