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.
Before using the server, you need to get an API key from WeatherAPI:
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.
The MCP server provides a tool called get_weather
that retrieves current weather conditions for any city.
location
(string): The name of the city you want weather data forWhen 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
}
}
The WeatherAPI MCP server works with several MCP clients:
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.
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"
]
}
}
}
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.
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.