Back to MCP directory
publicPublicdnsLocal runtime

claude-MCP-server

一个可靠的MCP天气服务器,提供实时天气数据并与Claude桌面版集成,支持NWS天气警报和7天预报。

article

README

🚀 🌦️ MCP 天气服务器

MCP 天气服务器是一个可靠的服务,它集成了实时天气数据与 Claude for Desktop,能为用户提供便捷的天气查询体验,解决了获取实时天气信息和智能交互的问题。

🚀 快速开始

先决条件

  • Python 3.10+
  • UV 包管理器
  • Claude for Desktop

安装步骤

  1. 安装依赖:
uv venv
.\.venv\Scripts\activate
  1. 创建 weather.py 文件。

✨ 主要特性

  • 实时 NWS 天气警报(按州)
  • 按坐标查询的 7 天预报
  • 轻量级 MCP 协议实现
  • 与 Claude for Desktop 集成

🔌 Claude 集成

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "weather": {
      "command": "python",
      "args": ["weather.py"],
      "cwd": "/absolute/path/to/project"
    }
  }
}

💻 使用示例

基础用法

用户:旧金山的天气如何?
Claude:[使用 get_forecast(37.7749, -122.4194)]

图片 图片 图片

🛠 故障排除

| 问题 | 解决方案 | |------|----------| | 连接失败 | 验证 Claude 的配置路径是否为绝对路径 | | 没有天气数据 | 检查 NWS API 状态 api.weather.gov | | 模块错误 | 执行 uv add mcp[cli] httpx |

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client