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-v1

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.1.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.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file weather_mcp_v1-0.1.1.tar.gz.

File metadata

  • Download URL: weather_mcp_v1-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 1ff2b44217c82a3548094bbeeee8034c6417a9ede9e09595f3e86b2117cb7c61
MD5 6b49383d8c51403fbec107517916a0bc
BLAKE2b-256 aea734502d846dd4b44b3b5753d0334ccd7f4cedd5f9c6f801172981c02bfa0c

See more details on using hashes here.

File details

Details for the file weather_mcp_v1-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: weather_mcp_v1-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73c5bf5787b8f5d86312b3fadd795bb7fcc32c6f877998e0cca2ed3ee8595812
MD5 a7962a0306f1ebd43b06706c90a7f6c6
BLAKE2b-256 03f9cf525e20113c67c89c841fcf12c493da25208483556a738b0bb56b58ce91

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