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+
openailibrarydotenvlibrarymcplibrary
Setup
Clone the repository:
git clone <repository_url> cd <repository_directory>Create a virtual environment and activate it:
python -m venv .venv source .venv/bin/activate # On Windows use `.venvScriptsactivate`Install the required dependencies:
pip install -r requirements.txtCreate a
.envfile in the root directory and add your OpenAI API key and other configurations:OPENAI_API_KEY=<your_openai_api_key> BASE_URL=<your_base_url> MODEL=<your_model>
Usage
Start the MCP server:
python server.pyRun the client and connect to the server:
python client.py <path_to_server_script>Interact with the client:
- Type the name of the city in English to get the weather information.
- Type
quitto 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.
Weather Query Server/Client
Project Details
- eternachen/mcp-playground
- Last Updated: 4/1/2025
Recomended MCP Servers
SSAFY 학생들을 위한 프로젝트 포트폴리오 및 면접 준비 도우미 서버
Run AI Agent in your browser.
A MCP server for Vertex AI Search
A Model Context Protocol (MCP) server that provides access to Federal Election Commission (FEC) campaign finance data through...
Essential UI blocks for building mobile web apps.
小红书MCP服务 x-s x-t js逆向
League of Legends Game Client API MCP Server
Salesforce MCP Server





