MCP Weather Application (Client-Server)
About
This repository contains files for building an MCP server for weather tasks.
Details
- Author
- RoystonDAlmeida
- Downloads
- 171
- Categories
- Media
Jump to
- Two MCP tools: get_alerts and get_forecast
- Fetches live data from the National Weather Service API
- Client uses LangChain and Groq for natural language understanding
- Full client-server architecture with stdio MCP transport
- Automatically selects and invokes the correct weather tool
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP Weather Application (Client-Server)Command (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Detailed setup instructions, including dependency installation and API key configuration, are in each component’s README (weather/README.md, mcp-client/README.md). To run the client and automatically start the server, execute uv run client.py ../weather/weather.py from the mcp-client/ directory. The client connects to the server via stdio.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp weather application (client-server)": {
"mcp-weather-server-roystondalmeida": {
"command": "uv",
"args": [
"run",
"client.py",
"../weather/weather.py"
]
}
}
}
}
McpServers
{
"mcp-weather-server-roystondalmeida": {
"command": "uv",
"args": [
"run",
"client.py",
"../weather/weather.py"
]
}
}
MCP Weather Application (Client-Server)
This project demonstrates a client-server application using the MCP (Model Context Protocol) framework to retrieve weather information.
weather/: Contains the MCP server code, which fetches data from the National Weather Service (NWS) API.
mcp-client/: Contains the MCP client code, which interacts with the server and uses LangChain with Groq for natural language queries.
Description
The MCP Server (weather/) provides specific tools (get_alerts, get_forecast) accessible via MCP. It connects to the NWS API to fulfill requests made through these tools.
The MCP Client (mcp-client/) connects to the MCP server, discovers its tools, and allows users to interact via a chat interface. It uses LangChain and the Groq API (Llama 3 model) to process natural language queries, determine if a server tool is needed, call the tool via MCP if necessary, and formulate a final response.
Architecture
1. The Client starts and initiates an MCP connection (via stdio) to the Server script.
2. The Client discovers the tools available on the Server.
3. The user provides a natural language query to the Client.
4. The Client uses the Groq LLM (via LangChain) to interpret the query and potentially identify the need to use a server tool.
5. If a tool is needed, the Client sends an MCP request to the Server to execute the specific tool (e.g., get_forecast) with the required arguments.
6. The Server executes the tool logic, fetching data from the NWS API.
7. The Server sends the result back to the Client via MCP.
8. The Client incorporates the tool's result into the ongoing conversation with the LLM.
9. The Client presents the final LLM-generated response to the user.
Setup
Detailed setup instructions, including dependency installation and environment configuration (like API keys), can be found in the README files within each component's directory:
Server Setup: See weather/README.md
Client Setup: See mcp-client/README.md
Running the Application
To run the client and have it automatically start and connect to the server, execute the following command from the mcp-client/ (the directory containing client.py):
uv run client.py ../weather/weather.py
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.
