Skip to main content
Glama
tengzhijian

Weather MCP

by tengzhijian

Weather MCP

CI npm version License: MIT

A simple and easy-to-use weather query MCP tool, supporting both CLI and MCP Server usage modes.

Features

  • šŸŒ¤ļø Real-time Weather Query - Get current weather for any city worldwide

  • šŸ”§ CLI Support - Query weather directly from the command line

  • šŸ¤– MCP Protocol - Supports AI clients like Claude and Cursor

  • šŸŒ Global Coverage - Supports city names in multiple languages including Chinese and English

  • ⚔ Free API - Uses the free Open-Meteo weather service, no API Key required

  • šŸ“ Type Safe - Full TypeScript + Zod type support

Related MCP server: Weather MCP Server

Installation

npm install -g weather-mcp

Method 2: Use directly with npx

npx weather-mcp weather åŒ—äŗ¬

Method 3: Source installation

git clone https://github.com/tengzhijian/weather-mcp.git
cd weather-mcp
npm install
npm run build

CLI Usage

# ęŸ„čÆ¢å¤©ę°”
weather-mcp weather åŒ—äŗ¬
weather-mcp weather Shanghai

# ęŸ„ēœ‹åø®åŠ©
weather-mcp --help
weather-mcp --version

Example Output

{
  "ok": true,
  "data": {
    "city": "åŒ—äŗ¬ (中国)",
    "temperature": 22,
    "humidity": 70,
    "description": "å¤šäŗ‘",
    "windSpeed": 9.3,
    "updatedAt": "2024-01-15T08:30:00.000Z"
  }
}

MCP Server Configuration

Claude Desktop

Edit %APPDATA%/Claude/settings.json (Windows) or ~/Library/Application Support/Claude/settings.json (Mac):

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "weather-mcp", "--mcp"]
    }
  }
}

Cursor

Add in Cursor Settings → MCP:

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "weather-mcp", "--mcp"]
    }
  }
}

Local Development Version

If you are running from source:

{
  "mcpServers": {
    "weather": {
      "command": "node",
      "args": ["/path/to/weather-mcp/dist/index.js", "--mcp"]
    }
  }
}

Available Tools

getWeather

Query weather information for a specified city.

Parameters:

  • city (string, required): City name, e.g., Beijing, Shanghai, Guangzhou, London, Tokyo

Returns:

  • city: City name (including country)

  • temperature: Temperature (Celsius)

  • humidity: Humidity (percentage)

  • description: Weather description (sunny, cloudy, etc.)

  • windSpeed: Wind speed (km/h)

  • updatedAt: Data update time

listSupportedCities

Get a list of example cities supported for queries.

Returns:

  • cities: List of common city examples

  • note: Note (actually supports any city worldwide)

AI Client Usage Examples

After configuration, you can ask directly in clients like Claude or Cursor:

"What is the weather in Beijing today?" "Will it rain in Shanghai tomorrow?" "Check the weather in New York"

The AI will automatically call the getWeather tool to retrieve weather information.

Development

# å®‰č£…ä¾čµ–
npm install

# å¼€å‘ęØ”å¼
npm run dev weather åŒ—äŗ¬

# čæč”Œęµ‹čÆ•
npm test

# ē±»åž‹ę£€ęŸ„
npm run typecheck

# ęž„å»ŗ
npm run build

Tech Stack

Project Structure

weather-mcp/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts           # å…„å£ę–‡ä»¶
│   ā”œā”€ā”€ cli.ts             # CLI 命令
│   ā”œā”€ā”€ mcp-server.ts      # MCP Server
│   ā”œā”€ā”€ weather-gateway.ts # 天气 API 封装
│   └── version.ts         # ē‰ˆęœ¬å·
ā”œā”€ā”€ tests/                 # 测试文件
ā”œā”€ā”€ .github/workflows/     # GitHub Actions
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
└── README.md

CI/CD

The project uses GitHub Actions for automation:

  • CI: Automatically runs tests on every PR and Push (Node.js 18/20/22)

  • Release: Manually triggered release to npm

License

MIT

Acknowledgments

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that provides real-time weather data, hourly forecasts, and daily summaries using the free Open-Meteo API with no API key required. It enables users to search for weather conditions by specific coordinates or city names across multiple measurement units.
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A production-ready MCP server that provides real-time weather information, forecasts, and alerts to LLM clients using the Open-Meteo API, with support for 26+ global cities, dual transport (STDIO/HTTP), and Docker deployment.
  • A
    license
    Not graded
    quality
    C
    maintenance
    A no-API-key-required MCP server that wraps Open-Meteo APIs to provide geocoding and weather forecast data, enabling city lookups and multi-day forecasts through tools, resources, and prompts.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    A minimal MCP server that provides current weather and forecasts for any city using the free Open-Meteo API, no API key required.
    11

View all related MCP servers

Related MCP Connectors

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • MCP server for GLM chat completions using Zhipu AI models via AceDataCloud

View all MCP Connectors

Latest Blog Posts

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/tengzhijian/weather-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server