本项目是为QWeather API提供服务的MCP服务器,借助Model Context Protocol (MCP) 实现天气信息的查询功能。
在开始使用本项目前,您需要先在这里获取API密钥。
若要为Claude Desktop自动安装qweather-mcp插件,可使用Smithery,执行以下命令:
npx -y @smithery/cli install @overstarry/qweather-mcp --client claude
执行以下命令启动标准输入输出服务器:
# 标准输入输出服务器
npx -y qweather-mcp
同时,您需要设置以下环境变量:
QWEATHER_API_BASE=https://api.qweather.com
QWEATHER_API_KEY=<您的API密钥>
您也可以使用JSON文件进行配置,示例如下:
{
"mcpServers": {
"qweather": {
"command": "npx",
"args": ["-y", "qweather-mcp"],
"env": {
"QWEATHER_API_BASE": "<您的API地址>",
"QWEATHER_API_KEY": "<您的API密钥>"
}
}
}
}
lookup-city:根据名称查找城市信息get-weather-now:获取指定位置的当前天气状况本项目采用MIT许可证。