MCP Weather Service
Servicio Meteorológico del MCP
Este repositorio es un servicio simple que proporciona información meteorológica utilizando el Protocolo de Contexto de Modelo (MCP). Puede obtener información meteorológica de varias ciudades (Fukuoka, Tokio, Osaka, Moscú, Nueva York, etc.).
Tabla de contenido
Related MCP server: Weather MCP
Prerrequisitos
Para completar este proyecto, necesitará el siguiente software:
Node.js (versión 18 y superiores)
npm (generalmente se instala con Node.js)
Git
Cómo instalar
Instalación de Node.js y npm
Descargue el instalador del sitio web oficial de Node.js e instálelo.
Una vez completada la instalación, verifíquela ejecutando el siguiente comando en la Terminal:
node -v
npm -vInstalación de Git
Descargue el instalador del sitio web oficial de Git e instálelo.
Una vez completada la instalación, verifíquela ejecutando el siguiente comando en la Terminal:
git --versionConfiguración del proyecto
Creando un nuevo proyecto
Crea un nuevo directorio y navega hasta él:
mkdir my-weather-mcp
cd my-weather-mcpInicialice su proyecto npm:
npm init -yInstalar los paquetes necesarios:
npm install @modelcontextprotocol/sdk axios zod typescript @types/node https-proxy-agent
npm install --save-dev ts-nodeCree un archivo de configuración de TypeScript:
npx tsc --initEdite su archivo
tsconfig.jsonde la siguiente manera:
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"outDir": "./build",
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}Edite la sección de scripts de su archivo
package.jsonde la siguiente manera:
"scripts": {
"build": "tsc && node -e \"import('fs').then(fs => fs.default.chmodSync('build/index.js', '755'))\"",
"start": "node build/index.js",
"inspect": "npx @modelcontextprotocol/inspector build/index.js",
"dev": "ts-node src/index.ts"
}Crear la estructura del directorio del proyecto:
mkdir -p src testClonar un proyecto existente
Si desea utilizar un proyecto existente, clónelo:
git clone https://github.com/terisuke/my-weather-mcp.git
cd my-weather-mcp
npm installCómo utilizar
Construir y ejecutar
Para construir y ejecutar el proyecto, utilice los siguientes comandos:
npm run build && npm run startUsando el Inspector
Para probar el servicio meteorológico utilizando el Inspector MCP, ejecute el siguiente comando:
npm run build && npm run inspectUna vez que el Inspector esté ejecutándose, puede interactuar con el servicio meteorológico visitando http://127.0.0.1:6274 en su navegador.
Obtener información meteorológica
Utilizando el Inspector, puede obtener información meteorológica de las siguientes ciudades:
Fukuoka
Tokio
Osaka
Moscú
Nueva York
Se pueden especificar otras ciudades, pero deben ser reconocidas por la API de Open-Meteo.
Guía de desarrollo
Estructura de archivos
my-weather-mcp/
├── build/ # コンパイルされたJavaScriptファイル
├── src/ # TypeScriptソースコード
│ └── index.ts # メインのアプリケーションコード
├── test/ # テストファイル
├── package.json # プロジェクト設定
├── tsconfig.json # TypeScript設定
└── README.md # このファイルArreglando el código
Edite el archivo
src/index.tspara agregar o modificar la funcionalidad.Para probar sus cambios, ejecute el siguiente comando:
npm run build && npm run inspectUna vez que esté satisfecho de que los cambios funcionan, confirme los cambios.
Subir a GitHub
Creando tu primer repositorio de GitHub
Vaya a GitHub y cree una cuenta o inicie sesión.
Haga clic en el botón "+" en la parte superior derecha y seleccione "Nuevo repositorio".
Ingrese un nombre de repositorio (por ejemplo,
my-weather-mcp) y agregue una descripción opcional.Configure su repositorio como público o privado y haga clic en "Crear repositorio".
Inicializar y enviar el repositorio local
En el directorio de su proyecto local, inicialice un repositorio Git:
git initAñade tus cambios al área de preparación:
git add .Confirmar los cambios:
git commit -m "初回コミット:MCP天気サービスの実装"Agregue un repositorio remoto (usando la URL del repositorio de GitHub):
git remote add origin https://github.com/ユーザー名/my-weather-mcp.gitEnvíe los cambios al repositorio remoto:
git push -u origin mainEnviar cambios a un repositorio existente
Añade tus cambios al área de preparación:
git add .Confirmar los cambios:
git commit -m "変更内容の説明"Envíe los cambios al repositorio remoto:
git pushCrear una solicitud de extracción
Vaya a la página del repositorio en GitHub.
Haga clic en la pestaña "Solicitudes de extracción" y luego haga clic en el botón "Nueva solicitud de extracción".
Seleccione la rama base y la rama de comparación.
Haga clic en el botón “Crear solicitud de extracción”.
Ingrese un título y una descripción para su solicitud de extracción y haga clic en el botón "Crear solicitud de extracción".
solución de problemas
Problemas y soluciones comunes
Error ERR_PACKAGE_PATH_NOT_EXPORTED
Este error ocurre cuando la ruta de importación del paquete @modelcontextprotocol/sdk es incorrecta. Por favor, arréglelo de la siguiente manera:
// 誤ったインポート
import { McpServer } from "@modelcontextprotocol/sdk";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/transports";
// 正しいインポート
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";Error de conexión de red
Si recibe un error de red al realizar una llamada API, verifique la configuración de su proxy. Puede utilizar un proxy configurando las variables de entorno HTTP_PROXY o HTTPS_PROXY :
export HTTP_PROXY=http://プロキシサーバー:ポート
export HTTPS_PROXY=https://プロキシサーバー:ポートOtros problemas
Si el problema persiste, cree un problema con la siguiente información:
El mensaje de error que se produjo
La versión de Node.js y npm que estás usando
Comando ejecutado
Comportamiento esperado vs. comportamiento real
Available Tools
1 toolget-weatherC
Get weather information for a city
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | City name to get weather for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic function without mentioning any behavioral traits such as rate limits, error handling, data freshness, or authentication requirements. For a tool with no annotations, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance. Every part of the sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like performance, errors, or return format, which are crucial for a tool that fetches dynamic data like weather. The description alone is insufficient for full contextual understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the single parameter 'city' documented as 'City name to get weather for'. The description adds no additional semantic context beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get') and resource ('weather information') with the target ('for a city'). It's specific about what the tool does, but since there are no sibling tools, it doesn't need to differentiate from alternatives. It avoids tautology by not just restating the name.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives or any contextual prerequisites. It simply states the function without indicating scenarios, limitations, or comparisons to other tools. This leaves usage entirely implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
- First observed
get-weather
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool 'get-weather' has a clear, singular purpose that cannot be confused with any other tool in the set.
The single tool name 'get-weather' follows a consistent verb_noun pattern, and with only one tool, there is no inconsistency or deviation to evaluate. The naming is straightforward and predictable.
A single tool for a weather service is too few for the apparent scope, as it lacks basic operations like forecasts, historical data, or multi-location queries. This minimal set feels thin and incomplete for a typical weather domain.
The tool surface is severely incomplete for a weather service. It only provides current weather for a city, missing essential operations such as forecasts, alerts, historical data, or support for multiple locations, which are core to weather-related workflows.
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
MCP server for weather with reasoning — umbrella advice, outdoor checks, city comparisons.
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.82,198 PyPI61Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides current weather information and 3-day forecasts for specified cities using the Open-Meteo API.1-
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides real-time weather data and forecasts for any city.11 npmISC
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides weather information using the Open-Meteo API, allowing users to get current weather for specific cities and retrieve weather data for date ranges.Apache 2.0