This project is an AI-powered interactive chatbot built using the MCP (Model Context Protocol), LangChain, and Groq's fast LLMs. It enables natural language conversations that can also interact with services like browsers, Airbnb listings, and search engines using MCP.
- ✅ Asynchronous interactive chat interface
- ✅ Memory-enabled conversational agent powered by LangChain
- ✅ Seamless integration with MCP services (Playwright, DuckDuckGo, Airbnb)
- ✅ Super-fast response via Groq API
- ✅ Simple terminal-based experience with memory management (
clear,exit) - ✅ Scalable setup with modular service integration
- Python 3.10+
mcp_useLangChainChatGroqfromlangchain_groqasynciofor non-blocking interactions.envfor managing secrets
mcp_demo/ │ ├── app.py # Main chat interface ├── .env # Stores your GROQ API Key ├── browser_mcp.json # MCP services configuration ├── requirements.txt # Project dependencies
- Clone the Repository
git clone https://github.com/your-username/mcp-demo-chatbot
cd mcp_demo- Install Dependencies
pip install -r requirements.txt- Add Your GROQ API Key
Create a .env file in the root directory:
GROQ_API_KEY=your_groq_api_key_here
- Set Up MCP Services
Create a file named browser_mcp.json:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
},
"airbnb": {
"command": "npx",
"args": ["-y", "@openbnb/mcp-server-airbnb"]
},
"duckduckgo-search": {
"command": "npx",
"args": ["-y", "duckduckgo-mcp-server"]
}
}
}Make sure Node.js and npx are installed and accessible from your terminal.
python app.pyThen start chatting! For example:
What is the weather in New York?Search for the latest AI newsFind me Airbnb rentals in Bangalore
You can also:
- Type
clearto reset memory - Type
exitto end the session
-
Takes too long to respond?
- Ensure MCP services aren't hanging.
- Try restarting the MCP subprocesses or simplify your prompt.
- Check internet connection and firewall settings.
-
FileNotFoundError?
- Confirm that
browser_mcp.jsonis in the same directory asapp.py.
- Confirm that
-
Still not working?
- Print debug logs in
app.pyor reinstall dependencies.
- Print debug logs in
User: What’s the weather in New York?
AI: Based on recent searches via DuckDuckGo, it's currently 15°C and cloudy in New York.You can extend the chatbot with even more services like:
- YouTube Search
- PDF Readers
- Finance APIs
- Calendar APIs
- Or custom tools you write yourself!
Just add them inside browser_mcp.json and make sure they're callable via MCP.
python-dotenv
mcp_use
langchain
langchain_groqMIT License. See the LICENSE file for details.
Vishwas R
Feel free to connect on LinkedIn or explore other projects on GitHub
Let me know if you’d like to turn this into a GitHub Pages landing page or want badges and shield links added at the top!