Integrations
Used for loading environment variables from a .env file, enabling secure configuration of API keys and other settings.
Supports repository cloning and version control for installation and deployment of the weather query service.
Integrates with OpenAI to process weather queries, requiring an API key for authentication to access weather information services.
Weather Query MCP Server/Client Example
This project is a weather query client that interacts with an MCP (Model-Client-Protocol) server to fetch and display weather information for a specified city.
Features
- Connects to an MCP server to list available tools.
- Queries weather information for a specified city.
- Displays formatted weather information including temperature, humidity, wind speed, and weather description.
Requirements
- Python 3.8+
openai
librarydotenv
librarymcp
library
Setup
- Clone the repository:Copy
- Create a virtual environment and activate it:Copy
- Install the required dependencies:Copy
- Create a
.env
file in the root directory and add your OpenAI API key and other configurations:Copy
Usage
- Start the MCP server:Copy
- Run the client and connect to the server:Copy
- Interact with the client:
- Type the name of the city in English to get the weather information.
- Type
quit
to exit the client.
Project Structure
server.py
: Contains the MCP server implementation and weather query tool.client.py
: Contains the MCP client implementation to interact with the server..env
: Environment variables for API keys and configurations..gitignore
: Specifies files and directories to be ignored by git.README.md
: Project documentation.
License
This project is licensed under the MIT License.
This server cannot be installed
An MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server that provides real-time weather information including temperature, humidity, wind speed, and sunrise/sunset times through the OpenWeatherMap API.Last updated -1PythonMIT License
- -securityFlicense-qualityA simple MCP service that allows users to query weather conditions for cities worldwide through the Cursor AI assistant.Last updated -JavaScript
- -securityAlicense-qualityAn MCP server that connects to OpenWeatherMap's API to provide current weather data and multi-day forecasts for locations worldwide in different measurement units.Last updated -51TypeScriptMIT License
- AsecurityFlicenseAqualityMCP server that provides Korean weather information using grid coordinates and the Korea Meteorological Administration API, allowing users to query current weather conditions and forecasts for specific locations in Korea.Last updated -23Python