Weather MCP Server
基于 wttr.in 的天气 MCP 服务器,提供天气查询功能。
安装
npm install
npm run build使用方法
本地测试
npm run dev在 Claude Desktop 中配置
编辑 Claude Desktop 配置文件:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/你的项目路径/weather-mcp-server/build/index.js"]
}
}
}功能
1. get_weather
获取指定地点的当前天气
参数:
location(必需): 位置(城市名、邮编、机场代码等)format(可选): 输出格式 - "text" 或 "json"
示例:
请查询北京的天气2. get_forecast
获取详细天气预报(包括未来几天)
参数:
location(必需): 位置
示例:
请查询上海未来几天的天气预报支持的位置格式
- 城市名称:
Beijing,Shanghai,北京,上海
技术栈
- TypeScript
- MCP SDK
- wttr.in API
许可证
MIT
