Skip to main content
Glama
liuweihongliuxinyu

weather-mcp-server

๐ŸŒค Weather MCP Server

ไธ€ไธชๆœ€ๅฐๅŒ–ไฝ†ๅฎŒๆ•ด็š„ MCP (Model Context Protocol) ๆœๅŠก็ซฏๅฎž็Žฐ๏ผŒไธบ AI Agent ๆไพ›ๅฎžๆ—ถๅคฉๆฐ”ๆŸฅ่ฏข่ƒฝๅŠ›ใ€‚

Python MCP License

ไธบไป€ไนˆๅš่ฟ™ไธช้กน็›ฎ

่ฟ™ๆ˜ฏ ไปŽ้›ถๅญฆ AI Agent ๆžถๆž„ ็š„ๅฎžๆˆ˜้กน็›ฎ #1ใ€‚MCP ๅ่ฎฎๆ˜ฏ AI Agent ไธŽๅค–้ƒจไธ–็•Œไบคไบ’็š„ๆ ‡ๅ‡†ๆŽฅๅฃโ€”โ€”็†่งฃ MCP ๆ˜ฏ็†่งฃๆ•ดไธช Agent ๆžถๆž„็š„็ฌฌไธ€ๆญฅใ€‚ๆœฌ้กน็›ฎ็”จๆœ€ๅฐ็š„ไปฃ็ ้‡๏ผˆ~200 ่กŒ๏ผ‰ๅฑ•็คบ MCP Server ็š„ๅฎŒๆ•ด็”Ÿๅ‘ฝๅ‘จๆœŸใ€‚

Related MCP server: Weather MCP Server

ๅฟซ้€Ÿๅผ€ๅง‹

# 1. ๅฎ‰่ฃ…
cd weather-mcp-server
pip install -e .

# 2. ๆต‹่ฏ•
pytest tests/ -v

# 3. ่ฟ่กŒ๏ผˆstdio transport๏ผ‰
weather-mcp

ๆŽฅๅ…ฅ Claude Code

ๅœจ claude_desktop_config.json ๆˆ– .claude/settings.json ไธญๆทปๅŠ ๏ผš

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "run",
        "--directory", "D:\\AI_Space\\ClaudeCode-DeepSeek\\weather-mcp-server",
        "weather-mcp"
      ]
    }
  }
}

้‡ๅฏ Claude Code ๅŽ๏ผŒไฝ ๅฐฑ่ƒฝ็œ‹ๅˆฐ mcp__weather__get_current_weather ๅ’Œ mcp__weather__get_forecast ไธคไธชๅทฅๅ…ทใ€‚

ๆไพ›็š„ๅทฅๅ…ท

ๅทฅๅ…ทๅ

็”จ้€”

ๅ‚ๆ•ฐ

get_current_weather

ๅฎžๆ—ถๅคฉๆฐ”๏ผˆๆธฉๅบฆ/ไฝ“ๆ„Ÿ/้ฃŽ้€Ÿ/ๆนฟๅบฆ/็ดซๅค–็บฟ๏ผ‰

city (string)

get_forecast

ๆœชๆฅ N ๅคฉ้ข„ๆŠฅ

city (string), days (int, 1-3)

ๆžถๆž„

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           Claude Code (Host)             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚   MCP Client (weather)             โ”‚  โ”‚
โ”‚  โ”‚   JSON-RPC over stdio              โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚ stdin/stdout
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Weather MCP Server               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  handle_list_tools()              โ”‚  โ”‚
โ”‚  โ”‚  handle_call_tool()               โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚             โ”‚                            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  fetch_weather() (wttr.in)        โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

้กน็›ฎ็ป“ๆž„

weather-mcp-server/
โ”œโ”€โ”€ pyproject.toml          # ้กน็›ฎ้…็ฝฎๅ’Œไพ่ต–
โ”œโ”€โ”€ README.md               # ๆœฌๆ–‡ไปถ
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ weather_mcp/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ server.py       # MCP Server ๆ ธๅฟƒ๏ผˆ~200่กŒ๏ผ‰
โ””โ”€โ”€ tests/
    โ””โ”€โ”€ test_server.py      # ๅ•ๅ…ƒๆต‹่ฏ• + ้›†ๆˆๆต‹่ฏ•

ๅญฆไผšไบ†ไป€ไนˆ

