Weather MCP
Weather MCP
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-mcpMé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 buildUso de CLI
# 查询天气
weather-mcp weather 北京
weather-mcp weather Shanghai
# 查看帮助
weather-mcp --help
weather-mcp --versionEjemplo 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 comunesnote: 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 buildStack tecnológico
TypeScript - JavaScript con seguridad de tipos
MCP SDK - Protocolo de contexto de modelo
Commander.js - Framework para CLI
Zod - Validación de esquemas
Vitest - Framework de pruebas
Open-Meteo - API meteorológica gratuita
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.mdCI/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
Agradecimientos
Los datos meteorológicos son proporcionados por la API gratuita de Open-Meteo
Cumple con las especificaciones del Model Context Protocol
This 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
- AlicenseNot gradedqualityDmaintenanceAn 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.1MIT
- FlicenseNot gradedqualityDmaintenanceA 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.
- AlicenseNot gradedqualityCmaintenanceA 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
- FlicenseNot gradedqualityBmaintenanceA minimal MCP server that provides current weather and forecasts for any city using the free Open-Meteo API, no API key required.11
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
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/tengzhijian/weather-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server