Skip to main content

魔搭社区天气MCP服务Demo

Project description

MCP Weather Server

A simple MCP server that provides hourly weather forecasts using the AccuWeather API.

Setup

  1. Install dependencies using uv:
uv venv
uv sync
  1. Create a .env file with your AccuWeather API key:
ACCUWEATHER_API_KEY=your_api_key_here

You can get an API key by registering at AccuWeather API.

Running the Server

{
    "mcpServers": {
        "weather": {
            "command": "uvx",
            "args": ["--from", "git+https://github.com/CreateModel/mcp-weather.git", "mcp-weather"],
            "env": {
                "ACCUWEATHER_API_KEY": "zpka_787d7e4f665b43b6b8b7b7b67ab2eb45_812b9cc3"
            }
        }
    }
}

API Usage

Get Hourly Weather Forecast

Response:

{
    "location": "Jakarta",
    "location_key": "208971",
    "country": "Indonesia",
    "current_conditions": {
        "temperature": {
            "value": 32.2,
            "unit": "C"
        },
        "weather_text": "Partly sunny",
        "relative_humidity": 75,
        "precipitation": false,
        "observation_time": "2024-01-01T12:00:00+07:00"
    },
    "hourly_forecast": [
        {
            "relative_time": "+1 hour",
            "temperature": {
                "value": 32.2,
                "unit": "C"
            },
            "weather_text": "Partly sunny",
            "precipitation_probability": 40,
            "precipitation_type": "Rain",
            "precipitation_intensity": "Light"
        }
    ]
}

The API provides:

  • Current weather conditions including temperature, weather description, humidity, and precipitation status
  • 12-hour forecast with hourly data including:
    • Relative time from current time
    • Temperature in Celsius
    • Weather description
    • Precipitation probability, type, and intensity

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

mcp_weather_zk-0.1.1.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

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

mcp_weather_zk-0.1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_weather_zk-0.1.1.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for mcp_weather_zk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9ff7ded01a98eb2ecc115ca8c3ac56106b91dd299cd83848046363988234b85d
MD5 e578e381f3965bf32d62d7a9594d4909
BLAKE2b-256 d16c6d1e3ff6e3539744cdfa33b12facd27849f2a96efd9d6d34321fa3b06157

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_weather_zk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc0555e4d2c821d7ada7208977115c4791d5cce68a64ada74b203cfa966e7b6e
MD5 ddd8ab3dee18e2aa58caa025fb7ab5e4
BLAKE2b-256 a1051d270b8a16da1cf36e708d332b5941bef3600fde8d503ee3dff37304c201

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