OpenWeather MCP Server

OpenWeather MCP Server

Integrates the OpenWeather API with Claude to provide real-time weather updates, 5-day forecasts, and air quality data. It enables users to query current conditions, pollution levels, and coordinate-based weather information directly within their conversations.

Category
Visit Server

README

OpenWeather MCP Server

A Model Context Protocol (MCP) server that integrates OpenWeather API with Claude, enabling real-time weather information, forecasts, and air quality data directly in your conversations.

Features

  • šŸŒ¤ļø Current Weather: Get real-time weather conditions for any city
  • šŸ“… 5-Day Forecast: Detailed weather forecasts with 3-hour intervals
  • šŸ“ Coordinate-Based Search: Get weather data using latitude and longitude
  • šŸŒ Air Quality Index: Check pollution levels and air quality data
  • šŸŒ”ļø Detailed Metrics: Temperature, humidity, wind speed, visibility, and more

Prerequisites

  • Node.js v18 or higher
  • Claude Desktop
  • OpenWeather API key (free tier available)

Installation

1. Get OpenWeather API Key

  1. Sign up at OpenWeather
  2. Navigate to "My API keys" in your account
  3. Copy your API key (note: new keys take ~2 hours to activate)

2. Clone and Setup

# Clone the repository
git clone https://github.com/MadhurToshniwal/OpenWeather-MCP-server.git
cd OpenWeather-MCP-server

# Install dependencies
npm install

# Build the project
npm run build

3. Configure Claude Desktop

Edit your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Add this configuration:

{
  "mcpServers": {
    "openweather": {
      "command": "node",
      "args": [
        "/absolute/path/to/openweather-mcp-server/dist/index.js"
      ],
      "env": {
        "OPENWEATHER_API_KEY": "your_api_key_here"
      }
    }
  }
}

Important for Windows users: Use double backslashes in paths:

"args": ["C:\\Users\\YourName\\Desktop\\openweather-mcp-server\\dist\\index.js"]

4. Restart Claude Desktop

Completely quit and restart Claude Desktop for changes to take effect.

Usage Examples

Once configured, you can ask Claude:

  • "What's the weather in Tokyo?"
  • "Give me a 5-day forecast for London"
  • "What's the weather at coordinates 40.7128, -74.0060?"
  • "Check the air quality in Beijing"
  • "Compare weather between Mumbai and Delhi"

Available Tools

get_current_weather

Get current weather conditions for a specific city.

Parameters:

  • city (required): City name
  • country_code (optional): 2-letter country code (e.g., "US", "GB")

get_forecast

Get 5-day weather forecast with 3-hour intervals.

Parameters:

  • city (required): City name
  • country_code (optional): 2-letter country code

get_weather_by_coordinates

Get current weather by geographic coordinates.

Parameters:

  • latitude (required): Latitude coordinate
  • longitude (required): Longitude coordinate

get_air_pollution

Get air quality data for specific coordinates.

Parameters:

  • latitude (required): Latitude coordinate
  • longitude (required): Longitude coordinate

API Limits

The free tier of OpenWeather API includes:

  • 1,000 API calls per day
  • 60 calls per minute
  • Current weather data
  • 5-day forecast
  • Air pollution data

Project Structure

openweather-mcp-server/
ā”œā”€ā”€ src/
│   └── index.ts          # Main server implementation
ā”œā”€ā”€ dist/                 # Compiled JavaScript (generated)
ā”œā”€ā”€ .env                  # Environment variables (not in repo)
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
└── README.md

Development

# Build the project
npm run build

# Run in development mode
npm start

Technologies Used

  • TypeScript: Type-safe development
  • Model Context Protocol (MCP): Claude integration standard
  • OpenWeather API: Weather data provider
  • Axios: HTTP client for API requests

Troubleshooting

"API key not valid"

  • Ensure your API key is correctly set in the configuration
  • New API keys take up to 2 hours to activate after signup

Tools not appearing in Claude

  • Verify the path in claude_desktop_config.json is correct
  • Restart Claude Desktop completely
  • Check that the project is built (dist folder exists)

"Cannot find module"

  • Run npm install to install dependencies
  • Ensure Node.js version is 18 or higher

License

MIT

Author

Madhur Toshniwal
šŸ“§ madhurtoshniwal03@gmail.com

Acknowledgments

  • OpenWeather API for weather data
  • Anthropic for the Model Context Protocol
  • Claude Desktop for AI integration

Built for campus placement showcase | Demonstrates API integration, TypeScript, and modern development practices

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