weather-mcp-server

weather-mcp-server

Provides real-time weather and forecast data via MCP tools, enabling AI agents to query current weather and up to 3-day forecasts for any city.

Category
Visit Server

README

๐ŸŒค Weather MCP Server

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

Python MCP License

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

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured