weather-mcp-server
README.md
# ๐ค Weather MCP Server
> ไธไธชๆๅฐๅไฝๅฎๆด็ MCP (Model Context Protocol) ๆๅก็ซฏๅฎ็ฐ๏ผไธบ AI Agent ๆไพๅฎๆถๅคฉๆฐๆฅ่ฏข่ฝๅใ
[](https://www.python.org/)
[](https://modelcontextprotocol.io/)
[](LICENSE)
## ไธบไปไนๅ่ฟไธช้กน็ฎ
่ฟๆฏ **ไป้ถๅญฆ AI Agent ๆถๆ** ็ๅฎๆ้กน็ฎ #1ใMCP ๅ่ฎฎๆฏ AI Agent ไธๅค้จไธ็ไบคไบ็ๆ ๅๆฅๅฃโโ็่งฃ MCP ๆฏ็่งฃๆดไธช Agent ๆถๆ็็ฌฌไธๆญฅใๆฌ้กน็ฎ็จๆๅฐ็ไปฃ็ ้๏ผ~200 ่ก๏ผๅฑ็คบ MCP Server ็ๅฎๆด็ๅฝๅจๆใ
## ๅฟซ้ๅผๅง
```bash
# 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` ไธญๆทปๅ ๏ผ
```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
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
ActivityStale
ResponsivenessNo issues