Skip to main content
Glama
yuxiaosenstar

weather-mcp-server-py

Weather Query MCP Service (Python Edition) 🌤

A weather query MCP service implemented with the official mcp Python SDK (FastMCP). Communicates with any MCP client (such as Claude Desktop, WorkBuddy, etc.) via stdio, allowing AI assistants to query the current weather of a specified city in real time.

💡 Weather data comes from Open-Meteo, no registration or API Key required.

✨ Features

  • Pure stdio communication: plug-and-play, no open ports or HTTP service needed.

  • 🌍 Multilingual city names: supports Chinese and English city names, such as 北京, Beijing, Tokyo.

  • 🔒 Zero keys: data comes from Open-Meteo, no personal data collected, no request body sent.

  • 🛡 Robust error handling: returns friendly Chinese prompts for non-existent cities or network errors without crashing.

  • 🎨 Friendly return format: structured text + emoji, easy for clients to display directly.

🛠 Provided Tools

Tool Name

Parameters

Description

get_weather

city (city name, supports Chinese and English)

Returns the city's current weather: conditions / temperature / feels-like temperature / humidity / wind speed / observation time

Return Example

📍 北京(中国)当前天气
🌤  天气:晴
🌡  温度:27.3°C(体感 28.1°C)
💧 湿度:52%
🍃 风速:12.4 km/h
🕒 观测时间:2026-08-19T13:00

📋 Requirements

  • Python >= 3.10 (3.13 recommended, verified on this machine)

  • Internet access required (calls the Open-Meteo API)

🚀 Installation and Running

git clone https://github.com/<your-name>/weather-mcp-server-py.git
cd weather-mcp-server-py

# 创建虚拟环境(可选但推荐)
python3 -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate

# 安装依赖
pip install -r requirements.txt

# 运行(stdio 模式,通常由 MCP 客户端拉起)
python weather_server.py

This service communicates with clients via standard input/output (stdio); python weather_server.py starts in stdio mode by default.

🔌 Connecting to MCP Clients

Using claude_desktop_config.json / mcp.json in Claude Desktop / WorkBuddy as an example, add the following configuration (replace python3 with the absolute path to the interpreter on your machine; use python.exe on Windows):

{
  "mcpServers": {
    "weather": {
      "command": "python3",
      "args": ["/absolute/path/to/weather_server.py"]
    }
  }
}

After saving and restarting the client, you can request "query the weather in Beijing" in a conversation, and the model will automatically call the get_weather tool.

📁 Project Structure

weather-mcp-server-py/
├── weather_server.py   # MCP 服务主实现(FastMCP)
├── requirements.txt    # 依赖清单
└── README.md           # 本说明

🧰 Technical Highlights

  • City → coordinates: uses the Open-Meteo Geocoding API;

  • Current weather: uses the Open-Meteo Forecast API, with the current field fetching temperature / feels-like / humidity / wind speed / weather code in one call;

  • Weather code → Chinese description: built-in WMO weather code mapping table;

  • If the network is unavailable or the city cannot be found at runtime, a friendly Chinese error prompt is returned, ensuring the tool always returns a string.

🤝 Contributing

Issues and Pull Requests are welcome, such as adding more weather metrics, supporting more client examples, or adding tests.

📄 License

MIT © 2026 weather-mcp-server-py contributors

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)

  • WeatherAPI.com MCP — wraps WeatherAPI.com (api.weatherapi.com)

  • Visual Crossing Weather MCP — wraps the Visual Crossing Weather Timeline API

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yuxiaosenstar/weather-mcp-server-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server