这是一个模型上下文协议 (MCP) 服务器,它能提供来自国家气象局 API 的天气数据,可有效帮助用户获取所需天气信息。
天气 MCP 服务器可提供来自国家气象局 API 的天气数据。在使用前,请确保满足以下先决条件,并按照安装步骤进行操作。
git clone https://github.com/nakamurau1/weather-mcp.git
cd weather-mcp
npm install
npm run build
npm start
或直接运行:
./dist/index.js
# MacOS 系统
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/绝对路径/到你的/weather-mcp/dist/index.js"]
}
}
}
获取某个地理位置的天气预报。 参数:
latitude: 地点纬度(-90 到 90 之间的数字)longitude: 地点经度(-180 到 180 之间的数字)获取美国州份的生效天气警报。 参数:
state: 美国两个字母的州代码(例如 "CA","NY","TX")URI 模板: weather://{state}/alerts
示例: weather://CA/alerts
npm run devnpm run buildISC