Skip to content

Intelligent weather agent powered by LLM and MCP protocol. Provides real-time weather data, forecasts and historical information through natural language queries using Groq, LangChain and multi-API orchestration.

License

Notifications You must be signed in to change notification settings

MaximPyanin/llm-agent-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM Agent for Weather Determination

LLM agent for weather information retrieval through interaction with two APIs via unified MCP interface.

Description

The agent uses:

  • Nominatim API for determining coordinates by city name
  • Open-Meteo API for retrieving weather data by coordinates
  • Groq LLM for natural language processing
  • MCP protocol for unified tool access

Supports current weather, forecasts, and historical data in multiple languages.

Installation and Setup

Requirements

  • Python 3.11+
  • UV package manager

Setup

  1. Install dependencies:

    uv sync
  2. Create .env file with API key:

    GROQ_API_KEY=your_groq_api_key_here
    

Running

Requires 2 terminals:

Terminal 1 - MCP Server:

uv run python -m app.mcp_server

Terminal 2 - UI:

uv run streamlit run app/streamlit_app.py

Usage Examples

"What's the weather in London today?"
"Weather forecast for next 3 days in Paris"
"What was the weather in Tokyo yesterday?"

Project Structure

app/
├── agents/weather_agent.py      # Main agent logic
├── prompts/system_prompt.py     # System prompt
├── schemas/                     # Pydantic schemas
├── services/                    # LLM service and settings
├── tools/                       # API tools
├── ui/weather_ui.py            # Streamlit interface
├── mcp_server.py               # MCP server
└── streamlit_app.py            # Entry point

Technical Details

  • LLM: Groq (llama3-8b-8192)
  • Framework: LangChain + LangGraph
  • Pattern: ReAct (Reasoning + Acting)
  • UI: Streamlit
  • APIs: Nominatim (OpenStreetMap) + Open-Meteo

About

Intelligent weather agent powered by LLM and MCP protocol. Provides real-time weather data, forecasts and historical information through natural language queries using Groq, LangChain and multi-API orchestration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages