weather-mcp
Enables users to retrieve real-time weather, multi-day forecasts, and air quality data for cities worldwide through MCP tools in Cursor or other clients, using free Open-Meteo data with no API keys required.
README
š¤ļø Weather MCP Server & Chatbot Interface for Cursor
A simple, complete Python project that implements a Model Context Protocol (MCP) Weather Server ready for Cursor IDE, paired with a Chatbot Web UI to test and converse with the weather agent.
š Features
- š MCP Server (
weather_mcp_server.py): Built with FastMCP over stdio transport. Exposes weather tools to Cursor and other MCP clients. - ā” Free Real-time Weather (
weather_service.py): Powered by Open-Meteo. No API keys needed. Works for any city globally. - š¤ Weather Agent (
agent.py): Converts natural queries ("Weather in Tokyo", "5-day forecast for London", "Air quality in Paris") into tool invocations. - š» Modern Chatbot UI (
static/&app.py): Dark-mode, glassmorphic web interface with visual weather cards, forecast tables, and tool execution badges. - š Cursor Integration (
.cursor/mcp.json): Pre-configured JSON for Cursor settings.
š Project Structure
weather-mcp-chatbot/
āāā .cursor/
ā āāā mcp.json # Cursor MCP configuration
āāā weather_service.py # Free Open-Meteo weather & geocoding integration
āāā weather_mcp_server.py # MCP Server (stdio transport for Cursor)
āāā agent.py # Weather agent NLP & tool caller
āāā app.py # FastAPI web server & chat endpoint
āāā static/
ā āāā index.html # Chatbot UI
ā āāā style.css # Modern dark-mode styling
ā āāā app.js # Chatbot frontend logic
āāā test_mcp.py # Automated test suite
āāā requirements.txt # Python dependencies
āāā README.md # Documentation & quickstart
š Quickstart
1. Install Dependencies
pip install -r requirements.txt
2. Run the Web Chatbot UI
python app.py
Open your browser and navigate to: http://127.0.0.1:8000
3. Run Automated Tests
python test_mcp.py
š How to Connect with Cursor
Cursor can connect directly to your Python MCP server to provide real-time weather data inside Cursor Chat / Composer.
Option A: Using .cursor/mcp.json (Recommended)
- Open this project directory in Cursor:
File -> Open Folder -> weather-mcp-chatbot - The
.cursor/mcp.jsonfile inside the project is automatically detected by Cursor.
Option B: Add in Cursor Settings
- In Cursor, open Settings (
Ctrl + ,orCmd + ,). - Go to Features -> MCP Servers.
- Click Add New MCP Server:
- Name:
weather - Type:
command(stdio) - Command:
python C:\Users\admin\.gemini\antigravity\scratch\weather-mcp-chatbot\weather_mcp_server.py
- Name:
- Click Save and verify the green status indicator.
Using in Cursor Chat:
In Cursor Composer or Chat, you can now ask:
- "What is the current weather in Tokyo?"
- "Check the 5-day forecast for Berlin using @weather"
- "What is the air quality in Paris?"
Cursor will call the MCP tools (get_current_weather, get_weather_forecast, get_air_quality) to fetch live data!
š ļø MCP Tools Exposed
| Tool Name | Parameters | Description |
|---|---|---|
get_current_weather |
city: str, units: str = "metric" |
Real-time temperature, condition, humidity, wind speed, pressure |
get_weather_forecast |
city: str, days: int = 5, units: str = "metric" |
Multi-day forecast with daily high/lows and rain probabilities |
get_air_quality |
city: str |
Air Quality Index (US & EU AQI), PM2.5, PM10, Ozone levels |
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.