Weather Tool
БесплатноНе проверенProvides real-time weather information for cities worldwide using the OpenWeatherMap API, accessible through natural language queries via the MCP protocol.
Описание
Provides real-time weather information for cities worldwide using the OpenWeatherMap API, accessible through natural language queries via the MCP protocol.
README
Description
Weather MCP Tool là một ứng dụng NestJS cung cấp thông tin thời tiết thông qua Model Context Protocol (MCP). Ứng dụng sử dụng OpenWeatherMap API để lấy dữ liệu thời tiết thực tế cho các thành phố trên toàn thế giới.
Tính năng
- 🌤️ Thông tin thời tiết thực tế: Lấy dữ liệu từ OpenWeatherMap API
- 🌍 Hỗ trợ đa ngôn ngữ: Mô tả thời tiết bằng tiếng Việt
- 📊 Thông tin chi tiết: Nhiệt độ, độ ẩm, tốc độ gió, nhiệt độ cảm giác
- 🔧 MCP Tool Integration: Tích hợp với Model Context Protocol
- 🚀 NestJS Framework: Xây dựng trên NestJS với TypeScript
- 🐳 Docker Support: Hỗ trợ chạy trong Docker container
Cài đặt
Cách 1: Cài đặt trực tiếp
# Clone repository
git clone <repository-url>
cd weather-mcp-nest
# Cài đặt dependencies
npm install
Cách 2: Sử dụng Docker
# Clone repository
git clone <repository-url>
cd weather-mcp-nest
# Build và chạy với Docker Compose
docker-compose up --build
Cấu hình
Đăng ký OpenWeatherMap API:
- Truy cập: https://openweathermap.org/api
- Đăng ký tài khoản miễn phí
- Lấy API key
Tạo file .env:
OPENWEATHER_API_KEY=your_api_key_here
Chạy ứng dụng
Development Mode
# Development mode
npm run start:dev
# Production mode
npm run start:prod
Docker Mode
# Build Docker image
docker build -t weather-mcp .
# Chạy container
docker run -p 3000:3000 --env-file .env weather-mcp
# Hoặc sử dụng Docker Compose
docker-compose up
Sử dụng MCP Tool
Sau khi khởi động server, tool sẽ có sẵn thông qua MCP protocol:
Tool: getWeather
Mô tả: Lấy thông tin thời tiết cho một thành phố
Tham số:
city(string): Tên thành phố (VD: "Da Nang", "London", "New York")
Ví dụ sử dụng:
{
"name": "getWeather",
"arguments": {
"city": "Da Nang"
}
}
Kết quả:
Thời tiết ở Da Nang: mây cụm, nhiệt độ 28°C (cảm giác như 33°C), độ ẩm 82%, gió 3.49 m/s.
Cấu trúc dự án
src/
├── weather/
│ ├── weather.controller.ts # REST API controller
│ ├── weather.service.ts # Weather service logic
│ ├── weather.tool.ts # MCP tool implementation
│ └── weather.module.ts # Weather module
├── app.module.ts # Main application module
└── main.ts # Application entry point
API Endpoints
POST /weather
Lấy thông tin thời tiết qua REST API
Request Body:
{
"city": "Da Nang"
}
Response:
{
"content": {
"type": "text",
"text": "Thời tiết ở Da Nang: mây cụm, nhiệt độ 28°C (cảm giác như 33°C), độ ẩm 82%, gió 3.49 m/s."
}
}
MCP Configuration
Cấu hình MCP trong .cursor/mcp.json:
{
"mcpServers": {
"weather": {
"url": "http://localhost:3000/mcp",
"type": "http"
}
}
}
Dependencies
- @nestjs/common: NestJS core framework
- @rekog/mcp-nest: MCP integration for NestJS
- axios: HTTP client for API calls
- dotenv: Environment variables management
- zod: Schema validation
Phát triển
Chạy tests
# Unit tests
npm run test
# E2E tests
npm run test:e2e
# Test coverage
npm run test:cov
Linting
npm run lint
Docker Commands
Build và chạy
# Build image
docker build -t weather-mcp .
# Chạy container
docker run -p 3000:3000 --env-file .env weather-mcp
# Chạy với Docker Compose
docker-compose up --build
Quản lý container
# Xem logs
docker-compose logs -f
# Dừng container
docker-compose down
# Restart container
docker-compose restart
Development với Docker
# Chạy trong development mode
docker-compose -f docker-compose.dev.yml up
License
MIT License - xem file LICENSE để biết thêm chi tiết.
Установка Weather Tool
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/thuong204/mcp-weatherFAQ
Weather Tool MCP бесплатный?
Да, Weather Tool MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Weather Tool?
Нет, Weather Tool работает без API-ключей и переменных окружения.
Weather Tool — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Weather Tool в Claude Desktop, Claude Code или Cursor?
Открой Weather Tool на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Weather Tool with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
