Weather MCP Server

Weather MCP Server

Enables real-time weather information retrieval and local search history management using Open Meteo APIs. Allows users to get current weather data for any city and access their weather query history through natural language.

Category
Visit Server

README

🌀️ Weather Server - MCP Implementation (Node.js)

🧩 Servidor MCP de Clima e Historial – VersiΓ³n Final

Este proyecto implementa un servidor MCP (Model Context Protocol) en Node.js que permite a modelos de lenguaje (como Claude o GPT) obtener informaciΓ³n climΓ‘tica en tiempo real y consultar un historial local de bΓΊsquedas, utilizando APIs abiertas y almacenamiento local en JSON.


🌐 1. ¿Qué es el MCP (Model Context Protocol)?

El Model Context Protocol (MCP) es un protocolo abierto desarrollado por Anthropic y la comunidad de IA para conectar modelos de lenguaje con fuentes de informaciΓ³n externas y herramientas locales de manera segura y estructurada.

En tΓ©rminos simples:

El MCP permite que un modelo de IA hable con tu aplicaciΓ³n, acceda a datos o ejecute funciones, sin exponer directamente tu cΓ³digo ni tus APIs privadas.


βš™οΈ 2. CΓ³mo funciona el MCP

Un MCP Server es una aplicaciΓ³n que expone:

  • πŸ› οΈ Tools (herramientas) β†’ Acciones que el modelo puede ejecutar (por ejemplo: get-weather, get-history).
  • πŸ“š Resources (recursos) β†’ Archivos o datos a los que el modelo puede acceder (por ejemplo: weather-codes.json).
  • πŸ”” Events (opcional) β†’ Notificaciones o flujos de datos en tiempo real.

El modelo de IA actΓΊa como cliente MCP, que se comunica con tu servidor usando un canal seguro (en este caso, stdio, o entrada/salida estΓ‘ndar).


🧩 3. Descripción del proyecto (main.ts)

El archivo main.ts define un servidor MCP en Node.js que ofrece dos herramientas y un recurso:


πŸ› οΈ Herramienta 1: get-weather

PropΓ³sito: Obtener el clima actual de una ciudad.

Flujo:

  1. Busca la ciudad en la Geocoding API de Open Meteo para obtener coordenadas.
  2. Consulta los datos del clima actual en la Weather API de Open Meteo.
  3. Guarda la consulta (ciudad, coordenadas, temperatura, fecha) en un archivo local history.json.
  4. Devuelve al modelo una respuesta simplificada con temperatura y humedad.

πŸ“„ Ejemplo de respuesta:

{
  "city_searched": "Santiago",
  "current_temperature_c": 22.5,
  "relative_humidity_percent": 48,
  "weather_code": 1
}

🧠 **Arquitectura conceptual**

          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚      Modelo de IA (Cliente)  β”‚
          β”‚    (Claude, GPT, etc.)       β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
            JSON (via STDIO / MCP)
                        β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚     Tu Servidor MCP (Node)   β”‚
          β”‚ β”œβ”€β”€ Tool: get-weather        β”‚
          β”‚ β”œβ”€β”€ Tool: get-history        β”‚
          β”‚ └── Resource: weather-codes  β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚     APIs externas (OpenMeteo)β”‚
          β”‚     Archivos locales (.json) β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


πŸ“¦ **InstalaciΓ³n y ejecuciΓ³n**

# Clonar el repositorio
git clone https://github.com/IAcademico/weather-mcp-server.git
cd weather-mcp-server

# Instalar dependencias
npm install

# Ejecutar el servidor MCP
npm run start

πŸ“ **Estructura del proyecto**

πŸ“¦ weather-mcp-server
 ┣ πŸ“‚ .vscode/
 ┣ πŸ“‚ node_modules/
 ┣ πŸ“‚ project_scanners/
 ┣ πŸ“œ main.ts
 ┣ πŸ“œ history.json
 ┣ πŸ“œ weather-codes.json
 β”— πŸ“œ README.md

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured