mcp server
mcp-agent-chatbot
π€ AI Agent Chatbot using MCP Server, LangChain, and Groq β Fetches real-time weather & crypto data using Open APIs. Built with Python + Streamlit UI.
Set up
Runs on your computer. Pick your agent and operating system.
This project does not publish an install method we can turn into a config. Follow the README instead.
README
synced Oct 23, 2026π§ AI Chatbot with LangChain + MCP + Groq + Real APIs
This is a full-stack intelligent chatbot application built using:
- LangChain for agent orchestration,
- Groq (LLM) for fast reasoning,
- MCP (Multi Component Protocol) for modular tools,
- Real Weather and Crypto APIs to provide live data,
- A Streamlit frontend to chat with the agent interactively.
π What This Project Does
π€ A chatbot agent that can answer questions like:
- βWhat is the weather in Tokyo?β
- βWhatβs the current price of Bitcoin?β
- And intelligently decide which tool to call (Weather or Crypto) using reasoning steps.
This is not just a mock. It actually:
- Fetches live weather data from OpenWeatherMap API.
- Fetches live crypto data from CoinGecko API via MCP server.
β¨ Features
- β Modular tools via MCP (Multi-Component Protocol)
- β
Fast LLM inference with Groq (
llama3-70b-8192) - β Custom tool integrations (weather + crypto)
- β Built from scratch with no prior Python knowledge!
- β Interactive chatbot frontend (Streamlit)
- β Loom video ready for demo and LinkedIn showcase
π οΈ Tech Stack
| Layer | Tools / Services Used |
|---|---|
| LLM | Groq (via langchain_groq) |
| Agent | LangGraph's create_react_agent() |
| Tool Infra | MCP (FastMCP + MultiServerMCPClient) |
| Frontend | Streamlit |
| APIs | OpenWeatherMap, CoinGecko |
| Language | Python (even though I was a MERN dev) |
π§© How It Works
π§ 1. Weather Tool
A simple Python server using MCP and OpenWeatherMap API.
@mcp.tool()
def get_weather(city: str) -> str:
"""Returns the current weather for a given city."""
π§ 2. Crypto Tool
Runs as an HTTP MCP server and returns current price of Bitcoin using CoinGecko API.
π§ 3. LangChain Agent
- Agent is created using
create_react_agent. - Agent can choose between tools (
weather,crypto) dynamically. - LLM backend: Groq (llama3-70b-8192) for fast reasoning.
π Getting Started
1. Clone this Repo
git clone https://github.com/your-username/ai-chatbot-mcp.git
cd ai-chatbot-mcp
2. Install Dependencies
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
Make sure you have:
- Python 3.10+
groq,langchain,streamlit,requests,langchain_groq,langgraph,dotenv, etc.
3. Setup API Keys
Create a .env file in root folder:
GROQ_API_KEY=your_groq_key_here
4. Run Servers
Start the weather tool:
python weatherserver.py
Make sure crypto MCP HTTP server is running separately on port 8000.
5. Run the Streamlit Chat App
streamlit run client.py
π§ͺ Sample Queries
| Query | What Happens Under the Hood |
|---|---|
| βWhat is the weather in Paris?β | Agent routes to Weather Tool |
| βPrice of Bitcoin?β | Agent routes to Crypto Tool |
| βCompare weather and bitcoinβ | Agent calls both and merges result |
π Connect With Me
If you liked this project, feel free to:
- β Star this repo
- π§΅ Follow me on Twitter / X
- πΌ Connect on LinkedIn
- πΉ Watch the Demo on YouTube
π Credits
- Krishnaikβs original MCP tutorial β inspired the base setup.
- MCP, LangChain, LangGraph, Groq, OpenAI, and the OSS ecosystem.
π Project Structure
.
βββ weatherserver.py # MCP stdio tool for weather
βββ cryptoserver.py # MCP HTTP tool for crypto
βββ client.py # LangChain + Groq chatbot with Streamlit
βββ .env # API keys
βββ requirements.txt
βββ README.md
π What I Learned
- Built my first Python+AI project from scratch
- Learned about LangChain tools, agents, and reasoning
- Integrated real-world APIs via MCP
- Created an actual usable chatbot UI
π‘ Even though I was a MERN developer with no Python or LangChain background, I successfully built this project by breaking down the steps, understanding each block, and putting it all together. You can too!