A weather MCP server using WeatherAPI
Project description
weather-mcp
A weather MCP server powered by WeatherAPI.
Installation
pip install weather-mcp
Setup
- Get a free API key from weatherapi.com
- Set the environment variable:
# Linux/Mac
export WEATHER_API_KEY=your_api_key_here
# Windows
set WEATHER_API_KEY=your_api_key_here
Or create a .env file in your working directory:
WEATHER_API_KEY=your_api_key_here
Usage
Run as SSE server
weather-mcp
Server starts at http://localhost:8000/sse
Connect from your MCP client
from mcp.client.sse import sse_client
from mcp import ClientSession
async with sse_client("http://localhost:8000/sse") as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
Connect with Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"weather": {
"command": "weather-mcp",
"env": {
"WEATHER_API_KEY": "your_api_key_here"
}
}
}
}
Available Tools
get_weather
Fetches current weather for a given location.
Input:
location(string) — city name, postal code, coordinates
Output: Full weather JSON from WeatherAPI including temperature, condition, humidity, wind, etc.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file weather_mcp_v1-0.1.0.tar.gz.
File metadata
- Download URL: weather_mcp_v1-0.1.0.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c664ed5003b01f8e311f89693b7c003647cf5f9ae11aeb6baa8b6fc777d0f40
|
|
| MD5 |
1591308d1fa6fc22a0e11c9c9cdb30d7
|
|
| BLAKE2b-256 |
4a2611a7a3e9b8b036baeee8caf3fa93dbb1fc03cb652c95c76f73d825e541fb
|
File details
Details for the file weather_mcp_v1-0.1.0-py3-none-any.whl.
File metadata
- Download URL: weather_mcp_v1-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4129895ec6f66131c98758b58ec7822ec149fe95a8459dc13be360fd24f1f2d7
|
|
| MD5 |
6485e2360f3ceda0c7d1340e5d491fb8
|
|
| BLAKE2b-256 |
5fb99cef7b2d289a987f08a63fa4bfd4c6eb1f4c2cbfdeaf167e4a3f16fff7aa
|