魔搭社区天气MCP服务Demo
Project description
MCP Weather Server
A simple MCP server that provides hourly weather forecasts using the AccuWeather API.
Setup
- Install dependencies using
uv:
uv venv
uv sync
- Create a
.envfile 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
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
mcp_weather_zk-0.1.1.tar.gz
(21.0 kB
view details)
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ff7ded01a98eb2ecc115ca8c3ac56106b91dd299cd83848046363988234b85d
|
|
| MD5 |
e578e381f3965bf32d62d7a9594d4909
|
|
| BLAKE2b-256 |
d16c6d1e3ff6e3539744cdfa33b12facd27849f2a96efd9d6d34321fa3b06157
|
File details
Details for the file mcp_weather_zk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_weather_zk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc0555e4d2c821d7ada7208977115c4791d5cce68a64ada74b203cfa966e7b6e
|
|
| MD5 |
ddd8ab3dee18e2aa58caa025fb7ab5e4
|
|
| BLAKE2b-256 |
a1051d270b8a16da1cf36e708d332b5941bef3600fde8d503ee3dff37304c201
|