MCP Weather Server
by mdkaifansari04
A simple Model Context Protocol (MCP) server that provides real-time weather data using the OpenWeatherMap API, built with Node.js and designed to run inside WSL (Windows Subsystem for Linux). It exposes an MCP tool `getWhetherByCityName`.
Last updated: N/A
What is MCP Weather Server?
This is a Model Context Protocol (MCP) server built with Node.js that fetches and provides real-time weather data for any city using the OpenWeatherMap API. It's designed to run within the Windows Subsystem for Linux (WSL) and integrates with the Cursor AI client.
How to use MCP Weather Server?
- Clone the repository into your WSL environment. 2. Install the dependencies using
npm install
. 3. Create a.env
file and add your OpenWeatherMap API key. 4. Configure the MCP server in Cursor'smcp.json
file, pointing to theindex.js
file in your WSL directory. 5. Create a new MCP Client in Cursor using the configured server and run queries likegetWhetherByCityName({ name: "London" })
.
Key features of MCP Weather Server
Exposes an MCP tool:
getWhetherByCityName
Fetches weather data for any city using OpenWeatherMap
Compatible with Cursor AI client
WSL support with clean
.env
configuration
Use cases of MCP Weather Server
Integrating real-time weather data into Cursor AI workflows
Providing weather information to AI models and agents
Building weather-aware applications within the Cursor environment
Quickly accessing weather data for any city through Cursor
Automating weather data retrieval for various tasks
FAQ from MCP Weather Server
What is MCP?
What is MCP?
MCP stands for Model Context Protocol. It's a protocol for connecting AI models and tools.
Do I need an OpenWeatherMap API key?
Do I need an OpenWeatherMap API key?
Yes, you need an API key to access weather data from OpenWeatherMap.
Why does the server need to run in WSL?
Why does the server need to run in WSL?
The server is designed to run in WSL because it simplifies the integration with Node.js and other Linux-based tools.
Can I use this server with other AI clients besides Cursor?
Can I use this server with other AI clients besides Cursor?
While designed for Cursor, the underlying Node.js server could potentially be adapted for use with other MCP-compatible clients.
What kind of weather data does the server provide?
What kind of weather data does the server provide?
The server provides current weather data, including temperature, humidity, wind speed, and weather conditions, as provided by the OpenWeatherMap API.