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 Service what'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
Inputs: city (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
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
- AlicenseAqualityCmaintenanceA Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.82,325 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.113 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