Weather Bot MCP Server
README.md
# ๐ค๏ธ Weather Bot with AI-Powered Research
> An intelligent AI assistant that combines real-time weather data, smart web research, and graph database capabilities - all through a simple chat interface.
[](https://www.python.org/downloads/)
[](https://fastapi.tiangolo.com/)
[](https://www.docker.com/)
[](https://modelcontextprotocol.io/)
---
## ๐ฏ What is This?
Weather Bot is a smart AI assistant that can:
- ๐ก๏ธ **Tell you the weather** - Current conditions and forecasts for any city
- ๐ **Research topics** - Searches the web and gives you intelligent, grounded answers
- ๐๏ธ **Store data** - Saves information in a graph database (Neo4j)
- ๐ฌ **Chat naturally** - Just ask questions in plain English
Built using the **Model Context Protocol (MCP)**, it demonstrates how AI can seamlessly interact with multiple tools and data sources.
---
## โจ Features at a Glance
### ๐ก๏ธ Weather Information
- Current weather for any city worldwide
- Multi-day weather forecasts
- Temperature, humidity, and detailed conditions
### ๐ง Intelligent Research
- Automatically searches the web using **Firecrawl**
- Analyzes content with **Ragie** (RAG technology)
- Generates smart answers using **OpenRouter** AI
- All answers are based on real, up-to-date information
### ๐๏ธ Data Storage
- Uses **Neo4j** graph database
- Store and connect information
- Query your data anytime
### ๐จ Beautiful Interface
- Clean **Streamlit** chat UI
- No coding required - just chat!
- Works in your web browser
---
## ๐๏ธ How It Works
```mermaid
graph TB
User[๐ค You] -->|Chat| UI[๐ฅ๏ธ Beautiful Chat Interface]
UI -->|Sends Request| Server[โ๏ธ AI Brain]
Server -->|Gets Weather| Weather[๐ค๏ธ Weather API]
Server -->|Searches Web| Web[๐ Web Scraper]
Server -->|Analyzes| RAG[๐ Smart Retrieval]
Server -->|Generates Answer| AI[๐ค AI Model]
Server -->|Stores Data| DB[(๐๏ธ Database)]
style UI fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff
style Server fill:#2196F3,stroke:#333,stroke-width:2px,color:#fff
style DB fill:#FF9800,stroke:#333,stroke-width:2px,color:#fff
```
### Three Main Parts
| Component | What It Does | Where to Access |
|-----------|--------------|-----------------|
| ๐ฅ๏ธ **Chat Interface** | Where you type and see responses | http://localhost:8501 |
| โ๏ธ **AI Server** | The brain that handles your requests | http://localhost:8000 |
| ๐๏ธ **Database** | Stores your data | http://localhost:7474 |
---
## ๐ ๏ธ Technologies Used
### AI & APIs
- ๐ค **OpenRouter** - Powers the AI responses (supports GPT, Claude, etc.)
- ๐ฅ **Firecrawl** - Searches and scrapes the web
- ๐ **Ragie** - Smart document retrieval (RAG)
- ๐ค๏ธ **OpenWeatherMap** - Real-time weather data
### Core Tech
- ๐ **FastMCP** - Model Context Protocol framework
- โก **FastAPI** - High-performance backend
- ๐จ **Streamlit** - Interactive user interface
- ๐๏ธ **Neo4j** - Graph database
### Infrastructure
- ๐ณ **Docker** - Easy setup and deployment
- ๐ **Python** - Programming language
---
## ๐ฆ What You Need
Before starting, you'll need:
### Required Software
- โ
**Docker Desktop** - [Download here](https://www.docker.com/products/docker-desktop/)
### API Keys (All Free to Start!)
You'll need to sign up for these services and get free API keys:
1. ๐ค๏ธ **OpenWeatherMap** - [Get free key](https://openweathermap.org/api)
2. ๐ฅ **Firecrawl** - [Get free key](https://firecrawl.dev/)
3. ๐ **Ragie** - [Get free key](https://ragie.ai/)
4. ๐ค **OpenRouter** - [Get key](https://openrouter.ai/) (Pay-as-you-go, very cheap)
> ๐ก **Don't worry!** All services have free tiers or are very inexpensive to use.
---
## ๐ Quick Start
### Step 1: Get the Project
Download or clone this project to your computer.
### Step 2: Set Up Your Keys
1. Find the file named `.env.example`
2. Make a copy and rename it to `.env`
3. Open `.env` in any text editor
4. Add your API keys where indicated:
```
OPENWEATHER_API_KEY=paste_your_key_here
FIRECRAWL_API_KEY=paste_your_key_here
RAGIE_API_KEY=paste_your_key_here
OPENROUTER_API_KEY=paste_your_key_here
NEO4J_PASSWORD=choose_a_strong_password
```
### Step 3: Start Everything
Open your terminal/command prompt in the project folder and run:
```
docker-compose up
```
โณ **Wait 1-2 minutes** for everything to start...
### Step 4: Start Chatting!
Open your web browser and go to:
**http://localhost:8501**
That's it! ๐
---
## ๐ฌ What Can You Ask?
### Weather Questions
- "What's the weather in Paris?"
- "Give me a 5-day forecast for Tokyo"
- "Is it raining in London right now?"
### Research Questions
- "What are the latest developments in AI?"
- "Research quantum computing advancements"
- "Tell me about climate change solutions"
### Database Commands
- "Store this: Person named Alice, age 30"
- "Show me all the people in the database"
- "Create a connection between Alice and Bob"
> ๐ก **Pro Tip:** Just ask naturally! The AI will figure out which tool to use.
---
## ๐ฏ The 4 Smart Tools
### 1๏ธโฃ Current Weather
Tells you what the weather is like **right now** in any city.
**Ask:** "What's the weather in New York?"
---
### 2๏ธโฃ Weather Forecast
Shows you the weather for the **next few days**.
**Ask:** "Give me a 3-day forecast for Paris"
---
### 3๏ธโฃ Web Research
This is the smart one! It:
1. Searches the web for information
2. Reads and understands the content
3. Gives you a clear, accurate answer
**Ask:** "Research the benefits of meditation"
---
### 4๏ธโฃ Database Storage
Stores information in a graph database (great for connected data).
**Ask:** "Store a person named Alice who knows Bob"
---
## ๐ Project Files
```
weather_bot_gg/
โโโ ๐จ client.py # Chat interface
โโโ โ๏ธ server.py # AI brain with all the tools
โโโ ๐ณ docker-compose.yml # Starts everything together
โโโ ๐ requirements.txt # Python packages needed
โโโ ๐ .env # Your API keys (keep secret!)
โโโ ๐ README.md # This guide
```
---
## ๐ Access Points
Once everything is running, you can access:
| Service | URL | What It's For |
|---------|-----|---------------|
| ๐ฌ **Chat Interface** | http://localhost:8501 | Talk to the AI |
| ๐ง **API Server** | http://localhost:8000 | Backend server |
| ๐ **API Docs** | http://localhost:8000/docs | Interactive API documentation |
| ๐๏ธ **Database Browser** | http://localhost:7474 | View stored data visually |
> ๐ For Neo4j Browser, login with username `neo4j` and your password from `.env`
---
## ๐ Common Issues
### โ Port Already in Use
**Problem:** Another program is using the same port.
**Fix:** Close other applications or change the port in `docker-compose.yml`
---
### โ API Key Errors
**Problem:** "API key not set" message appears.
**Fix:**
1. Check your `.env` file exists
2. Make sure all keys are filled in
3. No extra spaces or quotes around keys
4. Restart Docker: `docker-compose restart`
---
### โ Can't Connect to Database
**Problem:** Neo4j errors or connection refused.
**Fix:** Wait! Neo4j takes 30-60 seconds to fully start. Check if it's ready:
```
docker-compose logs neo4j
```
Look for "Started" message.
---
### โ Docker Won't Start
**Fix:** Try a clean restart:
```
docker-compose down
docker-compose up --build
```
---
## ๐ Viewing Your Database
1. Go to **http://localhost:7474**
2. Login with:
- Username: `neo4j`
- Password: (what you set in `.env`)
3. You'll see a visual interface to explore your data!
---
## ๐งช Testing
### Quick Health Check
Make sure everything works:
1. **Chat Interface:** Go to http://localhost:8501 - You should see the chat
2. **Server:** Go to http://localhost:8000/health - Should say "healthy"
3. **Database:** Go to http://localhost:7474 - Should load the login page
### Try These Questions
1. "What's the weather in London?" โ Should get actual weather
2. "Research artificial intelligence" โ Should search and answer
3. Simple questions work best at first!
---
## ๐ก Tips & Best Practices
### For Best Results
- โ
Be specific in your questions
- โ
One question at a time works best
- โ
Weather: Use city names (not coordinates)
- โ
Research: Ask clear, focused questions
### Cost Management
- ๐ฐ Most API calls cost less than $0.01
- ๐ฐ OpenWeatherMap is free (up to 1000 calls/day)
- ๐ฐ Research tool is the most expensive (uses AI generation)
- ๐ฐ Monitor your usage in each service's dashboard
### Performance
- โก Weather queries: ~1 second
- โก Research queries: 10-30 seconds (lots of processing!)
- โก Database queries: ~1 second
---
## ๐ Security Notes
### Keep These Private
- โ Never share your `.env` file
- โ Never commit API keys to GitHub
- โ Change default Neo4j password
- โ
The `.gitignore` file protects your `.env` automatically
---
## ๐ Learn More
### About the Technology
- **Model Context Protocol:** https://modelcontextprotocol.io/
- **RAG (Retrieval-Augmented Generation):** AI technique for grounded answers
- **Neo4j:** Graph database for connected information
- **Docker:** Containerization for easy deployment
### Useful Resources
- [FastMCP Documentation](https://github.com/jlowin/fastmcp)
- [Streamlit Docs](https://docs.streamlit.io/)
- [Neo4j Cypher Guide](https://neo4j.com/docs/cypher-manual/current/)
---
## ๐ค Contributing
Want to improve this project?
1. Fork the repository
2. Make your changes
3. Test everything works
4. Submit a pull request
Ideas for contributions:
- ๐จ Improve the UI design
- ๐ง Add new tools
- ๐ Better documentation
- ๐ Fix bugs
---
## ๐ License
MIT License - Free to use and modify!
---
## ๐ Credits
**Built with:**
- **Model Context Protocol** by Anthropic
- **FastMCP** by Marvin
- All the amazing open-source communities
**Special Thanks:**
- OpenAI, Anthropic, and the AI community
- Docker and Python communities
- Everyone who contributed to the libraries used
---
<div align="center">
### Built with โค๏ธ using the Model Context Protocol
**Combining AI, Real-Time Data, and Smart Research**
---
โญ **Star this repo if you found it useful!**
๐ง **Questions?** Open an issue on GitHub
๐ **Happy Chatting!**
</div>
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo issues