Skip to main content
Glama

天气查询 MCP 服务

基于 Node.js 的 MCP (Model Context Protocol) 服务,提供中国城市天气查询功能。

功能特性

  • query_weather: 查询城市实时天气信息

  • get_weather_details: 获取详细天气信息,包括未来几天预报

Related MCP server: HeFeng Weather MCP Server

快速安装

方式一:使用 npx(推荐)

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "juweather-mcp-server"],
      "env": {
        "JUHE_WEATHER_API_KEY": "你的API_KEY"
      }
    }
  }
}

方式二:从 GitHub 安装

# 克隆仓库
git clone https://github.com/jaron2026/weather.git
cd weather

# 安装依赖
npm install

然后在 Claude Desktop/Cursor 配置:

{
  "mcpServers": {
    "weather": {
      "command": "node",
      "args": ["你的本地路径/index.js"],
      "env": {
        "JUHE_WEATHER_API_KEY": "你的API_KEY"
      }
    }
  }
}

配置 API Key

  1. 访问 聚合数据官网 注册账号

  2. 在个人中心获取 API Key(免费)

  3. 将 API Key 填入配置文件的 JUHE_WEATHER_API_KEY

使用示例

帮我查一下苏州今天的天气
北京未来几天的天气预报
深圳现在温度多少

数据来源

使用 聚合数据 的免费天气 API。

开发

# 克隆项目
git clone https://github.com/jaron2026/weather.git
cd weather

# 安装依赖
npm install

# 调试
npm run inspect

项目结构

weather/
├── index.js           # MCP 服务主文件
├── package.json       # 项目配置
├── .env.example       # 环境变量示例
├── .gitignore         # Git 忽略文件
└── README.md          # 项目文档

许可证

MIT

Available Tools

2 tools
get_weather_detailsB

获取城市的详细天气信息,包括未来几天预报

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYes城市名称,例如:苏州、北京、上海、深圳等

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of explaining behavior. It does disclose that the tool returns detailed weather information including a multi-day forecast, which helps. However, it does not describe the response format, specific fields, data source, or update behavior, leaving important behavioral details unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single compact sentence that is easy to parse and front-loads the core purpose. There is no filler or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter read tool, the description is mostly adequate: it names the resource and the forecast scope. It is incomplete because it does not distinguish from query_weather and, with no output schema, gives only a vague sense of what 'detailed weather information' actually contains.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the schema already describes the city parameter with examples. The description adds no parameter-specific meaning beyond what the schema provides, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('获取') and resource ('城市的详细天气信息'), and even specifies included content (future forecast). However, it does not explicitly distinguish itself from the sibling tool query_weather, so it misses the full 5-level differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to use this tool versus query_weather. The word '详细' implies it may be for more detailed needs, but there is no explicit when-to-use, when-not-to-use, or alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_weatherB

查询中国城市的实时天气信息

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYes城市名称,例如:苏州、北京、上海、深圳等

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does convey that this is a read-style query returning real-time weather for Chinese cities. However, it does not describe what exactly is returned, whether results are limited in scope, or any edge cases, leaving some ambiguity for a tool with no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one short, front-loaded sentence with no filler. It states the operation, the resource, and the geographic scope efficiently. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter read tool, the description is mostly adequate, but it omits any distinction from the sibling get_weather_details and provides no information about the response format. Since there is no output schema, a little more context about what the returned weather information contains would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single city parameter with examples. The description adds the context that cities are Chinese, but it does not meaningfully enrich parameter semantics beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action ('query') and resource ('real-time weather information for Chinese cities'). It is not a tautology and gives a solid sense of what the tool does. However, it does not distinguish itself from the sibling tool get_weather_details, so the purpose is clear but not differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given about when to use this tool versus get_weather_details. The description implies a simple real-time weather lookup, but it never mentions alternatives, exclusions, or conditions that would help an agent choose between the two weather tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.0.0
    • First observedget_weather_details
    • First observedquery_weather

TDQS

B3.4/5.0

Scored across 2 tools

Disambiguation4/5

query_weather focuses on current real-time conditions while get_weather_details offers more comprehensive information with forecast data. There is some overlap because both retrieve weather, but the descriptions provide enough distinction.

Naming Consistency4/5

Both names use a verb_noun pattern and are readable, but the mix of 'query' and 'get' is a slight inconsistency in retrieval verb choice.

Tool Count3/5

Two tools is a thin surface for a weather server, but it still covers the two core needs: current conditions and forecasts. This is borderline rather than clearly excessive or inadequate.

Completeness4/5

Real-time weather and multi-day forecast cover the most common weather information needs for Chinese cities. Missing features like alerts or historical data are minor gaps rather than causes of failure.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers