Skip to main content

A weather MCP server using WeatherAPI

Project description

weather-mcp

A weather MCP server powered by WeatherAPI.

Installation

pip install weather-mcp

Setup

  1. Get a free API key from weatherapi.com
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weather_mcp_v1-0.1.0.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weather_mcp_v1-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

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

Hashes for weather_mcp_v1-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3c664ed5003b01f8e311f89693b7c003647cf5f9ae11aeb6baa8b6fc777d0f40
MD5 1591308d1fa6fc22a0e11c9c9cdb30d7
BLAKE2b-256 4a2611a7a3e9b8b036baeee8caf3fa93dbb1fc03cb652c95c76f73d825e541fb

See more details on using hashes here.

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

Hashes for weather_mcp_v1-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4129895ec6f66131c98758b58ec7822ec149fe95a8459dc13be360fd24f1f2d7
MD5 6485e2360f3ceda0c7d1340e5d491fb8
BLAKE2b-256 5fb99cef7b2d289a987f08a63fa4bfd4c6eb1f4c2cbfdeaf167e4a3f16fff7aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page