weather-mcp

weather-mcp
Servidor MCP en TypeScript que expone herramientas meteorológicas respaldadas por OpenWeatherMap.
Herramientas
Herramienta | Descripción |
| Condiciones actuales por nombre de ciudad o lat/lon |
| Pronóstico de 5 días / 3 horas por lat/lon |
Transportes
Modo | Env | Úsalo cuando |
|
| Cursor local / Claude Desktop |
Streamable HTTP |
| Despliegue (Render, etc.) / URL remota |
Documentación oficial de MCP: https://modelcontextprotocol.io/docs/
En vivo remoto (Render)
Desplegado en el plan gratuito de Render:
URL base | |
Endpoint MCP | |
Comprobación de salud |
Configuración de Cursor (remoto)
Añade esto a Settings → MCP o ~/.cursor/mcp.json:
{
"mcpServers": {
"weather": {
"url": "https://weather-mcp-ts.onrender.com/mcp"
}
}
}Sin compilación local ni clave API en Cursor: la clave vive en las variables de entorno de Render.
Plan gratuito de Render: el servicio se apaga tras ~15 minutos de inactividad. La siguiente petición es un arranque en frío y puede tardar hasta ~50 segundos antes de que MCP responda. Llama a
/healthuna vez si las herramientas de Cursor parecen atascadas al despertar.
Related MCP server: mcp-weatherapi
Requisitos previos (solo local)
Node.js 20+
pnpm (o npm/yarn)
Una clave API de OpenWeatherMap (consíguela aquí)
Configuración (local)
pnpm install
cp .env.example .envEdita .env y establece tu clave:
OPEN_WEATHER_MAP_API_KEY=your_key_here
TRANSPORT=stdioCompila el servidor:
pnpm run buildEsto escribe el punto de entrada ejecutable en dist/index.js.
Añadir a Cursor (stdio local)
Cursor no inicia este proceso desde la raíz del proyecto por defecto para la carga de variables de entorno, así que pasa el archivo de entorno con una ruta absoluta mediante la bandera --env-file de Node.
Abre Cursor Settings → MCP, o edita
~/.cursor/mcp.json.Añade una entrada
weatherbajomcpServers:
{
"mcpServers": {
"weather": {
"command": "node",
"args": [
"--env-file",
"/ABSOLUTE/PATH/TO/weather-mcp/.env",
"/ABSOLUTE/PATH/TO/weather-mcp/dist/index.js"
]
}
}
}Reemplaza /ABSOLUTE/PATH/TO/weather-mcp con tu ruta real del proyecto (p. ej. ejecuta pwd desde la raíz del repositorio). Mantén TRANSPORT=stdio (o sin definir) en .env.
Alternativa: env en línea
{
"mcpServers": {
"weather": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/weather-mcp/dist/index.js"
],
"env": {
"OPEN_WEATHER_MAP_API_KEY": "your_key_here",
"TRANSPORT": "stdio"
}
}
}
}Prefiere .env + --env-file para que la clave no quede en mcp.json.
Guarda y luego alterna el servidor apagado/encendido en Settings → MCP (o reinicia Cursor).
Confirma que el servidor aparece como conectado y lista
get_current_weatheryget_forecast.
Tras cambios de código
pnpm run buildLuego recarga el servidor MCP en Cursor.
Streamable HTTP (local)
El modo HTTP sirve MCP en POST/GET /mcp (configurable) además de GET /health. Streamable HTTP se configura mediante createMcpHandler + toNodeHandler del SDK oficial.
pnpm run build
TRANSPORT=http PORT=3000 pnpm run start
# or
pnpm run start:httpDeberías ver algo como:
Weather MCP Server running on http://0.0.0.0:3000/mcp (Streamable HTTP)Desplegar en Render
Crea un Web Service desde este repositorio (raíz del proyecto).
Compila:
pnpm install && pnpm run build(o el equivalente connpm).Inicia:
node dist/index.js(opnpm run start).Variables de entorno:
TRANSPORT=httpOPEN_WEATHER_MAP_API_KEY=...PORTlo establece Render automáticamente
URL de MCP:
https://<your-service>.onrender.com/mcp
Este despliegue:https://weather-mcp-ts.onrender.com/mcp
El endpoint HTTP no está autenticado. Cualquiera con la URL puede llamar a las herramientas. Añade autenticación antes de compartirlo ampliamente.
Comprobación manual rápida (OpenWeatherMap)
Con .env configurado:
node --env-file=.env -e "
import { getApiKey, buildCurrentWeatherUrl, makeOWMRequest, formatCurrentWeather } from './dist/utils.js';
const apiKey = getApiKey();
const data = await makeOWMRequest(buildCurrentWeatherUrl({ apiKey, city: 'Yaounde,CM', units: 'metric' }));
console.log(data ? formatCurrentWeather(data, 'metric') : 'failed');
"Salud remota:
curl -s https://weather-mcp-ts.onrender.com/healthEstructura del repositorio
weather-mcp/
├── README.md
├── package.json
├── tsconfig.json
├── .env.example
└── src/
├── index.ts # stdio + Streamable HTTP entry
├── server.ts # tool registration
├── types.ts
└── utils.tsNotas
Nunca hagas commit de
.env(está en gitignore).Los servidores stdio no deben escribir en stdout salvo JSON-RPC de MCP; los registros van a stderr (
console.error).Los planes gratuitos de OpenWeatherMap cubren el clima actual y el pronóstico de 5 días / 3 horas usado aquí.
Licencia
ISC
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 gradedqualityCmaintenanceWraps the OpenWeatherMap API to provide weather data through MCP, enabling AI agents to query current conditions, forecasts, and other weather information via natural language.10MIT
- AlicenseNot gradedqualityCmaintenanceProvides weather data from WeatherAPI.com through MCP, enabling AI agents to query current conditions and forecasts via natural language.11MIT
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients like Kiro and Claude to access current weather conditions and forecasts for any location using the OpenWeatherMap API.
- AlicenseNot gradedqualityDmaintenanceIntegrates OpenWeatherMap API with MCP to provide weather data, forecasts, air quality, maps, alerts, and geocoding via natural language.10MIT
Related MCP Connectors
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
WeatherAPI.com MCP — wraps WeatherAPI.com (api.weatherapi.com)
Visual Crossing Weather MCP — wraps the Visual Crossing Weather Timeline API
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/RashJrEdmund/Weather-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server