The server runs on Node.js as its runtime environment, with v18+ recommended.
Supported as an alternative package manager for dependency installation.
Recommended as the primary package manager for installing dependencies.
The MCP server is built using TypeScript for type safety and modern JavaScript features.
Supported as an alternative package manager for dependency installation.
Used for validation of schema parameters for the weather tool, ensuring proper data typing and validation.
mcp-poc
Proyecto de prueba de concepto (POC) para un servidor MCP (Model Context Protocol) usando TypeScript y el SDK oficial.
Descripción
Este proyecto implementa un servidor MCP sencillo que expone una herramienta para obtener el clima actual de una ciudad utilizando la API de Open-Meteo. El servidor se comunica a través de stdin/stdout, lo que lo hace ideal para integraciones o pruebas automatizadas.
Requisitos
- Node.js (recomendado v18+)
- pnpm (o npm/yarn)
Instalación
Uso
Para iniciar el servidor:
El servidor expondrá una herramienta llamada get-weather
que recibe el nombre de una ciudad y retorna información meteorológica actual.
Dependencias principales
@modelcontextprotocol/sdk
: SDK oficial para implementar servidores MCP.zod
: Validación de esquemas para los parámetros de las herramientas.
Estructura principal
main.ts
: Implementación del servidor MCP y la herramienta de clima..gitignore
: Configuración para ignorar archivos y carpetas comunes en proyectos Node.js.
Para poder probar el servidor MCP con el inspector, se puede usar el siguiente comando:
Para agregar el mcp dentro del IDE, hay que seguir el siguiente formato json:
This server cannot be installed
A simple MCP server that provides a tool to fetch current weather information for cities using the Open-Meteo API, communicating through stdin/stdout.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.Last updated -4PythonApache 2.0
- AsecurityAlicenseAqualityAn MCP server that provides real-time weather information including temperature, humidity, wind speed, and sunrise/sunset times through the OpenWeatherMap API.Last updated -1PythonMIT License
- -securityFlicense-qualityA simple MCP service that allows users to query weather conditions for cities worldwide through the Cursor AI assistant.Last updated -JavaScript
- -securityFlicense-qualityAn MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.Last updated -Python