mcpField
🌀
🌀️ MCP Weather Server (Cursor + Node.js + WSL)

🌀️ MCP Weather Server (Cursor + Node.js + WSL)

Local
github.com/mdkaifansari04Developer Tools0Updated 82w ago

About 🌀️ 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

  1. 01City weather lookup
  2. 02OpenWeatherMap API data
  3. 03`getWhetherByCityName` tool
  4. 04Cursor client configuration
  5. 05WSL and `.env` setup

Use cases

  1. 01Checking current weather for a city
  2. 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.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

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 .env configuration

πŸ› οΈ 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: env key won't work properly when using wsl. Use a .env file 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

Markdown supported

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.