mcpField
天
天气 MCP 服务器

天气 MCP 服务器

Local
github.com/odingggMedia & Design0Updated 79w ago

About 天气 MCP 服务器

A weather MCP server built with FastMCP and the OpenWeather API. It is for users of MCP clients who need city forecasts of up to five days and current air-quality information.

Key features

  1. 01Get forecasts for up to five days
  2. 02Check current air quality
  3. 03Retrieve data through OpenWeather API

Use cases

  1. 01Check a city's forecast for coming days
  2. 02Look up current air quality in a city

MCP support

The server provides MCP clients with tools for retrieving weather forecasts and air-quality information. The README shows how to configure it in a client.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

天气 MCP 服务器

这是一个使用 OpenWeather API 获取天气数据和空气质量的 Model Context Protocol (MCP) 服务器。

功能

  • 获取任何城市的详细天气预报(最多 5 天)
  • 获取任何城市的当前空气质量信息

安装

前提条件
步骤
  1. 克隆仓库

    git clone https://github.com/odinggg/weather-mcp.git
    cd weather-mcp
    
  2. 连接到 MCP 服务器

将以下 JSON 配置添加到您的 MCP 客户端(例如 Claude Desktop)中:

{
   "mcpServers": {
      "weather": {
         "command": "uv", // uv path
         "args": [
            "--directory",
            "/your/path/to/weather-mcp",
            "run",
            "-m",
            "weather_mcp_server.main",
            "--api-key",
            "xxxxxxxxxxxxxxx"
         ]
      }
   }
}

对于 Claude Desktop,将此保存为 claude_desktop_config.json,位置在:

~/Library/Application Support/Claude/claude_desktop_config.json

使用方法

连接后,您可以使用天气 MCP 服务器:

  1. 获取天气预报:

    • 向 Claude 询问任何城市的天气预报
    • 指定预报的天数(最多 5 天)
  2. 获取空气质量信息:

    • 向 Claude 询问任何城市的空气质量

示例提示:

  • "未来 3 天北京的天气预报是什么?"
  • "现在上海的空气质量如何?"

故障排除

  • 如果遇到关于 API 密钥的错误,确保您在命令行参数中正确提供了 API 密钥
  • 确保您的网络可以访问 OpenWeather API
  • 检查您的 MCP 客户端中的服务器配置是否正确

技术细节

该服务器使用:

  • OpenWeather API 获取天气数据
  • FastMCP 框架实现 MCP 协议
  • Python 的 requests 库进行 API 交互

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.