Weather MCP Server

Weather MCP Server

Provides current weather data and hourly forecasts for any location worldwide using the Open-Meteo API, accessible through HTTP transport without requiring an API key.

Category
Visit Server

README

Weather MCP Server

A Model Context Protocol (MCP) server that provides weather data from the Open-Meteo API.

Overview

This MCP server fetches weather data from the Open-Meteo API endpoint and communicates over HTTP using the Streamable HTTP transport.

https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41&current=temperature_2m,wind_speed_10m&hourly=temperature_2m,relative_humidity_2m,wind_speed_10m

Features

  • HTTP Transport: Communicate over HTTP for remote access
  • Current Weather: Get current temperature and wind speed
  • Hourly Forecast: Access hourly temperature, relative humidity, and wind speed data
  • Flexible Coordinates: Query weather for any latitude/longitude coordinates
  • Session Management: Supports multiple concurrent client sessions

Installation

  1. Install dependencies:
npm install
  1. Build the server:
npm run build
  1. Start the server:
node build/index.js

The server will start on http://localhost:3000 by default. You can customize the port:

PORT=8080 node build/index.js

Endpoints

  • POST /mcp - Main MCP endpoint for tool calls and requests
  • GET /mcp - Server-Sent Events (SSE) endpoint for streaming
  • DELETE /mcp - Close session endpoint
  • GET /health - Health check endpoint

Tools

get_weather

Fetches current weather and hourly forecast data for specified coordinates.

Parameters:

  • latitude (number): Latitude coordinate (e.g., 52.52 for Berlin)
  • longitude (number): Longitude coordinate (e.g., 13.41 for Berlin)

Returns:

  • Current temperature (°C)
  • Current wind speed (km/h)
  • Hourly forecast data arrays
  • Complete raw API response

Usage with MCP Clients

HTTP Client (Recommended)

Use the provided HTTP client to connect to the running server:

# Start the server in one terminal
node build/index.js

# Run the client in another terminal
node mcp-http-client.js

Or create your own HTTP client using the MCP SDK:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const client = new Client(
  {
    name: "my-client",
    version: "1.0.0",
  },
  { capabilities: {} }
);

const transport = new StreamableHTTPClientTransport(
  new URL("http://localhost:3000/mcp")
);

await client.connect(transport);

// List tools
const tools = await client.listTools();

// Call a tool
const result = await client.callTool({
  name: "get_weather",
  arguments: { latitude: 47.6162, longitude: -122.0356 },
});

VS Code

Add to your .vscode/mcp.json:

{
  "servers": {
    "weather-mcp-server": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Claude Desktop

The HTTP server can be accessed by any MCP client that supports HTTP transport. Configure your client to connect to:

http://localhost:3000/mcp

Example Queries

Once connected to an MCP client, you can ask questions like:

  • "What's the current weather in Berlin?" (latitude: 52.52, longitude: 13.41)
  • "Get weather forecast for San Francisco" (latitude: 37.77, longitude: -122.42)
  • "Show me the hourly temperature forecast for Tokyo" (latitude: 35.68, longitude: 139.65)

Development

The server is built using:

API Reference

Weather data is sourced from Open-Meteo, a free weather API that provides:

  • Real-time weather data
  • Hourly forecasts
  • No API key required

License

ISC

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
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
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
VeyraX MCP

VeyraX MCP

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

Official
Featured
Local
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
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
E2B

E2B

Using MCP to run code via e2b.

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
Qdrant Server

Qdrant Server

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

Official
Featured