](https://mseep.ai/app/shibing624-weather-forecast-server)
天气预报MCP服务器
用于使用wttr.in服务检索天气信息的模型上下文协议(MCP)服务器。
概述
此MCP服务器提供用于访问全球各地当前天气状况和预报的工具。 它可以很容易地与MCP客户端集成,包括Claude和其他支持MCP协议的LLM应用程序。
特性
- 获取任何位置的当前天气
- 获取多日天气预报(最多3天)
- 支持中文/英文和其他语言的地名
- 与MCP客户端应用程序轻松集成
安装
来自pip
您可以使用以下命令安装MCP天气服务器 uv:
uv pip install weather-forecast-server或者使用pip:
pip install weather-forecast-server来源
git clone https://github.com/shibing624/mcp-server-weather.git
cd weather-forecast-server
pip install -e .用法
Python演示
from weather_forecast_server import get_weather
print(get_weather('baoding')) # can be "baoding" or "保定"
作为独立的MCP服务器运行
使用stdio传输运行服务器:
uvx weather-forecast-server或
uv run weather-forecast-server或
python -m weather_forecast_server然后,您可以将服务器与支持stdio传输的任何MCP客户端一起使用。
与Cursor集成
要将天气MCP服务器添加到Cursor,请使用以下命令添加stdio MCP:
uv run weather-forecast-server
可用工具
get_weather-获取某个地点的当前天气状况(最多3天)
联系
- 问题和建议: ](https://github.com/shibing624/weather-forecast-server/issues)
- 电子邮件:xuming624@qq.com
- 微信:添加我(微信ID:xuming624),并留言:“名称公司NLP”,加入我们的NLP讨论组。
许可证
该项目已获得许可 Apache许可证2.0 并且可以自由地用于商业目的。 请提供以下链接 weather-forecast-server 项目和产品描述中的许可证。
贡献
我们欢迎为改进这个项目做出贡献!在提交pull请求之前,请:
- 在中添加适当的单元测试
tests目录 - 跑
python -m pytest确保所有测试通过 - 提交您的PR,明确说明更改内容
致谢
- 气象数据由 wttr.in
- 内置于 MCP Python SDK
