home / mcp / weather mcp server
Provides real-time weather data, forecasts, and city comparisons via MCP for AI assistants.
Configuration
View docs{
"mcpServers": {
"abhishek3689-weather_mcp_server": {
"command": "python",
"args": [
"weather_server_mcp.py"
],
"env": {
"WEATHER_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}You can deploy this Weather MCP Server to provide real-time weather data, forecasts, and city comparisons to MCP clients. It runs locally or in your environment and exposes weather tools through a simple STDIO-based MCP transport, allowing AI assistants to fetch weather information efficiently.
Install and run the Weather MCP Server, then connect an MCP client to access tools like current weather, forecasts, and weather comparisons. You run the server locally and the client (such as Claude Desktop) communicates with the server through the standard input/output interface. Start by ensuring your API key is configured, then issue requests to the available tools from your client.
Prerequisites: Python 3.8 or higher and a WeatherAPI.com API key (free tier available). You will also need Internet access to fetch weather data.
# 1. Clone the project
git clone https://github.com/Abhishek3689/Weather_MCP_Server.git
cd weather-mcp-server
# 2. Install dependencies
pip install -r requirements.txt
# 3. Set up environment variables
# Create a .env file in the project root with your API key
# WEATHER_API_KEY=your_api_key_hereConfiguration and start details are provided to help you run the server and integrate it with Claude Desktop. You can start the server manually to verify itโs running, and then connect via your MCP client.
To integrate with Claude Desktop, add the following configuration to your Claude Desktop config: on macOS, place it at ~/Library/Application Support/Claude/claude_desktop_config.json; on Windows, place it at %APPDATA%\Claude\claude_desktop_config.json.
{
"mcpServers": {
"weather": {
"command": "python",
"args": [
"weather_server_mcp.py"
],
"env": {
"WEATHER_API_KEY": "your_api_key_here"
}
}
}
}If you encounter issues starting the server, run it manually to confirm itโs working: python weather_server_mcp.py. The server uses STDIO transport, so you wonโt see normal console output through MCP clients, but you can verify the process is running by observing startup messages in the terminal.
Fetches the current weather for a given city with selectable units (metric for Celsius, imperial for Fahrenheit).
Retrieves a multi-day weather forecast for a city, up to 10 days depending on the plan, with unit options.
Compares weather conditions between two cities using the same unit system.