Weather MCP Server
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 ServerWhat's the weather like in Shanghai right now?"
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 MCP Server
基于 wttr.in 的实时天气查询 MCP 服务器(Streamable HTTP),用于 HelloAgents / Datawhale 第十章实践与 Smithery 发布。
功能
工具 | 说明 |
| 查询城市当前天气(支持中文城市名与英文名) |
| 列出内置中文城市映射 |
| 服务器元信息 |
内置中文城市:北京、上海、广州、深圳、杭州、成都、重庆、武汉、西安、南京、天津、苏州。其他城市可直接传英文名。
Related MCP server: Weather MCP Server
快速开始
git clone https://github.com/BigDaddy118/weather-mcp-server.git
cd weather-mcp-server
pip install -r requirements.txt
python server.py默认监听:http://0.0.0.0:8081/mcp
环境变量:
变量 | 默认 | 说明 |
|
| 端口 |
|
| 绑定地址 |
|
| MCP 传输(Smithery 需 HTTP) |
Docker
docker build -t weather-mcp-server .
docker run --rm -p 8081:8081 weather-mcp-server在 Smithery 使用 / 发布
已发布标识:1009264368/weather-mcp-server
本地临时公网(开发用):
python server.py
# 另开终端:npx localtunnel --port 8081
# 得到 https://xxxx.loca.lt 后,MCP URL 为 https://xxxx.loca.lt/mcp正式发布示例:
npx @smithery/cli auth login
npx @smithery/cli mcp publish "https://你的公网域名/mcp" -n 1009264368/weather-mcp-serverSmithery 需要正在运行的 HTTP MCP 地址,不能填本 GitHub 仓库 URL。临时隧道关掉后线上会不可用,生产环境请部署到稳定主机。
在 HelloAgents 中使用
学习仓库里的 stdio 演示见 14_weather_mcp_server.py。本仓库面向 HTTP:
# 连接已部署的 HTTP MCP(视 MCPTool / 客户端是否支持 URL)
# 或本地 stdio:把本目录 server 改为 stdio 传输后再用
# MCPTool(server_command=[sys.executable, "server.py"])示例返回
get_weather("北京"):
{
"city": "北京",
"temperature": 22.0,
"feels_like": 21.0,
"humidity": 40,
"condition": "Sunny",
"wind_speed": 2.5,
"visibility": 10.0,
"timestamp": "2026-10-01 17:00:00"
}依赖
Python >= 3.10
fastmcp>=2.0.0requests>=2.31.0
许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for current weather and multi-day forecasts worldwide, Chinese city names and output.
Live data: weather, air quality, FX, CN/HK/US stocks, IP geo, domain, SSL, China reachability.
Free, keyless real-time weather and 7-day forecasts for any city worldwide.
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables real-time weather queries for 12 major Chinese cities and global cities using the wttr.in API. Provides tools to get weather, list supported cities, and server info.MIT
- AlicenseNot gradedqualityDmaintenanceEnables real-time weather queries for 12 major Chinese cities and global cities using the wttr.in API without an API key, with tools for weather, city listing, and server info.MIT
- AlicenseNot gradedqualityBmaintenanceProvides real-time weather data for Chinese cities and worldwide locations through wttr.in, with tools to query weather, list supported cities, and get server/author information.MIT
- AlicenseNot gradedqualityCmaintenanceEnables real-time weather queries for Chinese and global cities via wttr.in, with support for both stdio and HTTP deployment.MIT