MCP Weather Service
This server provides weather information for specified cities.
Retrieve weather data for cities like Fukuoka, Tokyo, Osaka, Moscow, New York, and other cities recognized by the Open-Meteo API.
Uses the
get-weatherendpoint with a requiredcityparameter.Interaction occurs through the Model Context Protocol (MCP).
Can be tested using the MCP Inspector at
http://127.0.0.1:6274.
Used to make HTTP requests to the Open-Meteo API for fetching weather information for various cities
Provides version control functionality for the weather service project, allowing users to clone, commit, and push changes
Enables users to store, share, and collaborate on the weather service project through repositories, pull requests, and issue tracking
Serves as the runtime environment for the weather service, required to execute the MCP server
Used as the programming language for implementing the weather service with type safety
Provides schema validation for the weather data retrieved from the API
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Weather Servicewhat's the weather like in Tokyo today?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Weather Service
This repository is a simple service that uses the Model Context Protocol (MCP) to provide weather information for multiple cities (Fukuoka, Tokyo, Osaka, Moscow, New York, etc.).
table of contents
Related MCP server: Weather MCP
Prerequisites
To complete this project, you need the following software:
Node.js (version 18 and above)
npm (usually installed with Node.js)
Git
How to install
Installing Node.js and npm
Download the installer from the official Node.js website and install it.
Once the installation is complete, verify it by running the following command in Terminal:
node -v
npm -vInstalling Git
Download the installer from the official Git website and install it.
Once the installation is complete, verify it by running the following command in Terminal:
git --versionProject Setup
Creating a New Project
Create a new directory and navigate to it:
mkdir my-weather-mcp
cd my-weather-mcpInitialize your npm project:
npm init -yInstall the required packages:
npm install @modelcontextprotocol/sdk axios zod typescript @types/node https-proxy-agent
npm install --save-dev ts-nodeCreate a TypeScript configuration file:
npx tsc --initEdit your
tsconfig.jsonfile as follows:
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"outDir": "./build",
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}Edit the scripts section of your
package.jsonfile as follows:
"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"
}Create the project directory structure:
mkdir -p src testClone an existing project
If you want to use an existing project, clone it:
git clone https://github.com/terisuke/my-weather-mcp.git
cd my-weather-mcp
npm installHow to use
Build and run
To build and run the project, use the following commands:
npm run build && npm run startUsing the Inspector
To test the weather service using the MCP Inspector, run the following command:
npm run build && npm run inspectOnce the Inspector is running, you can interact with the weather service by visiting http://127.0.0.1:6274 in your browser.
Get weather information
Using the Inspector, you can get weather information for the following cities:
Fukuoka
Tokyo
Osaka
Moscow
new york
Other cities can be specified, but they must be recognized by the Open-Meteo API.
Development Guide
File Structure
my-weather-mcp/
├── build/ # コンパイルされたJavaScriptファイル
├── src/ # TypeScriptソースコード
│ └── index.ts # メインのアプリケーションコード
├── test/ # テストファイル
├── package.json # プロジェクト設定
├── tsconfig.json # TypeScript設定
└── README.md # このファイルFixing the code
Edit the
src/index.tsfile to add or modify the functionality.To test your changes, run the following command:
npm run build && npm run inspectOnce you are satisfied that the changes work, commit the changes.
Upload to GitHub
Creating your first GitHub repository
Go to GitHub and create an account or log in.
Click the "+" button in the top right and select "New repository".
Enter a repository name (for example,
my-weather-mcp) and add an optional description.Set your repository to public or private and click "Create repository".
Initialize and push the local repository
In your local project directory, initialize a Git repository:
git initAdd your changes to the staging area:
git add .Commit the changes:
git commit -m "初回コミット:MCP天気サービスの実装"Add a remote repository (using the repository URL from GitHub):
git remote add origin https://github.com/ユーザー名/my-weather-mcp.gitPush the changes to the remote repository:
git push -u origin mainPushing changes to an existing repository
Add your changes to the staging area:
git add .Commit the changes:
git commit -m "変更内容の説明"Push the changes to the remote repository:
git pushCreating a pull request
Go to the repository page on GitHub.
Click the "Pull requests" tab and then click the "New pull request" button.
Select the base branch and the compare branch.
Click the “Create pull request” button.
Enter a title and description for your pull request and click the "Create pull request" button.
troubleshooting
Common problems and solutions
ERR_PACKAGE_PATH_NOT_EXPORTED Error
This error occurs when the import path of the @modelcontextprotocol/sdk package is incorrect. Please fix it as follows:
// 誤ったインポート
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";Network connection error
If you get a network error while making an API call, please check your proxy settings. You can use a proxy by setting the environment variables HTTP_PROXY or HTTPS_PROXY :
export HTTP_PROXY=http://プロキシサーバー:ポート
export HTTPS_PROXY=https://プロキシサーバー:ポートOther issues
If the problem persists, please create an issue with the following information:
The error message that occurred
The version of Node.js and npm you are using
Command executed
Expected vs. Actual Behavior
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.
Maintenance
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
- AlicenseAqualityDmaintenanceA Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.8362 PyPI60Apache 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.19 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