Weather MCP Server in TypeScript
@rehmat123
Overview
What is Weather MCP Server in TypeScript?
A Model Context Protocol (MCP) server that fetches current weather data using the Open-Meteo API. It integrates with Cursor IDE and Langchain agents, providing a single tool to retrieve weather information for any location.
How to use Weather MCP Server in TypeScript?
Install locally by cloning the repository, running npm i and npm build, then connecting via StdioClientTransport with command node dist/index.js. For remote use without local installation, use npx @rehmatalisayany/weather-mcp-server with StdioClientTransport. In Cursor IDE, add a server entry in cursor.json using the remote command and stdio transport.
Key features of Weather MCP Server in TypeScript
- Single tool
getWeatherto retrieve current weather. - Returns temperature (Celsius), conditions, humidity, and wind speed.
- Uses the free Open-Meteo API (no API key required).
- Supports both local and remote (npx) deployment.
- Can be integrated with Cursor IDE and Langchain agents.
- Written in TypeScript and distributed as an npm package.
Use cases of Weather MCP Server in TypeScript
- Get current weather information directly within Cursor IDE.
- Use as a tool in a Langchain agent or other MCP-compatible applications.
- Quickly answer weather queries without leaving the development environment.
FAQ from Weather MCP Server in TypeScript
How do I connect to the Weather MCP Server in Cursor IDE?
Add the following configuration to your cursor.json: "weather": { "command": "@rehmatalisayany/weather-mcp-server", "transport": "stdio" }.
How do I run the server locally?
Clone the repository, run npm i and npm build, then use node dist/index.js as the command in your MCP client.
How do I use the remote version without installation?
Use npx @rehmatalisayany/weather-mcp-server as the command with StdioClientTransport. No local installation is needed.
What tool does the server provide?
It provides the getWeather tool, which accepts a location string (city name) and returns temperature (Celsius), conditions (description), humidity (%), and windSpeed (m/s).
Is there example client code?
Yes, the repository includes get-weather.ts (not shown in full) that demonstrates connecting to the MCP server using StdioClientTransport.