Weather MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Weather MCP Serverwhat's the weather in Tokyo?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🌤 Weather MCP Server
Custom MCP Server cung cấp dữ liệu thời tiết thực thời & lịch sử cho các AI Assistant (Claude, Cursor, VS Code Cline…) thông qua giao thức Model Context Protocol (MCP).
✨ Tính năng
# | Tool | Mô tả |
1 |
| Tìm tọa độ (lat/lon) từ tên thành phố |
2 |
| Thời tiết hiện tại theo tọa độ (nhiệt độ, độ ẩm, gió, áp suất, tầm nhìn…) |
3 |
| Dự báo thời tiết theo ngày, tối đa 7 ngày |
4 |
| Thời tiết hiện tại theo tên thành phố (tự động geocode, 1 bước) |
5 |
| Chỉ số chất lượng không khí: PM2.5, PM10, CO, NO₂, O₃, SO₂, AQI châu Âu |
6 |
| Dữ liệu thời tiết lịch sử từ năm 1940 đến nay |
Related MCP server: Weather MCP Server
🗂 Cấu trúc dự án
custom MCP server/
├── weather_server.py # MCP Server chính (6 tools)
├── requirements.txt # Các thư viện cần thiết
└── README.md📋 Yêu cầu hệ thống
Python 3.10+
pip
🚀 Cài đặt
# 1. Di chuyển vào thư mục dự án
cd "e:\TUYENDUNG\custom MCP server"
# 2. (Khuyến nghị) Tạo môi trường ảo
python -m venv .venv
.venv\Scripts\Activate.ps1
# 3. Cài đặt dependencies
pip install -r requirements.txt🧪 Chạy thử với MCP Inspector
mcp dev weather_server.pyTrình duyệt sẽ tự mở tại http://localhost:5173 — giao diện web để gọi thử từng tool trực tiếp.
⚙️ Tích hợp vào Claude Desktop
1. Mở file cấu hình:
Hệ điều hành | Đường dẫn |
Windows |
|
macOS |
|
2. Thêm vào mục mcpServers:
{
"mcpServers": {
"weather": {
"command": "python",
"args": ["e:\\TUYENDUNG\\custom MCP server\\weather_server.py"]
}
}
}Nếu dùng môi trường ảo, thay
"python"bằng đường dẫn tuyệt đối:"e:\\TUYENDUNG\\custom MCP server\\.venv\\Scripts\\python.exe"
3. Khởi động lại Claude Desktop — server sẽ được load tự động.
⚙️ Tích hợp vào Cursor / VS Code (Cline)
Thêm vào file cấu hình MCP của extension:
{
"weather": {
"command": "python",
"args": ["e:\\TUYENDUNG\\custom MCP server\\weather_server.py"]
}
}📖 Hướng dẫn sử dụng từng Tool
🔍 1. geocode_city — Tìm tọa độ thành phố
Tìm vĩ độ (latitude) và kinh độ (longitude) từ tên thành phố.
geocode_city("Da Nang")Kết quả mẫu:
Kết quả tìm kiếm cho 'Da Nang':
1. Đà Nẵng, Thành phố Đà Nẵng, Việt Nam
📍 Tọa độ : lat=16.0544, lon=108.2022
🏔 Độ cao : 10 m🌡 2. get_current_weather — Thời tiết hiện tại theo tọa độ
get_current_weather(latitude=16.0544, longitude=108.2022)Thông tin trả về: Nhiệt độ, cảm giác thực, độ ẩm, lượng mưa, áp suất, tốc độ & hướng gió, gió giật, tầm nhìn, tình trạng trời.
📅 3. get_forecast — Dự báo thời tiết 1–7 ngày
get_forecast(latitude=16.0544, longitude=108.2022, days=3)Thông tin trả về theo từng ngày: Nhiệt độ max/min, cảm giác thực, lượng mưa, xác suất mưa, gió max, giờ bình minh/hoàng hôn.
🏙 4. get_weather_by_city — Thời tiết nhanh theo tên thành phố
Gọi 1 bước, không cần tọa độ thủ công.
get_weather_by_city("Ho Chi Minh")💨 5. get_air_quality — Chất lượng không khí
get_air_quality("Hanoi")Chỉ số trả về: PM2.5, PM10, CO, NO₂, SO₂, O₃, bụi sa mạc, AQI châu Âu kèm đánh giá mức độ.
AQI | Mức độ |
0–20 | 🟢 Rất tốt |
21–40 | 🟢 Tốt |
41–60 | 🟡 Trung bình |
61–80 | 🟠 Kém |
81–100 | 🔴 Xấu |
> 100 | 🟣 Rất xấu |
📜 6. get_historical_weather — Thời tiết lịch sử
Dữ liệu từ 1940 đến nay, khoảng cách khuyến nghị tối đa 31 ngày/lần gọi.
get_historical_weather(
city_name="Hanoi",
start_date="2024-01-01",
end_date="2024-01-07"
)Thông tin trả về theo từng ngày: Nhiệt độ max/min, lượng mưa, tốc độ & hướng gió, giờ bình minh/hoàng hôn, tình trạng thời tiết.
💡 Ví dụ thực tế (luồng đầy đủ)
# Bước 1 — Tìm tọa độ Hà Nội
geocode_city("Ha Noi")
# → lat=21.0285, lon=105.8542
# Bước 2 — Xem thời tiết hiện tại
get_current_weather(21.0285, 105.8542)
# Bước 3 — Xem dự báo 3 ngày tới
get_forecast(21.0285, 105.8542, days=3)
# Hoặc gọn hơn (1 bước)
get_weather_by_city("Ha Noi")
# Chất lượng không khí
get_air_quality("Ha Noi")
# Thời tiết tuần trước
get_historical_weather("Ha Noi", "2024-12-01", "2024-12-07")🗃 Nguồn dữ liệu
API | Dùng cho |
Thời tiết hiện tại & dự báo | |
Tìm tọa độ thành phố | |
Chất lượng không khí | |
Dữ liệu lịch sử từ 1940 |
Mã thời tiết tuân theo chuẩn WMO (World Meteorological Organization).
📦 Dependencies
mcp[cli]>=1.0.0
httpx>=0.27.0This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides comprehensive weather data and forecasts through the OpenWeatherMap API, enabling AI assistants to access real-time weather information, forecasts, air quality data, and location services.Last updated11894MIT
- Flicense-qualityDmaintenanceProvides real-time weather information and forecasts, connecting AI assistants with live weather data for current conditions and multi-day forecasts for any location worldwide.Last updated
- Flicense-qualityDmaintenanceProvides real-time weather data including temperature, humidity, and conditions for any city through the Model Context Protocol.Last updated4
- Flicense-qualityDmaintenanceProvides weather information through the Model Context Protocol, fetching real-time weather data from OpenWeather API or using simulated data when API key is not configured.Last updated46
Related MCP Connectors
Global weather via Open-Meteo: forecast, ERA5 archive, marine, air quality, geocoding, elevation.
Swiss weather data for AI assistants — forecasts, measurements, stations, pollen.
Air Quality MCP — wraps air-quality-api.open-meteo.com (free, no auth)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/manh20051151/MCP-Server-weather'
If you have feedback or need assistance with the MCP directory API, please join our Discord server