Integrations
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
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
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:
Installing 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:
Project Setup
Creating a New Project
- Create a new directory and navigate to it:
- Initialize your npm project:
- Install the required packages:
- Create a TypeScript configuration file:
- Edit your
tsconfig.json
file as follows:
- Edit the scripts section of your
package.json
file as follows:
- Create the project directory structure:
Clone an existing project
If you want to use an existing project, clone it:
How to use
Build and run
To build and run the project, use the following commands:
Using the Inspector
To test the weather service using the MCP Inspector, run the following command:
Once 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
Fixing the code
- Edit the
src/index.ts
file to add or modify the functionality. - To test your changes, run the following command:
- Once 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:
- Add your changes to the staging area:
- Commit the changes:
- Add a remote repository (using the repository URL from GitHub):
- Push the changes to the remote repository:
Pushing changes to an existing repository
- Add your changes to the staging area:
- Commit the changes:
- Push the changes to the remote repository:
Creating 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:
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
:
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
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
A simple service using Model Context Protocol (MCP) to provide weather information for multiple cities including Fukuoka, Tokyo, Osaka, Moscow, and New York.
Related MCP Servers
- -securityFlicense-qualityThis is a Model Context Protocol (MCP) server that provides weather information using the National Weather Service (NWS) API. Features Get weather alerts for a US state Get weather forecast for a specific location (using latitude and longitude)Last updated -Python
- -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 -1PythonApache 2.0
- AsecurityAlicenseAqualityModel Context Protocol (MCP) server that provides weather forecast, warnings, water level associated with flood, and earthquake reports from Malaysia Government's Open API.Last updated -4PythonMIT License
- -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