Skip to main content
Glama
tengzhijian

Weather MCP

by tengzhijian

Weather MCP

CI npm version License: MIT

Una herramienta MCP sencilla y fácil de usar para consultar el clima, que admite tanto el uso mediante línea de comandos (CLI) como a través de un servidor MCP.

Características

  • 🌤️ Consulta meteorológica en tiempo real - Obtén el clima actual de cualquier ciudad del mundo.

  • 🔧 Soporte CLI - Consulta el clima directamente desde la línea de comandos.

  • 🤖 Protocolo MCP - Compatible con clientes de IA como Claude y Cursor.

  • 🌍 Cobertura global - Admite nombres de ciudades en varios idiomas, incluidos chino e inglés.

  • API gratuita - Utiliza el servicio meteorológico gratuito de Open-Meteo, sin necesidad de una API Key.

  • 📝 Seguridad de tipos - Soporte completo de tipos con TypeScript + Zod.

Related MCP server: Weather MCP Server

Instalación

Método 1: Instalación global con npm (recomendado)

npm install -g weather-mcp

Método 2: Uso directo con npx

npx weather-mcp weather 北京

Método 3: Instalación desde el código fuente

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

Uso de CLI

# 查询天气
weather-mcp weather 北京
weather-mcp weather Shanghai

# 查看帮助
weather-mcp --help
weather-mcp --version

Ejemplo de salida

{
  "ok": true,
  "data": {
    "city": "北京 (中国)",
    "temperature": 22,
    "humidity": 70,
    "description": "多云",
    "windSpeed": 9.3,
    "updatedAt": "2024-01-15T08:30:00.000Z"
  }
}

Configuración del servidor MCP

Claude Desktop

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

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

Cursor

En Cursor Settings → MCP, añade:

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

Versión de desarrollo local

Si ejecutas desde el código fuente:

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

Herramientas disponibles

getWeather

Consulta la información meteorológica de una ciudad específica.

Parámetros:

  • city (string, obligatorio): Nombre de la ciudad, por ejemplo: Beijing, Shanghai, Guangzhou, London, Tokyo

Retorno:

  • city: Nombre de la ciudad (incluye el país)

  • temperature: Temperatura (grados Celsius)

  • humidity: Humedad (porcentaje)

  • description: Descripción del clima (despejado, nublado, etc.)

  • windSpeed: Velocidad del viento (km/h)

  • updatedAt: Hora de actualización de los datos

listSupportedCities

Obtén una lista de ejemplo de ciudades compatibles para consultar.

Retorno:

  • cities: Lista de ejemplo de ciudades comunes

  • note: Nota (en realidad, admite cualquier ciudad del mundo)

Ejemplos de uso en clientes de IA

Una vez configurado, puedes preguntar directamente en clientes como Claude o Cursor:

"¿Cómo está el clima hoy en Beijing?" "¿Va a llover mañana en Shanghai?" "Consulta el clima en Nueva York"

La IA llamará automáticamente a la herramienta getWeather para obtener la información meteorológica.

Desarrollo

# 安装依赖
npm install

# 开发模式
npm run dev weather 北京

# 运行测试
npm test

# 类型检查
npm run typecheck

# 构建
npm run build

Stack tecnológico

Estructura del proyecto

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

El proyecto utiliza GitHub Actions para la automatización:

  • CI: Ejecuta pruebas automáticamente en cada PR y Push (Node.js 18/20/22)

  • Release: Publicación manual en npm

Licencia

MIT

Agradecimientos

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