้€š่ฟ‡่ฟ™ไธช้กน็›ฎไฝ ๅฏไปฅ็†่งฃ๏ผš

  1. MCP ๅ่ฎฎไธ‰ๅฑ‚ๆจกๅž‹: Host โ†’ Client โ†’ Server

  2. JSON-RPC 2.0: MCP ็š„ๅบ•ๅฑ‚ไผ ่พ“ๆ ผๅผ

  3. stdio transport: ่ฟ›็จ‹้—ด้€š่ฟ‡ๆ ‡ๅ‡†่พ“ๅ…ฅ่พ“ๅ‡บ้€šไฟก

  4. Tool ๅฎšไน‰: name + description + input_schema๏ผŒAI ๅฆ‚ไฝ•ๅŒน้…ๅทฅๅ…ท

  5. ไธšๅŠก้€ป่พ‘ไธŽๅ่ฎฎ่งฃ่€ฆ: fetch_weather() ไธ็Ÿฅ้“ MCP ็š„ๅญ˜ๅœจ

  6. ้”™่ฏฏๅค„็†: MCP ๅ่ฎฎ่ฆๆฑ‚่ฟ”ๅ›ž is_error ่€Œ้žๆŠ›ๅผ‚ๅธธ

License

MIT

Available Tools

3 tools
get_air_qualityๆŸฅ่ฏข็ฉบๆฐ”่ดจ้‡A

ๆŸฅ่ฏขไธ€ไธชๅŸŽๅธ‚็š„็ฉบๆฐ”่ดจ้‡ๆŒ‡ๆ•ฐ๏ผˆAQI๏ผ‰๏ผŒๅŒ…ๆ‹ฌ PM2.5ใ€PM10ใ€NOโ‚‚ใ€SOโ‚‚ใ€Oโ‚ƒ ็ญ‰ๆฑกๆŸ“็‰ฉๆต“ๅบฆใ€‚ๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑๆ–‡ๅŸŽๅธ‚ๅใ€‚ไธ้œ€่ฆ API Keyใ€‚

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYesๅŸŽๅธ‚ๅ็งฐ๏ผŒๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑๆ–‡ใ€‚ไพ‹ๅฆ‚๏ผšๅŒ—ไบฌใ€Shanghaiใ€Tokyo

TDQS

A3.7/5.0
Behavior3/5

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

No annotations provided, so description partially compensates by noting no API key required and listing pollutants. However, it omits other behaviors like rate limits, data freshness, error handling, or return format.

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?

Two concise sentences in Chinese that front-load the main purpose. No filler or redundancy; every sentence adds useful 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 single-parameter tool with no output schema, the description adequately states what is returned (AQI and specific pollutants) but lacks details on the response structure or data format, leaving some uncertainty.

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

Parameters4/5

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

Schema covers 100% of the city parameter with description. The description adds value by specifying language support (Chinese/English) and providing examples (e.g., Beijing, Shanghai, Tokyo), going beyond basic schema.

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

Purpose5/5

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

Description clearly states the tool queries air quality index (AQI) for a city, listing major pollutants (PM2.5, PM10, etc.). It is specific and distinct from sibling tools (weather, forecast), making the purpose unambiguous.

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 on when to use this tool vs siblings (e.g., get_current_weather, get_forecast). It mentions support for Chinese/English names and no API key, but lacks explicit when/when-not context.

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

get_current_weather่Žทๅ–ๅฝ“ๅ‰ๅคฉๆฐ”A

ๆŸฅ่ฏขไธ€ไธชๅŸŽๅธ‚็š„ๅฎžๆ—ถๅคฉๆฐ”๏ผŒๅŒ…ๆ‹ฌๆธฉๅบฆใ€ไฝ“ๆ„Ÿๆธฉๅบฆใ€ๅคฉๆฐ”ๆ่ฟฐใ€้ฃŽ้€Ÿใ€ๆนฟๅบฆใ€่ƒฝ่งๅบฆใ€็ดซๅค–็บฟๆŒ‡ๆ•ฐใ€ๆฐ”ๅŽ‹ใ€‚ๆ”ฏๆŒไธญๆ–‡ๅŸŽๅธ‚ๅ๏ผˆๅฆ‚ 'ๅŒ—ไบฌ'๏ผ‰ๅ’Œ่‹ฑๆ–‡ๅŸŽๅธ‚ๅ๏ผˆๅฆ‚ 'Tokyo'๏ผ‰ใ€‚ไธ้œ€่ฆ API Keyใ€‚

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYesๅŸŽๅธ‚ๅ็งฐ๏ผŒๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑๆ–‡ใ€‚ไพ‹ๅฆ‚๏ผšๅŒ—ไบฌใ€Shanghaiใ€Tokyoใ€Londonใ€New York

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the output fields (temperature, wind, humidity, etc.) and that no API key is needed. It does not explicitly state it is read-only, but the nature of a weather query implies it.

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?

