Simple Weather MCP Server example from Quickstart

Simple Weather MCP Server example from Quickstart

简易天气MCP Server示例

这是一个简单的 MCP 服务器示例,提供美国天气信息访问能力。

安装与配置

将以下配置添加到 Claude 桌面版的配置文件中:

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": [
        "-y",
        "@h1deya/mcp-server-weather"
      ]
    }
  }
}

配置文件位置:

  • MacOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %AppData%\Claude\claude_desktop_config.json

可用工具

工具描述参数
get-alerts获取美国州级天气警报state: 两字母州代码(例如 CA, NY)
get-forecast获取指定位置天气预报latitude: 纬度
longitude: 经度

示例查询

  • "帕洛阿尔托明天的天气?"
  • "加利福尼亚州有任何天气警报吗?"

基于MCP 快速入门 | npm 包 | MIT 许可证