weather-mcp-server-py
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@weather-mcp-server-pywhat's the weather in Beijing?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: mcp-weather-server
🛠 Provided Tools
Tool Name | Parameters | Description |
|
| 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.pyThis service communicates with clients via standard input/output (stdio);
python weather_server.pystarts 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
currentfield 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
This server cannot be deployed
Maintenance
Related MCP Connectors
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
MCP server for weather with reasoning — umbrella advice, outdoor checks, city comparisons.
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
MCP server for current weather and multi-day forecasts worldwide, Chinese city names and output.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to retrieve live weather updates for any city via OpenWeatherMap, wrapped in MCP format.1-
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients like Kiro and Claude to access current weather conditions and forecasts for any location using the OpenWeatherMap API.-
- FlicenseBqualityDmaintenanceProvides real-time weather information for cities worldwide using the OpenWeatherMap API, accessible through natural language queries via the MCP protocol.1-
- FlicenseNot gradedqualityCmaintenanceEnables AI applications and MCP clients to look up real-time weather data for any specified city through a callable tool.-