Skip to main content
Glama
MCP Weather Service

MCP Weather Service

by terisuke

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

  1. Prerrequisitos

  2. Configuración del proyecto

  3. Cómo utilizar

  4. Guía de desarrollo

  5. Subir a GitHub

  6. solución de problemas

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

  1. Descargue el instalador del sitio web oficial de Node.js e instálelo.

  2. Una vez completada la instalación, verifíquela ejecutando el siguiente comando en la Terminal:

node -v
npm -v

Instalación de Git

  1. Descargue el instalador del sitio web oficial de Git e instálelo.

  2. Una vez completada la instalación, verifíquela ejecutando el siguiente comando en la Terminal:

git --version

Configuración del proyecto

Creando un nuevo proyecto

  1. Crea un nuevo directorio y navega hasta él:

mkdir my-weather-mcp
cd my-weather-mcp
  1. Inicialice su proyecto npm:

npm init -y
  1. Instalar los paquetes necesarios:

npm install @modelcontextprotocol/sdk axios zod typescript @types/node https-proxy-agent
npm install --save-dev ts-node
  1. Cree un archivo de configuración de TypeScript:

npx tsc --init
  1. Edite su archivo tsconfig.json de 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"]
}
  1. Edite la sección de scripts de su archivo package.json de 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"
}
  1. Crear la estructura del directorio del proyecto:

mkdir -p src test

Clonar 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 install

Cómo utilizar

Construir y ejecutar

Para construir y ejecutar el proyecto, utilice los siguientes comandos:

npm run build && npm run start

Usando el Inspector

Para probar el servicio meteorológico utilizando el Inspector MCP, ejecute el siguiente comando:

npm run build && npm run inspect

Una 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

  1. Edite el archivo src/index.ts para agregar o modificar la funcionalidad.

  2. Para probar sus cambios, ejecute el siguiente comando:

npm run build && npm run inspect
  1. Una vez que esté satisfecho de que los cambios funcionan, confirme los cambios.

Subir a GitHub

Creando tu primer repositorio de GitHub

  1. Vaya a GitHub y cree una cuenta o inicie sesión.

  2. Haga clic en el botón "+" en la parte superior derecha y seleccione "Nuevo repositorio".

  3. Ingrese un nombre de repositorio (por ejemplo, my-weather-mcp ) y agregue una descripción opcional.

  4. Configure su repositorio como público o privado y haga clic en "Crear repositorio".

Inicializar y enviar el repositorio local

  1. En el directorio de su proyecto local, inicialice un repositorio Git:

git init
  1. Añade tus cambios al área de preparación:

git add .
  1. Confirmar los cambios:

git commit -m "初回コミット:MCP天気サービスの実装"
  1. Agregue un repositorio remoto (usando la URL del repositorio de GitHub):

git remote add origin https://github.com/ユーザー名/my-weather-mcp.git
  1. Envíe los cambios al repositorio remoto:

git push -u origin main

Enviar cambios a un repositorio existente

  1. Añade tus cambios al área de preparación:

git add .
  1. Confirmar los cambios:

git commit -m "変更内容の説明"
  1. Envíe los cambios al repositorio remoto:

git push

Crear una solicitud de extracción

  1. Vaya a la página del repositorio en GitHub.

  2. Haga clic en la pestaña "Solicitudes de extracción" y luego haga clic en el botón "Nueva solicitud de extracción".

  3. Seleccione la rama base y la rama de comparación.

  4. Haga clic en el botón “Crear solicitud de extracción”.

  5. 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 tool
get-weatherC

Get weather information for a city

NameRequiredDescriptionDefault
cityYesCity name to get weather for

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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. 1 tool update
    • First observedget-weather

TDQS

B3/5.0

Scored across 1 tool

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness1/5

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

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    A Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.
    8
    2,198 PyPI
    61
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that provides current weather information and 3-day forecasts for specified cities using the Open-Meteo API.
    1
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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

Appeared in Searches