WeatherAPI MCP server

Provides current weather and air quality data for any city through WeatherAPI.com, requiring only an API key for temperature, humidity, wind speed, and optional air quality metrics.
Back to servers
Provider
swonixs
Release date
Mar 20, 2025
Language
TypeScript
Package
Stats
809 downloads

This MCP server provides weather and air quality data from WeatherAPI.com, making it easy to integrate with various MCP clients like n8n, Claude Desktop App, and IDEs such as Windsurf and Cursor.

Installation

Step 1: Obtain a WeatherAPI Key

Before using the server, you need to get an API key from WeatherAPI:

  1. Visit WeatherAPI.com
  2. Create a free account
  3. Log in to your dashboard
  4. Copy your API key from the "API Keys" section

Step 2: Configure MCP Server

Add the WeatherAPI MCP server to your Windsurf MCP configuration file:

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "@swonixs/weatherapi-mcp"],
      "env": {
        "WEATHER_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Be sure to replace YOUR_API_KEY_HERE with the actual API key you obtained in Step 1.

Usage

Getting Weather Data

The MCP server provides a tool called get_weather that retrieves current weather conditions for any city.

Parameters

  • location (string): The name of the city you want weather data for

Example Response

When you request weather data, you'll receive a JSON response like this:

{
  "location": "London",
  "country": "United Kingdom",
  "temp_c": 15.0,
  "condition": "Partly cloudy",
  "humidity": 71,
  "wind_kph": 14.4,
  "air_quality": {
    "co": 230.3,
    "no2": 13.5,
    "o3": 52.9,
    "pm2_5": 8.5,
    "pm10": 12.1,
    "us-epa-index": 1
  }
}

Using With MCP Clients

The WeatherAPI MCP server works with several MCP clients:

  • n8n: Include weather data in your automation workflows
  • Claude Desktop App: Access weather information directly from the app
  • Windsurf IDE: Get weather data while working in your development environment
  • Cursor IDE: Integrate weather information into your coding workflow

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later