mcpField
W
Weather MCP Server in TypeScript

Weather MCP Server in TypeScript

Local
github.com/rehmat123Media & Design0Updated 80w ago

About Weather MCP Server in TypeScript

A TypeScript MCP server that retrieves current weather for a location through the Open-Meteo API. It can be used with Cursor IDE and other MCP clients.

Key features

  1. 01Fetch weather through Open-Meteo
  2. 02Query by city or location
  3. 03Return temperature in Celsius and conditions
  4. 04Provide humidity and wind speed

Use cases

  1. 01Check a location's weather in Cursor
  2. 02Let an agent retrieve current weather data

MCP support

Exposes a `getWeather` tool to MCP clients. It accepts a location and returns current temperature, conditions, humidity, and wind speed.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"weather-mcp-server-rehmat123": {
"command": "npx",
"args": [
"-y",
"@rehmatalisayany/weather-mcp-server"
]
}
}
}
Run commandnpx -y @rehmatalisayany/weather-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@rehmatalisayany/weather-mcp-server

Tools

1

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
locationstringYesThe location to get weather data for (city name)

Details

From the project README

Weather MCP Server in TypeScript

A Model Context Protocol (MCP) server for fetching weather data using the Open-Meteo API. This server can be integrated with Cursor IDE to provide weather information through the MCP protocol.

Usage

As a Langchain Agent
https://github.com/rehmat123/Langchain-typescript/blob/main/src/langchain/weather.ts
In Cursor IDE

Add the following configuration to your cursor.json: alt text

{
  "mcp": {
    "servers": {
      "weather": {
        "command": "@rehmatalisayany/weather-mcp-server",
        "transport": "stdio"
      }
    }
  }
}
Test using MCP Client

check get-weather.ts for source code, you can run this file to connect to MCP Server

alt text

To connect with Local MCP Server first you need to install
Installation
git clone https://github.com/rehmat123/weather-mcp-server.git

go to directory and than

Install dependencies and build
npm i
npm build
Code usage in your Agent
  const transport = new StdioClientTransport({
    command: 'node',
    args: ['dist/index.js']
  });
To connect with Remote MCP Server use this, you dont need to install and compile
  const transport = new StdioClientTransport({
    command: 'npx',
    args: ['@rehmatalisayany/weather-mcp-server']
  });

API

The server provides the following tool:

  • getWeather: Get current weather for a location
    • Arguments:
      • location: String (city name or location)
    • Returns:
      • temperature: Current temperature in Celsius
      • conditions: Weather conditions description
      • humidity: Humidity percentage
      • windSpeed: Wind speed in m/s

License

MIT

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.