Skip to main content
Glama
weather-mcp-server

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ใ€‚

Inputs: city (required).

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

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

Inputs: city (required).

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

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

Inputs: city (required), days.

Tool Schema Changelog

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

Loading tool schema changelogโ€ฆ

    TDQS

    A4/5.0

    Scored across 3 tools

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    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.
      13 npm
      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.
      146 npm
      MIT
    • F
      license
      B
      quality
      D
      maintenance
      Provides real-time weather information for cities worldwide using the OpenWeatherMap API, accessible through natural language queries via the MCP protocol.
      1
      -