Two sentences, front-loaded with purpose and data points, followed by constraints. No wasted words; highly efficient.

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

Completeness5/5

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

For a simple tool with one parameter and no output schema, the description is complete: it lists all returned data fields, supports both languages, and confirms no API key. No significant gaps.

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%, so the parameter is fully described in the schema. The description adds examples of city names and language support, but these are nearly identical to the schema's description. Thus, minimal added value beyond the schema.

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

Purpose5/5

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

Description clearly states the tool queries real-time weather for a city, listing specific data points (temperature, wind, humidity, etc.). It distinguishes from sibling tools (get_air_quality, get_forecast) by focusing on current weather and specific metrics.

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

Usage Guidelines4/5

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

The description implies use for current weather queries, supports both Chinese and English city names, and mentions no API key needed. However, it does not explicitly state when to use this tool over alternatives like get_forecast or get_air_quality, relying on context from sibling names.

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

get_forecast่Žทๅ–ๅคฉๆฐ”้ข„ๆŠฅA

ๆŸฅ่ฏขไธ€ไธชๅŸŽๅธ‚ๆœชๆฅๅ‡ ๅคฉ็š„ๅคฉๆฐ”้ข„ๆŠฅ๏ผŒๅŒ…ๆ‹ฌๆฏๆ—ฅๆœ€้ซ˜/ๆœ€ไฝŽๆธฉๅบฆๅ’Œๅคฉๆฐ”ๆ่ฟฐใ€‚ๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑๆ–‡ๅŸŽๅธ‚ๅใ€‚

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYesๅŸŽๅธ‚ๅ็งฐ๏ผŒๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑๆ–‡
daysNo้ข„ๆŠฅๅคฉๆ•ฐ๏ผˆ1-3๏ผ‰๏ผŒ้ป˜่ฎคไธบ 3

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description must convey behavioral traits. It explains output includes highs/lows and weather description but omits details like input validation (e.g., invalid city handling), rate limits, authorization requirements, or whether it is a read-only operation. This is insufficient for a tool without annotations.

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 two sentences long, front-loaded with the core purpose, and contains no redundant information. Every sentence is functional and contributes to understanding.

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?

Given the tool's simplicity and full schema coverage, the description covers the main functionality. However, it lacks details on return format (e.g., temperature units, structure) and error handling for invalid cities. This is adequate but not comprehensive.

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%, so the schema already documents both parameters. The description adds value by noting that city names can be in Chinese or English, but does not elaborate on the 'days' parameter beyond what the schema provides (range 1-3, default 3). Baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool's purpose: querying a city's weather forecast for the next few days, including daily high/low temperatures and weather description. It also notes support for Chinese and English city names, distinguishing it from sibling tools like get_current_weather.

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

Usage Guidelines3/5

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

The description does not explicitly provide guidance on when to use this tool versus alternatives (get_air_quality, get_current_weather). Usage context is implied by the name and description but lacks explicit differentiation or exclusion criteria.

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

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct weather aspect: air quality, current weather, and forecast. There is no overlap in purpose.

Naming Consistency5/5

All tools follow the consistent 'get_' prefix with a noun describing the data type: get_air_quality, get_current_weather, get_forecast.

Tool Count5/5

Three tools is a compact and appropriate number for a weather MCP server, covering the essential weather data endpoints without excess.

Completeness4/5

Covers the core weather needs (current, forecast, air quality). Missing historical data or severe weather alerts, but these are reasonable omissions for a basic weather server.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    Enables AI agents to retrieve real-time weather conditions and forecasts via OpenWeatherMap API. Supports interactive weather queries and travel planning through MCP tools, resources, and prompts.
    2
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides weather data from OpenWeatherMap API through MCP tools and a REST API with OpenAPI support. Enables LLM agents to retrieve current weather, forecasts, and temperature ranges by city or coordinates.
    21
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides weather data from WeatherAPI.com through MCP, enabling AI agents to query current conditions and forecasts via natural language.
    16
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/liuweihongliuxinyu/weather-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server