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.
README
๐ค Weather MCP Server
ไธไธชๆๅฐๅไฝๅฎๆด็ MCP (Model Context Protocol) ๆๅก็ซฏๅฎ็ฐ๏ผไธบ AI Agent ๆไพๅฎๆถๅคฉๆฐๆฅ่ฏข่ฝๅใ
ไธบไปไนๅ่ฟไธช้กน็ฎ
่ฟๆฏ ไป้ถๅญฆ 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 # ๅๅ
ๆต่ฏ + ้ๆๆต่ฏ
ๅญฆไผไบไปไน
้่ฟ่ฟไธช้กน็ฎไฝ ๅฏไปฅ็่งฃ๏ผ
- MCP ๅ่ฎฎไธๅฑๆจกๅ: Host โ Client โ Server
- JSON-RPC 2.0: MCP ็ๅบๅฑไผ ่พๆ ผๅผ
- stdio transport: ่ฟ็จ้ด้่ฟๆ ๅ่พๅ ฅ่พๅบ้ไฟก
- Tool ๅฎไน: name + description + input_schema๏ผAI ๅฆไฝๅน้ ๅทฅๅ ท
- ไธๅก้ป่พไธๅ่ฎฎ่งฃ่ฆ: fetch_weather() ไธ็ฅ้ MCP ็ๅญๅจ
- ้่ฏฏๅค็: MCP ๅ่ฎฎ่ฆๆฑ่ฟๅ is_error ่้ๆๅผๅธธ
License
MIT
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.