
mcp fetch weather
MCP for fetch wather
Repository Info
About This Server
MCP for fetch wather
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Weather Server
A Model Context Protocol (MCP) server that provides weather information using the Open-Meteo API.
Features
- Fetch current weather data for any city
- Get detailed weather information including:
- Temperature
- Precipitation
- Rain
- Relative humidity
- Wind speed
- Day/night indication
- Hourly temperature forecasts
Prerequisites
- Node.js (latest LTS version recommended)
- npm or yarn package manager
Installation
- Clone the repository:
git clone [your-repository-url]
cd mcp-fetch-weather
- Install dependencies:
npm install
Usage
The server provides the following tool:
fetch-weather
Fetches weather data for a specified city.
Parameters:
city(string): Name of the city to get weather data for
Returns:
- Current weather conditions including temperature, precipitation, humidity, and wind speed
- Hourly temperature forecast
Example Response:
{
"latitude": 40.4375,
"longitude": -3.6875,
"current": {
"temperature_2m": 20.5,
"relative_humidity_2m": 65,
"precipitation": 0,
"rain": 0,
"wind_speed_10m": 15.2,
"is_day": 1
},
"hourly": {
"temperature_2m": [...]
}
}
Visual Studio Code Integration
To use this weather server in Visual Studio Code:
-
Open your VS Code
settings.jsonfile (PressCmd+,on macOS orCtrl+,on Windows/Linux and click on "Edit in settings.json") -
Add the following configuration:
{
...
"mcp": {
"servers": {
"weather": {
"command": "npx",
"args": [
"-y",
"tsx",
"/Users/PATH TO YOUR FOLDER/main.ts"
]
},
}
}
-
Restart VS Code to apply the changes
-
Test the integration by opening the Command Palette (
Cmd+Shift+PorCtrl+Shift+P) and typing "Weather". You should see the weather commands available.
Error Handling
The server handles two main types of errors:
- CODE 001: City not found
- CODE 002: API or network error
API Dependencies
This server uses the following external APIs:
- Open-Meteo Geocoding API
- Open-Meteo Weather Forecast API
License
This project is licensed under the terms included in the LICENSE file.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For support or questions, please open an issue in the repository.
Quick Start
Clone the repository
git clone https://github.com/jald89/mcp-fetch-weatherInstall dependencies
cd mcp-fetch-weather
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.