Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Provides real-time weather information for cities worldwide using the OpenWeatherMap API, accessible through natural language queries via the MCP protocol.

README.md

Weather MCP Tool

<p align="center"> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a> </p>

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

  1. Đăng ký OpenWeatherMap API:
  • Truy cập: https://openweathermap.org/api
  • Đăng ký tài khoản miễn phí
  • Lấy API key
  1. 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.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Maps & Location servers.