Weather MCP Server

Weather MCP Server

Provides current weather information for any city worldwide using the free Open-Meteo API, enabling users to query temperature, wind speed, humidity, and weather conditions through natural language.

Category
Visit Server

README

Weather MCP Server

A simple Model Context Protocol (MCP) server built with TypeScript that provides weather information using the Open-Meteo API.

Features

  • šŸŒ¤ļø Get Weather: Fetch current weather data for any city worldwide
  • šŸ‘‹ Greet: Simple greeting tool for testing
  • šŸŒ Uses free Open-Meteo API (no API key required)
  • šŸš€ Built with MCP TypeScript SDK
  • šŸ“” HTTP transport support

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Install dependencies:
npm install

Usage

Development Mode

Run the server with auto-reload:

npm run dev

Production Mode

  1. Build the TypeScript code:
npm run build
  1. Start the server:
npm start

The server will start on http://localhost:3000/mcp by default. You can change the port by setting the PORT environment variable:

PORT=8080 npm run dev

Connecting to the Server

Using MCP Inspector

The easiest way to test your server:

npx @modelcontextprotocol/inspector

Then connect to: http://localhost:3000/mcp

Using Claude Code

claude mcp add --transport http weather-server http://localhost:3000/mcp

Using VS Code

code --add-mcp "{\"name\":\"weather-server\",\"type\":\"http\",\"url\":\"http://localhost:3000/mcp\"}"

Using Cursor

Click this deeplink

Available Tools

1. get-weather

Get current weather information for any city.

Input:

{
  "city": "Sydney"
}

Output:

{
  "city": "Sydney, Australia",
  "temperature": 22.5,
  "weatherCode": 0,
  "windSpeed": 15.2,
  "humidity": 65,
  "description": "Clear sky"
}

Example queries:

  • "What's the weather in Tokyo?"
  • "Get me the current temperature in London"
  • "How's the weather in New York?"

2. greet

Simple greeting tool for testing the server.

Input:

{
  "name": "Alice"
}

Output:

{
  "greeting": "Hello, Alice! Welcome to the Weather MCP Server!"
}

API Information

This server uses the free Open-Meteo API which provides:

  • Current weather conditions
  • No API key required
  • Global coverage
  • Reliable geocoding

Project Structure

weather-mcp-server/
ā”œā”€ā”€ src/
│   └── index.ts          # Main server implementation
ā”œā”€ā”€ dist/                 # Compiled JavaScript (generated)
ā”œā”€ā”€ package.json          # Dependencies and scripts
ā”œā”€ā”€ tsconfig.json         # TypeScript configuration
└── README.md            # This file

Development

The server is built using:

  • @modelcontextprotocol/sdk: MCP TypeScript SDK
  • Express: HTTP server
  • Zod: Schema validation
  • TypeScript: Type safety

Health Check

The server includes a health check endpoint:

curl http://localhost:3000/health

Response:

{
  "status": "ok",
  "server": "weather-mcp-server",
  "version": "1.0.0"
}

Troubleshooting

Port already in use

If port 3000 is already in use, specify a different port:

PORT=8080 npm run dev

City not found

Make sure you're using the correct city name. The API uses geocoding to find cities, so try:

  • Full city names: "New York" instead of "NYC"
  • Including country if ambiguous: "London, UK" or "London, Ontario"

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured