π€οΈ MCP Weather Server (Cursor + Node.js + WSL)
LocalAbout π€οΈ MCP Weather Server (Cursor + Node.js + WSL)
MCP Weather Server is a Node.js MCP server that fetches current weather for a city through the OpenWeatherMap API. It is designed for Cursor users running the server in WSL and configuring the API key through `.env`.
Key features
- 01City weather lookup
- 02OpenWeatherMap API data
- 03`getWhetherByCityName` tool
- 04Cursor client configuration
- 05WSL and `.env` setup
Use cases
- 01Checking current weather for a city
- 02Getting weather data in Cursor
MCP support
It exposes the `getWhetherByCityName` tool to MCP clients, returning current weather data for a named city.
Configuration
Local server config is the same for every client. Copy it into your clientβs MCP config file.
We havenβt collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEπ€οΈ MCP Weather Server (Cursor + Node.js + WSL)
This project is 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).
π¦ Features
- Exposes an MCP tool:
getWhetherByCityName - Fetches weather data for any city using OpenWeatherMap
- Compatible with Cursor AI client
- WSL support with clean
.envconfiguration
π οΈ Prerequisites
- Cursor installed
- WSL enabled with Ubuntu or other Linux distro
- Node.js and npm installed in WSL
- OpenWeatherMap API key
π§ Installation
# In WSL terminal
git clone https://github.com/your-username/mcp-weather-server
cd mcp-weather-server
npm install
π Environment Setup
Create a .env file in the root of the project:
WHETHER_API_KEY=your_openweather_api_key_here
π± The server will read this key using
dotenv.
π§ MCP Configuration (in Cursor)
In your Cursor's mcp.json (or settings UI), use the following:
{
"mcpServers": {
"demo": {
"command": "wsl",
"args": ["node", "/home/kaif/code/learnings/mcp-poc/index.js"]
}
}
}
β Note:
envkey won't work properly when usingwsl. Use a.envfile instead.
π Running the Server
In Cursor, create a new MCP Client using the demo server. Then run queries like:
getWhetherByCityName({ name: "London" })
The server will respond with current weather data for that city.
π File Structure
mcp-poc/
βββ index.js # MCP server entrypoint
βββ .env # Your API key
βββ package.json
βββ README.md
π License
MIT
β¨ Credits
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.