Back to MCP directory
publicPublicdnsLocal runtime

weather_mcp_server

一个连接国家气象局API的天气信息MCP服务器,可查询美国各州天气警报和指定坐标的详细天气预报

article

README

🚀 天气 MCP 服务器

天气 MCP 服务器是一个基于模型上下文协议(Model Context Protocol)的服务器,它通过连接国家气象局 API,为用户提供丰富的天气信息。

🚀 快速开始

天气 MCP 服务器能让你轻松获取美国的天气信息。你可以按照以下步骤进行操作,开启天气信息获取之旅。

✨ 主要特性

  • 可获取任意美国州份的活跃天气警报,及时了解当地天气动态。
  • 能根据具体地理坐标获取详细的天气预报,满足精准的天气查询需求。

📦 安装指南

  1. 克隆此仓库。
  2. 安装依赖项:
    pip install mcp httpx
    
    若使用 uv,可执行以下命令:
    uv pip install mcp httpx
    

💻 使用示例

基础用法

直接运行服务器,使用以下命令:

python weather_server.py

高级用法

与 Claude for Desktop 配合使用,将以下内容添加到你的 Claude for Desktop 配置文件 ~/Library/Application Support/Claude/claude_desktop_config.json

{
    "mcpServers": {
        "weather_mcp_server": {
            "command": "/实际路径/to/uv",
            "args": [
                "--directory",
                "/绝对路径/to/weather_mcp_server",
                "运行",
                "weather_server.py"
            ]
        }
    }
}

⚠️ 重要提示

需将 /实际路径/to/uv 替换为你实际的 uv 可执行文件路径(使用 which uv 找到);将 /绝对路径/to/weather_mcp_server 替换为该目录的实际绝对路径。

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